feat: 优化文档内容,移除冗余信息并增强保活说明;调整构建信息数据类型

This commit is contained in:
2026-02-27 01:43:18 +08:00
parent a9ce575be5
commit 31a7a99dbd

View File

@@ -20,7 +20,6 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
_opencodeURL.password = token _opencodeURL.password = token
const opencodeUrlSecret = _opencodeURL.toString() const opencodeUrlSecret = _opencodeURL.toString()
// console.log('btoa opencode auth: ', Buffer.from(`root:${token}`).toString('base64')) // console.log('btoa opencode auth: ', Buffer.from(`root:${token}`).toString('base64'))
const kevisualUrl = url.replace('{{port}}', '51515') const kevisualUrl = url.replace('{{port}}', '51515')
@@ -38,11 +37,6 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
- OpenWebUI: ${openWebUrl} - OpenWebUI: ${openWebUrl}
- Kevisual: ${kevisualUrl} - Kevisual: ${kevisualUrl}
### 直接访问
- Kevisual: ${kevisualUrl}
- OpenCode: ${url?.replace('{{port}}', '4096')}
- VSCode Web: ${vscodeWebUrl}
### 密码访问 ### 密码访问
- OpenClaw: ${openclawUrlSecret} - OpenClaw: ${openclawUrlSecret}
- OpenCode: ${opencodeUrlSecret} - OpenCode: ${opencodeUrlSecret}
@@ -54,6 +48,9 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。 使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。
保活说明
方法1 使用插件访问vscode web获取wss进行保活,避免长时间不操作导致的自动断开连接。
1. 安装插件[CNB LIVE](https://chromewebstore.google.com/detail/cnb-live/iajpiophkcdghonpijkcgpjafbcjhkko?pli=1) 1. 安装插件[CNB LIVE](https://chromewebstore.google.com/detail/cnb-live/iajpiophkcdghonpijkcgpjafbcjhkko?pli=1)
2. 打开vscode web获取,点击插件获取json数据替换keep.json中的数据保持在线状态。 2. 打开vscode web获取,点击插件获取json数据替换keep.json中的数据保持在线状态。
3. keep.json中的数据结构说明 3. keep.json中的数据结构说明
@@ -62,6 +59,7 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
- url: vscode web的访问地址可以直接访问vscode web - url: vscode web的访问地址可以直接访问vscode web
4. 运行cli命令ev cnb live -c /workspace/live/keep.json.(直接对话opencode或者openclaw调用cnb-live技能即可) 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 = [ const labels = [
{ {
@@ -126,7 +124,7 @@ export const getLiveMdContent = (opts?: { more?: boolean }) => {
} }
const createOSInfo = (more = false) => { 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') || '' const startTimer = useKey('CNB_BUILD_START_TIME') || ''
// CPU 使用率 // CPU 使用率
@@ -203,7 +201,7 @@ const createOSInfo = (more = false) => {
{ {
key: 'cpuCores', key: 'cpuCores',
title: 'CPU 核心数', title: 'CPU 核心数',
value: `${cpus.length}`, value: cpus.length,
description: 'CPU 核心数' description: 'CPU 核心数'
}, },
{ {
@@ -257,8 +255,8 @@ const createOSInfo = (more = false) => {
{ {
key: 'buildUptime', key: 'buildUptime',
title: '构建已运行时间', title: '构建已运行时间',
value: buildUptimeStr, value: buildUptime,
description: '构建已运行时间' description: `构建已运行时间: ${buildUptimeStr}`
} }
) )
if (maxRunTime > 0) { if (maxRunTime > 0) {
@@ -281,8 +279,8 @@ const createOSInfo = (more = false) => {
labels.unshift({ labels.unshift({
key: 'remainingTime', key: 'remainingTime',
title: '剩余时间', title: '剩余时间',
value: formatUptime(Math.floor((maxRunTime - buildUptime) / 1000)) + ' ' + timeTo4Str, value: maxRunTime - buildUptime,
description: '构建剩余时间' description: '构建剩余时间' + formatUptime(Math.floor((maxRunTime - buildUptime) / 1000)) + ' ' + timeTo4Str
}) })
} }
} }