dsh-remote 0.8.1 → 0.8.2
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/lib/client.js +12 -12
- package/lib/index.js +7 -4
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -230,10 +230,10 @@ window.__ModuleLoader__.load({
|
|
|
230
230
|
.catch((e) => setErr(String((e && e.message) || e)))
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
const row = (label, ctrl, k) => React.createElement('div', { key: k, style: { display: 'flex', gap: 6, alignItems: 'center' } },
|
|
233
|
+
const row = (label, ctrl, k) => React.createElement('div', { key: k, style: { display: 'flex', gap: 6, alignItems: 'center', marginBottom: 8 } },
|
|
234
234
|
React.createElement('label', { style: { width: 84, fontSize: 12, opacity: 0.8, flexShrink: 0 } }, label), ctrl)
|
|
235
235
|
|
|
236
|
-
return React.createElement('div', { style: { padding: 16, display: 'flex', flexDirection: 'column', gap: 12, maxWidth:
|
|
236
|
+
return React.createElement('div', { style: { padding: 16, display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 860 } },
|
|
237
237
|
React.createElement('div', { style: { fontSize: 15, fontWeight: 600 } }, '远程工作区(dsh-remote)'),
|
|
238
238
|
React.createElement('div', { style: { fontSize: 12, opacity: 0.8 } },
|
|
239
239
|
'维护多台 SSH 机器(密码/私钥/agent/跳板机/钥匙串)。路径在新建/选择工作区时选:「本机」走系统文件夹对话框;「远程」选一台机器在远程目录中选择。'),
|
|
@@ -251,7 +251,7 @@ window.__ModuleLoader__.load({
|
|
|
251
251
|
m.id === currentId ? React.createElement('span', { style: { color: T.ok, fontSize: 12 } }, ' · 当前') : null),
|
|
252
252
|
React.createElement('button', { style: buttonS, onClick: () => startEdit(m) }, '编辑'),
|
|
253
253
|
React.createElement('button', { style: buttonS, onClick: () => del(m.id) }, '删除'),
|
|
254
|
-
React.createElement('button', { style: buttonS, onClick: () => useNow(m.id), disabled: m.id === currentId }, '设为当前')))
|
|
254
|
+
React.createElement('button', { style: { ...buttonS, padding: '6px 10px', whiteSpace: 'nowrap' }, onClick: () => useNow(m.id), disabled: m.id === currentId }, '设为当前')))
|
|
255
255
|
: React.createElement('div', { style: { opacity: 0.6, fontSize: 12 } }, '还没有机器。在下方添加。'),
|
|
256
256
|
),
|
|
257
257
|
React.createElement('div', { style: boxS },
|
|
@@ -276,7 +276,7 @@ window.__ModuleLoader__.load({
|
|
|
276
276
|
React.createElement('option', { value: 'accept-new' }, 'accept-new(信任首次,之后校验)'),
|
|
277
277
|
React.createElement('option', { value: 'verify' }, 'verify(严格:拒绝陌生主机)'),
|
|
278
278
|
React.createElement('option', { value: 'off' }, 'off(不校验,不推荐)')), 'hkm'),
|
|
279
|
-
React.createElement('div', { style: { display: 'flex', gap: 16, paddingLeft: 90, flexWrap: 'wrap' } },
|
|
279
|
+
React.createElement('div', { style: { display: 'flex', gap: 16, paddingLeft: 90, flexWrap: 'wrap', marginBottom: 8 } },
|
|
280
280
|
React.createElement('label', { style: { fontSize: 12, display: 'flex', gap: 4, alignItems: 'center' } },
|
|
281
281
|
React.createElement('input', { type: 'checkbox', checked: form.useAgent, onChange: setFb('useAgent') }), 'SSH agent(SSH_AUTH_SOCK)'),
|
|
282
282
|
React.createElement('label', { style: { fontSize: 12, display: 'flex', gap: 4, alignItems: 'center' } },
|
|
@@ -284,12 +284,12 @@ window.__ModuleLoader__.load({
|
|
|
284
284
|
React.createElement('label', { style: { fontSize: 12, display: 'flex', gap: 4, alignItems: 'center' } },
|
|
285
285
|
React.createElement('input', { type: 'checkbox', checked: form.encryptPassword, onChange: setFb('encryptPassword') }), '加密保存密码(系统钥匙串)')),
|
|
286
286
|
row('跳板机', React.createElement('input', { value: form.proxyHost, onChange: setF('proxyHost'), placeholder: '经此主机中转(可选)', style: inputS }), 'ph'),
|
|
287
|
-
row('
|
|
288
|
-
React.createElement('input', { value: form.proxyPort, onChange: setF('proxyPort'), placeholder: '22', style: { ...inputS,
|
|
289
|
-
React.createElement('input', { value: form.proxyUser, onChange: setF('proxyUser'), placeholder: '跳板用户', style: inputS }),
|
|
290
|
-
React.createElement('input', { type: 'password', value: form.proxyPassword, onChange: setF('proxyPassword'), placeholder: '跳板密码', style: inputS }),
|
|
291
|
-
|
|
292
|
-
React.createElement('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end', alignItems: 'center' } },
|
|
287
|
+
row('端口/用户', React.createElement('div', { style: { display: 'flex', gap: 6, flex: 1, flexWrap: 'wrap' } },
|
|
288
|
+
React.createElement('input', { value: form.proxyPort, onChange: setF('proxyPort'), placeholder: '端口(22)', style: { ...inputS, minWidth: 90, maxWidth: 120 } }),
|
|
289
|
+
React.createElement('input', { value: form.proxyUser, onChange: setF('proxyUser'), placeholder: '跳板用户', style: { ...inputS, minWidth: 140 } }),
|
|
290
|
+
React.createElement('input', { type: 'password', value: form.proxyPassword, onChange: setF('proxyPassword'), placeholder: '跳板密码', style: { ...inputS, minWidth: 140 } })), 'pu'),
|
|
291
|
+
row('跳板私钥', React.createElement('input', { value: form.proxyKey, onChange: setF('proxyKey'), placeholder: '跳板私钥路径(可选)', style: inputS }), 'pk'),
|
|
292
|
+
React.createElement('div', { style: { display: 'flex', gap: 8, justifyContent: 'flex-end', alignItems: 'center', flexWrap: 'wrap', marginTop: 4 } },
|
|
293
293
|
msg ? React.createElement('span', { style: { color: T.ok, fontSize: 12, marginRight: 'auto' } }, msg) : null,
|
|
294
294
|
form.id ? React.createElement('button', { style: buttonS, onClick: () => save('delete') }, '删除') : null,
|
|
295
295
|
React.createElement('button', { style: buttonS, onClick: () => { clearForm(); setErr(''); setTst('idle') } }, form.id ? '取消编辑' : '清空'),
|
|
@@ -363,7 +363,7 @@ window.__ModuleLoader__.load({
|
|
|
363
363
|
React.createElement('a', { href: 'https://github.com/flymysql/dsh-remote', target: '_blank', rel: 'noopener noreferrer', style: { color: 'inherit' } }, '⭐ 去 GitHub 点个 Star'),
|
|
364
364
|
React.createElement('span', {}, '·'),
|
|
365
365
|
React.createElement('a', { href: 'https://github.com/flymysql/dsh-remote/issues/new', target: '_blank', rel: 'noopener noreferrer', style: { color: 'inherit' } }, '💬 反馈建议 / 提 issue'),
|
|
366
|
-
React.createElement('span', { style: { marginLeft: 'auto', opacity: 0.5 } }, 'dsh-remote v0.8.
|
|
366
|
+
React.createElement('span', { style: { marginLeft: 'auto', opacity: 0.5 } }, 'dsh-remote v0.8.2'),
|
|
367
367
|
),
|
|
368
368
|
)
|
|
369
369
|
}
|
|
@@ -665,7 +665,7 @@ window.__ModuleLoader__.load({
|
|
|
665
665
|
React.createElement('span', { style: { fontSize: 11, opacity: 0.6, whiteSpace: 'nowrap' } }, '最近:'),
|
|
666
666
|
recent.map((w, i) => React.createElement('button', { key: w + i, onClick: () => { setPath(w); setErr(''); continueSuggest(w) }, style: { ...buttonS, padding: '2px 8px', fontSize: 11, fontFamily: 'monospace' } }, w))) : null,
|
|
667
667
|
React.createElement('div', { ref: suggestRef, style: { position: 'relative' } },
|
|
668
|
-
React.createElement('div', { style: { display: 'flex', gap: 6 } },
|
|
668
|
+
React.createElement('div', { style: { display: 'flex', gap: 6, flexWrap: 'wrap' } },
|
|
669
669
|
React.createElement('input', { value: path, onChange: (e) => onPathChange(e.target.value), onFocus: () => loadSuggestions(path), placeholder: (machineId ? '输入远程路径(自动补全)' : '先选远程机器'), disabled: !machineId, style: { ...inputS, flex: 1, minWidth: 120 } }),
|
|
670
670
|
React.createElement('button', { style: { ...buttonS, whiteSpace: 'nowrap' }, onClick: () => { if (machineId) setPopOpen(true) }, disabled: !machineId }, '浏览…'),
|
|
671
671
|
React.createElement('button', { style: { ...buttonS, whiteSpace: 'nowrap' }, onClick: pickHome, disabled: !machineId }, '~ 主目录'),
|
package/lib/index.js
CHANGED
|
@@ -101,8 +101,9 @@ export const Config = z.object({
|
|
|
101
101
|
encoding: z.string().default('utf-8'),
|
|
102
102
|
/** Update mode: `manual` (default) only checks when asked; `auto` checks on
|
|
103
103
|
* load and periodically, applying a newer npm release automatically;
|
|
104
|
-
* `off` disables version checks entirely.
|
|
105
|
-
|
|
104
|
+
* `off` disables version checks entirely. (schemastery 3.18 has no .enum —
|
|
105
|
+
* keep string and validate in code.) */
|
|
106
|
+
updateMode: z.string().default('manual'),
|
|
106
107
|
/** How often (ms) auto mode checks the npm registry for a newer release. */
|
|
107
108
|
updateCheckIntervalMs: z.number().step(1).min(60000).default(6 * 3600 * 1000),
|
|
108
109
|
})
|
|
@@ -2361,12 +2362,13 @@ export async function apply(ctx, config) {
|
|
|
2361
2362
|
const current = readVersion()
|
|
2362
2363
|
const latest = await fetchLatestVersion()
|
|
2363
2364
|
if (latest === null) return sendJson(res, 200, { ok: false, current, error: '无法连接 npm registry' })
|
|
2365
|
+
const rawMode = readUpdateMode() || config.updateMode || 'manual'
|
|
2364
2366
|
return sendJson(res, 200, {
|
|
2365
2367
|
ok: true,
|
|
2366
2368
|
current,
|
|
2367
2369
|
latest,
|
|
2368
2370
|
updateAvailable: gtVersion(latest, current),
|
|
2369
|
-
updateMode:
|
|
2371
|
+
updateMode: ['manual', 'auto', 'off'].includes(rawMode) ? rawMode : 'manual',
|
|
2370
2372
|
updatedMarker: existsSync(path.join(selfDir(), '.dsh-remote-updated')),
|
|
2371
2373
|
})
|
|
2372
2374
|
},
|
|
@@ -2411,7 +2413,8 @@ export async function apply(ctx, config) {
|
|
|
2411
2413
|
// ── auto-update: check on load + on an interval; apply silently ───────────
|
|
2412
2414
|
// Failures are swallowed (never break the plugin). The persisted override
|
|
2413
2415
|
// (settings UI) wins over the profile-config default.
|
|
2414
|
-
const
|
|
2416
|
+
const rawMode = readUpdateMode() || config.updateMode || 'manual'
|
|
2417
|
+
const effectiveUpdateMode = ['manual', 'auto', 'off'].includes(rawMode) ? rawMode : 'manual'
|
|
2415
2418
|
if (effectiveUpdateMode === 'auto') {
|
|
2416
2419
|
const currentVersion = readVersion()
|
|
2417
2420
|
const checkAndApply = async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Remote-work assistant for DeepSeek Harness: connect SSH (password/key/agent/keyboard-interactive/proxy jump), pick a remote workspace, operate on it with 21 rw_* tools (incl. rw_edit/rw_stat/rw_mkdir/rw_remove/rw_move/rw_forward), conflict-aware mirror sync, port forwarding, side-bar remote file editing, audit log, keychain passwords.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "flymysql <flyphp@outlook.com>",
|