From c3ed4c9c8ff71f77d4c6a3a225a624003eb7e954 Mon Sep 17 00:00:00 2001 From: dtzp555-max Date: Sun, 8 Mar 2026 10:20:34 +1000 Subject: [PATCH] ui: add CLI copy helper + bump version to 0.9.2 (#10) Co-authored-by: Tao --- openclaw-manager.js | 16 ++++++++++++---- package.json | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/openclaw-manager.js b/openclaw-manager.js index 10fffa5..95c5a10 100644 --- a/openclaw-manager.js +++ b/openclaw-manager.js @@ -24,7 +24,7 @@ const SCRIPT_DIR = __dirname; const MANAGER_CONFIG = path.join(SCRIPT_DIR, 'manager-config.json'); let PORT = 3333; let HOST = '0.0.0.0'; -const APP_VERSION = '0.9.0'; +const APP_VERSION = '0.9.2'; // --port 参数 const portIdx = process.argv.indexOf('--port'); if (portIdx !== -1 && process.argv[portIdx + 1]) PORT = parseInt(process.argv[portIdx + 1]) || 3333; @@ -2185,6 +2185,7 @@ const MAIN_HTML_BODY = String.raw` + @@ -2550,7 +2551,7 @@ const I18N = { 'ch.peerId':'Peer ID','ch.peerIdHint':'(群组 ID 或用户 ID)','ch.peerIdTip':'留空则匹配所有对应类型的 Peer', 'ch.submit':'添加绑定', 'l.sub':'选择运行模式', - 'cli.open':'⌨️ 终端','cli.title':'⌨️ CLI 终端','cli.clear':'清空','cli.collapse':'▼ 收起', + 'cli.open':'⌨️ 终端','cli.title':'⌨️ CLI 终端','cli.copy':'复制命令','cli.clear':'清空','cli.collapse':'▼ 收起', 'cli.ready':'── 终端就绪,等待命令 ──','cli.cleared':'── 已清空 ──', 'cli.presets':'── 常用命令 ──','cli.builtins':'内置命令','cli.favs':'我的收藏', 'cli.run':'▶ 执行','cli.stop':'■ 停止','cli.star':'⭐','cli.manage':'管理', @@ -2691,7 +2692,7 @@ const I18N = { 'ch.peerId':'Peer ID','ch.peerIdHint':'(Group ID or User ID)','ch.peerIdTip':'Leave blank to match all peers of this type', 'ch.submit':'Add Binding', 'l.sub':'Select Mode', - 'cli.open':'⌨️ Terminal','cli.title':'⌨️ CLI Terminal','cli.clear':'Clear','cli.collapse':'▼ Collapse', + 'cli.open':'⌨️ Terminal','cli.title':'⌨️ CLI Terminal','cli.copy':'Copy cmd','cli.clear':'Clear','cli.collapse':'▼ Collapse', 'cli.ready':'── Terminal Ready ──','cli.cleared':'── Cleared ──', 'cli.presets':'── Presets ──','cli.builtins':'Built-in','cli.favs':'My Favorites', 'cli.run':'▶ Run','cli.stop':'■ Stop','cli.star':'⭐','cli.manage':'Manage', @@ -3690,7 +3691,14 @@ async function deleteAuth(key){ } function copyText(txt){ - navigator.clipboard.writeText(txt).then(()=>toast('已复制','success')).catch(()=>toast('复制失败','error')); + navigator.clipboard.writeText(txt).then(()=>toast(lang==='en'?'Copied':'已复制','success')).catch(()=>toast(lang==='en'?'Copy failed':'复制失败','error')); +} + +function copyCliCommand(){ + const inp=document.getElementById('cliInput'); + const cmd=(inp&&inp.value?inp.value:'').trim(); + if(!cmd){ toast(lang==='en'?'Nothing to copy (CLI input is empty)':'没有可复制的命令(输入框为空)','error'); return; } + copyText(cmd); } diff --git a/package.json b/package.json index 3a5380c..cebd80d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw-manager", - "version": "0.9.1", + "version": "0.9.2", "description": "A local web UI for managing OpenClaw AI agents \u2014 no npm install required", "main": "openclaw-manager.js", "scripts": {