dsh-ops-kit 0.3.8 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +21 -12
- package/index.js +6 -0
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -45,7 +45,8 @@ window.__ModuleLoader__.load({
|
|
|
45
45
|
test: '测试连接', testing: '测试中…', installKey: '安装公钥', installing: '安装中…',
|
|
46
46
|
connected: '已连接', disconnected: '连不上', latency: '延迟', failures: '连续失败',
|
|
47
47
|
console: '命令控制台', runCmd: '执行', cmdPh: '输入命令,例如 df -h 或 systemctl status nginx',
|
|
48
|
-
terminal: '终端', openTerm: '打开终端', closeTerm: '断开',
|
|
48
|
+
terminal: '终端', openTerm: '打开终端', closeTerm: '断开', reconnect: '重新连接',
|
|
49
|
+
termClosed: '会话已断开(服务器或网络关闭了这次连接)。点「重新连接」恢复。', termHint: '步骤:① 点「打开终端」 ② 点一下黑框 ③ 敲命令,回车执行。支持 Tab 补全、Ctrl+C、方向键。', termNeedPwd: '这个主机没有保存密码,终端需要密码登录;请到设置里编辑主机并填入密码。',
|
|
49
50
|
connecting: '正在连接…', clickConnect: '点这里连接', quickCmds: '常用命令', tip: '连上后黑框里会出现服务器提示符,像用 FinalShell 一样敲命令。',
|
|
50
51
|
aiBar: '用一句话说你想做什么', aiPh: '例如:看看磁盘还剩多少 / 重启 nginx / 查最近 50 行错误日志',
|
|
51
52
|
aiMode: 'AI 模式', aiModeHint: '输入意图后回车:命令会填进终端但不会自动执行;Esc 取消',
|
|
@@ -86,6 +87,7 @@ window.__ModuleLoader__.load({
|
|
|
86
87
|
monPreset: '一键模板', monScript: '脚本(退出码 0 = 正常)', monLanguage: '语言',
|
|
87
88
|
monScriptHint: '脚本在服务器上用对应解释器执行,退出码 0 视为正常;python 需要 python3,js 需要 node。',
|
|
88
89
|
monTypes: [['http', '网站能不能打开'], ['port', '端口通不通'], ['process', '程序还在不在'], ['service', '系统服务在不在'], ['script', '自己写检查脚本']],
|
|
90
|
+
monTypeShort: { http: '网站', port: '端口', process: '进程', service: '服务', script: '脚本' },
|
|
89
91
|
monTypeHint: {
|
|
90
92
|
http: '填网址,例如 https://example.com 或 http://127.0.0.1:8080/health',
|
|
91
93
|
port: '填 地址:端口,例如 127.0.0.1:3306(数据库)、127.0.0.1:6379(缓存)',
|
|
@@ -130,7 +132,8 @@ window.__ModuleLoader__.load({
|
|
|
130
132
|
test: 'Test', testing: 'Testing…', installKey: 'Install key', installing: 'Installing…',
|
|
131
133
|
connected: 'Connected', disconnected: 'Unreachable', latency: 'latency', failures: 'failures',
|
|
132
134
|
console: 'Command console', runCmd: 'Run', cmdPh: 'Type a command, e.g. df -h',
|
|
133
|
-
terminal: 'Terminal', openTerm: 'Open terminal', closeTerm: 'Disconnect',
|
|
135
|
+
terminal: 'Terminal', openTerm: 'Open terminal', closeTerm: 'Disconnect', reconnect: 'Reconnect',
|
|
136
|
+
termClosed: 'The session closed (server or network dropped it). Use Reconnect.', termHint: 'Steps: 1) Open terminal 2) click the dark box 3) type a command and press Enter. Tab, Ctrl+C and arrows work.', termNeedPwd: 'This host has no stored password; the terminal needs password auth. Edit the host and add one.',
|
|
134
137
|
connecting: 'Connecting…', clickConnect: 'Click to connect', quickCmds: 'Quick commands', tip: 'Once connected the prompt appears; type commands like in a normal SSH client.',
|
|
135
138
|
aiBar: 'Describe what you want to do', aiPh: 'e.g. how much disk is left / restart nginx / last 50 error lines',
|
|
136
139
|
aiMode: 'AI mode', aiModeHint: 'Type the intent and press Enter: the command is filled but not run; Esc cancels',
|
|
@@ -171,6 +174,7 @@ window.__ModuleLoader__.load({
|
|
|
171
174
|
monPreset: 'Presets', monScript: 'Script (exit 0 = healthy)', monLanguage: 'Language',
|
|
172
175
|
monScriptHint: 'Runs on the host with the chosen interpreter; exit code 0 means healthy. python needs python3, js needs node.',
|
|
173
176
|
monTypes: [['http', 'Website reachable'], ['port', 'Port open'], ['process', 'Process alive'], ['service', 'System service active'], ['script', 'Custom script']],
|
|
177
|
+
monTypeShort: { http: 'HTTP', port: 'Port', process: 'Process', service: 'Service', script: 'Script' },
|
|
174
178
|
monTypeHint: {
|
|
175
179
|
http: 'URL, e.g. https://example.com',
|
|
176
180
|
port: 'host:port, e.g. 127.0.0.1:3306',
|
|
@@ -1589,9 +1593,12 @@ window.__ModuleLoader__.load({
|
|
|
1589
1593
|
term?.id
|
|
1590
1594
|
? h('span', { className: term.closed ? 'ops-chip' : 'ops-chip ops-ok' }, term.closed ? '已断开' : '已连接')
|
|
1591
1595
|
: (busy === 'term' ? h('span', { className: 'ops-chip' }, T.connecting) : null),
|
|
1592
|
-
term?.id
|
|
1593
|
-
? h('button', { className: 'ops-btn ops-btn-sm', onClick: () => { void
|
|
1594
|
-
:
|
|
1596
|
+
term?.id && term.closed
|
|
1597
|
+
? h('button', { className: 'ops-btn ops-btn-primary ops-btn-sm', disabled: busy === 'term', onClick: () => { setTerm(null); setTimeout(() => { void openTerm() }, 50) } }, busy === 'term' ? T.connecting : T.reconnect)
|
|
1598
|
+
: term?.id
|
|
1599
|
+
? h('button', { className: 'ops-btn ops-btn-sm', onClick: () => { void closeTerm() } }, T.closeTerm)
|
|
1600
|
+
: h('button', { className: 'ops-btn ops-btn-primary ops-btn-sm', disabled: busy === 'term', onClick: () => { void openTerm() } }, busy === 'term' ? T.connecting : T.openTerm)),
|
|
1601
|
+
term?.id && term.closed ? h('p', { className: 'ops-sub', style: { margin: 0 } }, T.termClosed) : null,
|
|
1595
1602
|
h('p', { className: 'ops-sub', style: { margin: 0 } }, T.termHint),
|
|
1596
1603
|
aiMode
|
|
1597
1604
|
? h('div', { className: 'ops-card', style: { borderColor: 'var(--dsw-alias-accent,#4c8dff)' } },
|
|
@@ -1968,12 +1975,12 @@ window.__ModuleLoader__.load({
|
|
|
1968
1975
|
monitors.length === 0
|
|
1969
1976
|
? h('p', { className: 'ops-empty' }, T.monEmpty)
|
|
1970
1977
|
: h('div', null, ...monitors.map(monitor => h('div', { key: monitor.id, className: 'ops-row', style: { gridTemplateColumns: '1fr 1.1fr auto' } },
|
|
1971
|
-
h('span', { style: { display: 'flex', alignItems: 'center', gap: '
|
|
1978
|
+
h('span', { style: { display: 'flex', alignItems: 'center', gap: '8px', minWidth: 0 } },
|
|
1972
1979
|
h('i', { className: 'ops-dot ' + (monitor.lastOk === true ? 'ok' : monitor.lastOk === false ? 'bad' : '') }),
|
|
1973
|
-
h('span', { className: 'ops-name' }, monitor.label ||
|
|
1974
|
-
h('span', { className: 'ops-
|
|
1975
|
-
|
|
1976
|
-
|
|
1980
|
+
h('span', { className: 'ops-name' }, monitor.label || monitor.target || monitor.type),
|
|
1981
|
+
monitor.target && monitor.label ? h('span', { className: 'ops-mono ops-dim', style: { fontSize: '11.5px' } }, monitor.target) : null,
|
|
1982
|
+
h('span', { className: 'ops-chip' }, (T.monTypeShort || {})[monitor.type] || monitor.type)
|
|
1983
|
+
, monitor.type === 'script' ? h('span', { className: 'ops-chip' }, monitor.language || 'shell') : null),
|
|
1977
1984
|
h('span', { className: 'ops-dim' }, monitor.last ? `${monitor.last.detail} · ${fmt(monitor.last.at)}` : T.monNever),
|
|
1978
1985
|
h('span', { style: { display: 'flex', gap: '6px', justifyContent: 'flex-end' } },
|
|
1979
1986
|
h('button', { className: 'ops-btn ops-btn-sm', disabled: monBusy === 'test:' + monitor.id, onClick: () => { void testMonitor(monitor.id) } }, T.monCheck),
|
|
@@ -2120,13 +2127,15 @@ window.__ModuleLoader__.load({
|
|
|
2120
2127
|
},
|
|
2121
2128
|
h('div', { className: 'ops-modal', onClick: event => event.stopPropagation() },
|
|
2122
2129
|
h('div', { className: 'ops-modal-h' },
|
|
2123
|
-
h('span', { className: 'ops-modal-title' }, monDialog.monitor.label ||
|
|
2130
|
+
h('span', { className: 'ops-modal-title' }, `${monDialog.monitor.label || monDialog.monitor.target || monDialog.monitor.type}`),
|
|
2124
2131
|
h('button', { className: 'ops-modal-x', onClick: () => setMonDialog(null) }, '✕')),
|
|
2125
2132
|
h('div', {
|
|
2126
2133
|
className: monDialog.result?.ok ? 'ops-result-ok' : 'ops-result-bad',
|
|
2127
2134
|
style: { fontSize: '15px', marginBottom: '10px' },
|
|
2128
2135
|
}, monDialog.result?.ok ? `✓ ${T.monOk}` : `✕ ${T.monBad}`),
|
|
2129
|
-
h('div', { className: 'ops-modal-row' }, h('b', null, '
|
|
2136
|
+
h('div', { className: 'ops-modal-row' }, h('b', null, '类型'), h('span', null,
|
|
2137
|
+
`${(T.monTypeShort || {})[monDialog.monitor.type] || monDialog.monitor.type}${monDialog.monitor.language ? ' · ' + monDialog.monitor.language : ''}`)),
|
|
2138
|
+
h('div', { className: 'ops-modal-row' }, h('b', null, '目标'), h('span', { className: 'ops-mono' }, monDialog.monitor.target || (monDialog.monitor.script ? '(脚本)' : '—'))),
|
|
2130
2139
|
h('div', { className: 'ops-modal-row' }, h('b', null, '详情'), h('span', null, monDialog.result?.detail || '—')),
|
|
2131
2140
|
h('div', { className: 'ops-modal-row' }, h('b', null, T.monResult), h('span', null,
|
|
2132
2141
|
`${monDialog.result?.ms ?? '—'}ms · ${T.monChecked} ${monDialog.result?.at ? fmt(monDialog.result.at) : '—'}`)),
|
package/index.js
CHANGED
|
@@ -1960,6 +1960,12 @@ async function openTerminal(cfg, cols = 120, rows = 30) {
|
|
|
1960
1960
|
'-o', 'StrictHostKeyChecking=accept-new',
|
|
1961
1961
|
'-o', 'ServerAliveInterval=15',
|
|
1962
1962
|
'-o', 'ServerAliveCountMax=3',
|
|
1963
|
+
// A terminal must own its connection: sharing the ControlMaster socket with
|
|
1964
|
+
// the panel's short commands means the session dies when that master closes
|
|
1965
|
+
// ("Shared connection to ... closed").
|
|
1966
|
+
'-o', 'ControlMaster=no',
|
|
1967
|
+
'-o', 'ControlPath=none',
|
|
1968
|
+
'-o', 'TCPKeepAlive=yes',
|
|
1963
1969
|
]
|
|
1964
1970
|
if (cfg.port) args.push('-p', String(cfg.port))
|
|
1965
1971
|
if (cfg.key) args.push('-i', cfg.key)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ops-kit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"description": "Server operations kit for DeepSeek Harness: server cards, health charts, config browser, app manager and plain-language AI diagnosis — over SSH, no agent install.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|