dsh-remote 0.5.9 → 0.5.10
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 +9 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -199,6 +199,14 @@ window.__ModuleLoader__.load({
|
|
|
199
199
|
const [suggest, setSuggest] = React.useState([])
|
|
200
200
|
const [suggestOpen, setSuggestOpen] = React.useState(false)
|
|
201
201
|
const suggestTimer = React.useRef(null)
|
|
202
|
+
const suggestRef = React.useRef(null)
|
|
203
|
+
// 点击候选路径下拉外部的空白处时,收起自动补全列表
|
|
204
|
+
React.useEffect(() => {
|
|
205
|
+
if (!suggestOpen) return
|
|
206
|
+
const onDown = (ev) => { if (suggestRef.current && !suggestRef.current.contains(ev.target)) setSuggestOpen(false) }
|
|
207
|
+
document.addEventListener('mousedown', onDown)
|
|
208
|
+
return () => document.removeEventListener('mousedown', onDown)
|
|
209
|
+
}, [suggestOpen])
|
|
202
210
|
// 机器下拉:点外部任意处关闭,避免候选层常驻遮挡下方按钮
|
|
203
211
|
const [mOpen, setMOpen] = React.useState(false)
|
|
204
212
|
const ddRef = React.useRef(null)
|
|
@@ -419,7 +427,7 @@ window.__ModuleLoader__.load({
|
|
|
419
427
|
),
|
|
420
428
|
),
|
|
421
429
|
// 路径输入框(带自动补全)+ 打开浏览弹层按钮
|
|
422
|
-
React.createElement('div', { style: { position: 'relative', display: 'flex', gap: 6 } },
|
|
430
|
+
React.createElement('div', { ref: suggestRef, style: { position: 'relative', display: 'flex', gap: 6 } },
|
|
423
431
|
React.createElement('input', { value: path, onChange: (e) => onPathChange(e.target.value), onFocus: () => loadSuggestions(path), placeholder: (machineId ? '输入远程路径(自动补全)' : '先选远程机器'), disabled: !machineId, style: { ...inputS, flex: 1, minWidth: 120 } }),
|
|
424
432
|
React.createElement('button', { style: { ...buttonS, whiteSpace: 'nowrap' }, onClick: () => { if (machineId) setPopOpen(true) }, disabled: !machineId }, '浏览…'),
|
|
425
433
|
// 自动补全下拉
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "Remote-work assistant for DeepSeek Harness: connect SSH (password or key), pick a remote workspace, operate on it with rw_pick_workspace / rw_list_dir / rw_read_file / rw_exec / rw_sync tools, and mirror it to a real local directory (SFTP) so the DSH native workspace can adopt it.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "flymysql <flyphp@outlook.com>",
|