Skip to content

Commit 0ff4e93

Browse files
author
linyuan.yang
committed
内网穿透
1 parent a485bfd commit 0ff4e93

25 files changed

Lines changed: 1567 additions & 10 deletions

‎packages/admin/src/i18n/en.ts‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default {
3636
reload: 'Reload Config',
3737
reload_success: 'Configuration reloaded',
3838
token_usage: 'Token Usage',
39+
tunnel: 'Tunnel',
3940
theme_light: 'Light',
4041
theme_dark: 'Dark',
4142
theme_system: 'System',
@@ -825,4 +826,58 @@ export default {
825826
confirm_stop_all: 'Stop all ACP processes?',
826827
stopped: 'Stopped',
827828
},
829+
tunnel: {
830+
title: 'Tunnel',
831+
logs_title: 'Logs',
832+
833+
intro_hint: 'Configure multiple tunnels to run in parallel; each exposes its own public URL. Users pick whichever one works for them.',
834+
privacy_warning: 'When enabled, external traffic to sbot is routed through a third-party service (Cloudflare or localtunnel). Only enable this if you trust the provider.',
835+
836+
empty: 'No tunnels configured yet. Use the buttons above to add one.',
837+
entry_id_label: 'ID',
838+
entry_id_hint: 'Stable identifier used by the API. Allowed: letters, digits, ._- (max 64 chars).',
839+
entry_name_label: 'Name',
840+
entry_name_placeholder: 'Human-friendly alias',
841+
entry_enabled_label: 'Enabled',
842+
entry_enabled: 'Allow start, and auto-start with sbot',
843+
844+
state: 'State',
845+
running: 'Running',
846+
stopped_state: 'Stopped',
847+
disabled: 'Disabled',
848+
error: 'Error',
849+
public_url: 'Public URL',
850+
uptime: 'Uptime',
851+
last_error: 'Last error',
852+
copy: 'Copy',
853+
copy_all_urls: 'Copy all URLs',
854+
copied: 'Copied',
855+
copy_failed: 'Copy failed',
856+
857+
provider_cloudflare_quick: 'Cloudflare Quick Tunnel (no account)',
858+
provider_cloudflare_token: 'Cloudflare Named Tunnel (token)',
859+
provider_localtunnel: 'Localtunnel (fallback)',
860+
861+
quick_hint: 'Quick Tunnel needs no account; cloudflared is auto-downloaded. The URL changes on every restart. Recommended for development only.',
862+
token_label: 'Cloudflare tunnel token',
863+
token_hint: 'After creating a tunnel in Cloudflare Zero Trust → Networks → Tunnels, copy the long base64 token from the "Install connector" step.',
864+
token_url_label: 'Public URL (manual)',
865+
token_url_hint: 'A Token Tunnel\'s public URL is what you configured under Public Hostname in Cloudflare (e.g. https://bot.example.com). Set it here for display.',
866+
867+
lt_subdomain_label: 'Subdomain (optional)',
868+
lt_subdomain_hint: 'Leave blank to be assigned randomly. Reusing a subdomain keeps the URL stable across restarts.',
869+
lt_first_visit_hint: 'Note: localtunnel\'s first visit asks the user to enter their IP on a verification page once.',
870+
871+
start: 'Start',
872+
stop: 'Stop',
873+
start_all: 'Start all',
874+
stop_all: 'Stop all',
875+
started: 'Started',
876+
stopped: 'Stopped',
877+
no_logs: '(no logs yet)',
878+
879+
delete_confirm: 'Delete entry "{id}"?',
880+
invalid_id: 'ID "{id}" is invalid (only A-Z a-z 0-9 ._- allowed, max 64 chars)',
881+
duplicate_id: 'Duplicate ID: "{id}"',
882+
},
828883
}

