From 31a7a99dbdc68427072c0018b85c379f08889506 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Fri, 27 Feb 2026 01:43:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=86=85=E5=AE=B9=EF=BC=8C=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B9=B6=E5=A2=9E=E5=BC=BA=E4=BF=9D=E6=B4=BB?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=EF=BC=9B=E8=B0=83=E6=95=B4=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/routes/cnb-board/live/live-content.ts | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/assistant/src/routes/cnb-board/live/live-content.ts b/assistant/src/routes/cnb-board/live/live-content.ts index 2aac2c1..ca9500d 100644 --- a/assistant/src/routes/cnb-board/live/live-content.ts +++ b/assistant/src/routes/cnb-board/live/live-content.ts @@ -20,7 +20,6 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => { _opencodeURL.password = token const opencodeUrlSecret = _opencodeURL.toString() - // console.log('btoa opencode auth: ', Buffer.from(`root:${token}`).toString('base64')) const kevisualUrl = url.replace('{{port}}', '51515') @@ -38,11 +37,6 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => { - OpenWebUI: ${openWebUrl} - Kevisual: ${kevisualUrl} -### 直接访问 -- Kevisual: ${kevisualUrl} -- OpenCode: ${url?.replace('{{port}}', '4096')} -- VSCode Web: ${vscodeWebUrl} - ### 密码访问 - OpenClaw: ${openclawUrlSecret} - OpenCode: ${opencodeUrlSecret} @@ -54,6 +48,9 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => { 使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。 +保活说明 +方法1: 使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。 + 1. 安装插件[CNB LIVE](https://chromewebstore.google.com/detail/cnb-live/iajpiophkcdghonpijkcgpjafbcjhkko?pli=1) 2. 打开vscode web获取,点击插件,获取json数据,替换keep.json中的数据,保持在线状态。 3. keep.json中的数据结构说明: @@ -62,6 +59,7 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => { - url: vscode web的访问地址,可以直接访问vscode web 4. 运行cli命令,ev cnb live -c /workspace/live/keep.json.(直接对话opencode或者openclaw调用cnb-live技能即可) +方法2:环境变量设置CNB_COOKIE,直接opencode或者openclaw的ui界面对话说,cnb-keep-live保活,他会自动调用保活,同时不需要点cnb-lie插件获取配置。 ` const labels = [ { @@ -126,7 +124,7 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => { } const createOSInfo = (more = false) => { - const labels: Array<{ key: string; title: string; value: string; description: string }> = [] + const labels: Array<{ key: string; title: string; value: string | number; description: string }> = [] const startTimer = useKey('CNB_BUILD_START_TIME') || '' // CPU 使用率 @@ -203,7 +201,7 @@ const createOSInfo = (more = false) => { { key: 'cpuCores', title: 'CPU 核心数', - value: `${cpus.length}`, + value: cpus.length, description: 'CPU 核心数' }, { @@ -257,8 +255,8 @@ const createOSInfo = (more = false) => { { key: 'buildUptime', title: '构建已运行时间', - value: buildUptimeStr, - description: '构建已运行时间' + value: buildUptime, + description: `构建已运行时间: ${buildUptimeStr}` } ) if (maxRunTime > 0) { @@ -281,8 +279,8 @@ const createOSInfo = (more = false) => { labels.unshift({ key: 'remainingTime', title: '剩余时间', - value: formatUptime(Math.floor((maxRunTime - buildUptime) / 1000)) + ' ' + timeTo4Str, - description: '构建剩余时间' + value: maxRunTime - buildUptime, + description: '构建剩余时间' + formatUptime(Math.floor((maxRunTime - buildUptime) / 1000)) + ' ' + timeTo4Str }) } }