mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-05-30 21:00:30 +08:00
feat: 新增「关于」和「扩展工具」页面
- 关于页面:版本信息、相关项目链接、快捷链接、开源协议 - 扩展页面:cftunnel 隧道状态/路由/启停/日志 + ClawApp 状态/快捷访问 - Rust 后端:新增 extensions.rs(4 个命令:状态/操作/日志/ClawApp 检测) - 侧边栏新增「扩展」和「关于」导航项,总计 8 个页面
This commit is contained in:
@@ -107,6 +107,18 @@ function mockInvoke(cmd, args) {
|
||||
create_backup: () => ({ name: 'openclaw-20260226-160000.json', size: 8542 }),
|
||||
restore_backup: () => true,
|
||||
delete_backup: () => true,
|
||||
get_cftunnel_status: () => ({
|
||||
installed: true, version: 'cftunnel 0.7.0', running: true,
|
||||
tunnel_name: 'mac-home', pid: 73325,
|
||||
routes: [
|
||||
{ name: 'clawapp', domain: 'chat.qrj.ai', service: 'http://localhost:3210' },
|
||||
{ name: 'newapi', domain: 'newapi.qrj.ai', service: 'http://localhost:30080' },
|
||||
{ name: 'webhook', domain: 'webhook.qrj.ai', service: 'http://localhost:9801' },
|
||||
],
|
||||
}),
|
||||
cftunnel_action: () => true,
|
||||
get_cftunnel_logs: () => '2026-02-26 13:29:01 [INFO] Tunnel started\n2026-02-26 13:30:00 [INFO] Connection healthy',
|
||||
get_clawapp_status: () => ({ running: true, pid: 7752, port: 3210, url: 'http://localhost:3210' }),
|
||||
}
|
||||
const fn = mocks[cmd]
|
||||
return fn ? Promise.resolve(fn(args)) : Promise.reject(`未知命令: ${cmd}`)
|
||||
@@ -148,4 +160,10 @@ export const api = {
|
||||
createBackup: () => invoke('create_backup'),
|
||||
restoreBackup: (name) => invoke('restore_backup', { name }),
|
||||
deleteBackup: (name) => invoke('delete_backup', { name }),
|
||||
|
||||
// 扩展工具
|
||||
getCftunnelStatus: () => invoke('get_cftunnel_status'),
|
||||
cftunnelAction: (action) => invoke('cftunnel_action', { action }),
|
||||
getCftunnelLogs: (lines = 20) => invoke('get_cftunnel_logs', { lines }),
|
||||
getClawappStatus: () => invoke('get_clawapp_status'),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user