‎packages/admin/src/i18n/zh.ts‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default {
3636
reload: '重载配置',
3737
reload_success: '配置已重载',
3838
token_usage: 'Token 消耗',
39+
tunnel: '内网穿透',
3940
theme_light: '浅色',
4041
theme_dark: '深色',
4142
theme_system: '跟随系统',
@@ -825,4 +826,58 @@ export default {
825826
confirm_stop_all: '确定要停止所有 ACP 进程吗?',
826827
stopped: '已停止',
827828
},
829+
tunnel: {
830+
title: '内网穿透',
831+
logs_title: '运行日志',
832+
833+
intro_hint: '配置多个 tunnel 同时运行,每个独立暴露公网 URL。外网访问时哪个能用就用哪个。',
834+
privacy_warning: '启用 tunnel 后,外网到 sbot 的访问流量会经过第三方服务(Cloudflare 或 localtunnel)。仅在你信任该服务时启用。',
835+
836+
empty: '尚未配置任何 tunnel。点击上方按钮添加。',
837+
entry_id_label: 'ID',
838+
entry_id_hint: '只读标识,用于 API 引用;只允许字母、数字、._-,最多 64 字符',
839+
entry_name_label: '名称',
840+
entry_name_placeholder: '便于识别的别名',
841+
entry_enabled_label: '启用',
842+
entry_enabled: '启用后允许启动,并随 sbot 自动拉起',
843+
844+
state: '状态',
845+
running: '运行中',
846+
stopped_state: '已停止',
847+
disabled: '已禁用',
848+
error: '出错',
849+
public_url: '公网地址',
850+
uptime: '已运行',
851+
last_error: '最近错误',
852+
copy: '复制',
853+
copy_all_urls: '复制全部公网地址',
854+
copied: '已复制',
855+
copy_failed: '复制失败',
856+
857+
provider_cloudflare_quick: 'Cloudflare Quick Tunnel(免账号)',
858+
provider_cloudflare_token: 'Cloudflare Named Tunnel(需 token)',
859+
provider_localtunnel: 'Localtunnel(备选)',
860+
861+
quick_hint: 'Quick Tunnel 不需要账号,cloudflared 会自动下载。每次启动 URL 都会变化,仅推荐开发调试。',
862+
token_label: 'Cloudflare Tunnel Token',
863+
token_hint: '在 Cloudflare Zero Trust → Networks → Tunnels 创建 tunnel 后,"Install connector" 步骤里的 token(一长串 base64)。',
864+
token_url_label: '公网 URL(手动填入)',
865+
token_url_hint: 'Token Tunnel 的 URL 由你在 Cloudflare 后台 Public Hostname 设置(如 https://bot.example.com)。这里填入仅作展示用。',
866+
867+
lt_subdomain_label: '子域名(可选)',
868+
lt_subdomain_hint: '不填则随机分配。指定固定子域可让 URL 跨重启保持不变。',
869+
lt_first_visit_hint: '提示:localtunnel 首次访问会要求在浏览器输入 IP 验证页通过一次。',
870+
871+
start: '启动',
872+
stop: '停止',
873+
start_all: '全部启动',
874+
stop_all: '全部停止',
875+
started: '已启动',
876+
stopped: '已停止',
877+
no_logs: '(暂无日志)',
878+
879+
delete_confirm: '确定删除入口 "{id}"?',
880+
invalid_id: 'ID "{id}" 不合法(只允许 A-Z a-z 0-9 ._-,最多 64 字符)',
881+
duplicate_id: 'ID "{id}" 重复',
882+
},
828883
}

‎packages/admin/src/layouts/Layout.vue‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const menuGroups = computed(() => [
106106
{
107107
group: t('nav.group_monitor'),
108108
items: [
109+
{ label: t('nav.tunnel'), key: '/tunnel' },
109110
{ label: t('nav.processes'), key: '/processes' },
110111
{ label: t('nav.heartbeats'), key: '/heartbeats' },
111112
{ label: t('nav.token_usage'), key: '/token-usage' },

‎packages/admin/src/router/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const routes = [
2121
{ path: '/skills', component: () => import('@/views/runtime/SkillsView.vue') },
2222
{ path: '/prompts', component: () => import('@/views/runtime/PromptsView.vue') },
2323
// 管理
24+
{ path: '/tunnel', component: () => import('@/views/admin/TunnelView.vue') },
2425
{ path: '/processes', component: () => import('@/views/admin/ProcessesView.vue') },
2526
{ path: '/heartbeats', component: () => import('@/views/admin/HeartbeatView.vue') },
2627
{ path: '/scheduler', component: () => import('@/views/admin/SchedulerView.vue') },

0 commit comments

Comments
 (0)