@psyduck25/dsh-session-manager 0.0.0-stage → 0.4.1
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/LICENSE +21 -0
- package/README.md +158 -2
- package/assets/icon-180.png +0 -0
- package/assets/screenshot-1.png +0 -0
- package/cordis.patch.yml +12 -0
- package/docs/DETAIL.md +60 -0
- package/docs/DETAIL.zh.md +56 -0
- package/docs/preview.svg +79 -0
- package/icon.svg +24 -0
- package/lib/client.js +1069 -0
- package/lib/index.js +1012 -0
- package/lib/state.js +148 -0
- package/lib/trash.js +216 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +68 -4
- package/screenshots.json +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-session-manager contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,159 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-session-manager(会话删除管理)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@psyduck25/dsh-session-manager` · [npm](https://www.npmjs.com/package/@psyduck25/dsh-session-manager) · MIT
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
dsh plugin add @psyduck25/dsh-session-manager
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
> 包名带 `@psyduck25/` 作用域:无作用域的 `dsh-session-manager` 在 npm 上已被其他作者占用。
|
|
10
|
+
> 装好之后在设置页里看到的仍然是「会话删除管理」,包名不影响界面。
|
|
11
|
+
|
|
12
|
+
DSH 本身没有「删除单个会话」:左侧列表只能归档会话,要真正清掉一条只能连整个工作区一起删。
|
|
13
|
+
这个插件补的就是这一块——**按工作区列出所有会话,锁住不想删的,其余走「二次确认 → 删除缓冲站 → 到期真删」**。
|
|
14
|
+
|
|
15
|
+
设置 → **会话删除管理**。
|
|
16
|
+
|
|
17
|
+
> **English summary** — DSH can archive a session but cannot delete just one; the only way to clear a
|
|
18
|
+
> session for good is to delete its whole workspace. This plugin lists every session by workspace with a
|
|
19
|
+
> lock toggle and a delete button, asks for confirmation, then moves the log into a recycle bin so the row
|
|
20
|
+
> disappears from the left list. Sessions stay recoverable for a configurable window (24 h by default,
|
|
21
|
+
> `0` = delete immediately) and are really removed when it expires.
|
|
22
|
+
> Requires DSH `>=0.2.2-rc.3`. Install with `dsh plugin add @psyduck25/dsh-session-manager`.
|
|
23
|
+
> See [docs/DETAIL.md](docs/DETAIL.md) for the full picture.
|
|
24
|
+
|
|
25
|
+
## 能做什么
|
|
26
|
+
|
|
27
|
+
- **按工作区分组列出所有会话**,带工作区名称、路径、会话标题、最后活动时间;正在运行的会话和日志缺失的会话都有标记。
|
|
28
|
+
- **锁定**:点锁定后该行的删除按钮变灰,服务端也会拒绝(不是只靠界面禁用)。再次点击解锁。
|
|
29
|
+
- **删除要二次确认**:点删除先在行内展开确认条,写明这个会话会进缓冲站、多少小时内可回档;缓冲时长为 0 时确认文案直接说「无法撤销」。
|
|
30
|
+
- **删除缓冲站**:二次确认通过的会话落到页面底部,同时**从左侧工作区列表消失**。
|
|
31
|
+
- **回档**:缓冲期内点「回档」恢复原样——日志文件搬回原目录、解除归档,所以标题、位置、工作区归属都不变。
|
|
32
|
+
- **缓冲时长可自定义**:默认 24 小时,填 0 就是二次确认后立即彻底删除。范围 0–720 小时。
|
|
33
|
+
- **到期真删**:宿主的定时器(每分钟巡检,启动 2 秒后先清一次上一轮的欠账)把到期条目的日志文件删掉、解除工作区归属、清空归档集合。
|
|
34
|
+
|
|
35
|
+
## 两段式删除具体做了什么
|
|
36
|
+
|
|
37
|
+
进入缓冲站时做两件事,各自解决一半问题:
|
|
38
|
+
|
|
39
|
+
1. **归档**:写进工作区归档集合,推一帧让左侧列表刷新,同时挡住这个会话后续被唤醒。
|
|
40
|
+
2. **把日志文件搬进回收站**:从会话目录移到 `$DSH_HOME/session-manager/trash/<会话>/`。
|
|
41
|
+
列表来自存储层的会话清单,文件不在了就没有这一行——**即使你开着「显示归档会话」也看不见它**。
|
|
42
|
+
|
|
43
|
+
| 阶段 | 对会话做的事 | 对左侧列表 |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| 进入缓冲站 | 归档 + 日志搬进回收站 | 会话彻底消失(不是变灰) |
|
|
46
|
+
| 回档 | 日志搬回原目录 + 解除归档 | 会话回到原来的位置 |
|
|
47
|
+
| 彻底删除 | 回收站目录整个移除 + 摘掉工作区归属 | 会话彻底不存在 |
|
|
48
|
+
|
|
49
|
+
工作区登记里的那个 id 自始至终没被删过,所以回档不用猜位置,原样恢复。
|
|
50
|
+
|
|
51
|
+
真正删除只在这个会话自己的目录里动以 `session.` 开头的文件;目录空了才一并删掉,
|
|
52
|
+
其余文件(比如你手工放进去的备份)一个都不碰。
|
|
53
|
+
|
|
54
|
+
如果进入缓冲站时这个会话还开着(Windows 上文件被占用搬不动),操作会直接失败并告诉你原因,
|
|
55
|
+
不会出现「显示已删但还在列表」的半截状态。到期时如果删不掉,条目标成
|
|
56
|
+
「已到期,等待清理:原因」,下一次巡检或下一次启动 DSH 再重试。
|
|
57
|
+
|
|
58
|
+
缓冲站里每行还有 **彻底删除**:点一下先展开一行确认(「彻底删除」紧挨着「回档」,
|
|
59
|
+
误点的代价是日志直接没了,所以照样要确认一次),确认后立即销毁日志,不等到期。
|
|
60
|
+
|
|
61
|
+
## 数据放在哪
|
|
62
|
+
|
|
63
|
+
`$DSH_HOME/session-manager/state.json`(默认 `~/.dsh/session-manager/state.json`):
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"version": 1,
|
|
68
|
+
"settings": { "bufferHours": 24 },
|
|
69
|
+
"locks": ["session-…"],
|
|
70
|
+
"buffer": [
|
|
71
|
+
{
|
|
72
|
+
"sessionId": "session-…",
|
|
73
|
+
"title": "…",
|
|
74
|
+
"workspaceId": "…",
|
|
75
|
+
"workspaceTitle": "DSHdev",
|
|
76
|
+
"deletedAt": 0,
|
|
77
|
+
"expiresAt": 0,
|
|
78
|
+
"originalDir": "…\\sessions\\--…--\\session-…",
|
|
79
|
+
"files": ["session.v4.jsonl.zstd"],
|
|
80
|
+
"pending": false,
|
|
81
|
+
"note": "",
|
|
82
|
+
"noteDetail": ""
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
回收站目录 `$DSH_HOME/session-manager/trash/<编码后的会话 id>/` 里放搬过去的日志文件,
|
|
89
|
+
外加一份 `meta.json` 记录原目录和文件清单——`state.json` 万一丢了也能靠它还原。
|
|
90
|
+
|
|
91
|
+
写入是「先写临时文件再替换」的原子写。文件损坏时退回默认值,不会让插件起不来。
|
|
92
|
+
|
|
93
|
+
## 接口
|
|
94
|
+
|
|
95
|
+
全部是本机 loopback 的 HTTP 路由(非本机请求一律 403):
|
|
96
|
+
|
|
97
|
+
| 路由 | 作用 |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `POST /api/dsh-session-manager/state` | 拉全量数据(顺带补搬老条目、巡检一次缓冲站) |
|
|
100
|
+
| `POST /api/dsh-session-manager/settings` | `{ bufferHours }` 或 `{ reset: true }` |
|
|
101
|
+
| `POST /api/dsh-session-manager/lock` | `{ sessionId, locked }` |
|
|
102
|
+
| `POST /api/dsh-session-manager/delete` | `{ sessionId, title, workspaceId, workspaceTitle }` |
|
|
103
|
+
| `POST /api/dsh-session-manager/restore` | `{ sessionId }` |
|
|
104
|
+
| `POST /api/dsh-session-manager/purge` | `{ sessionId }`,缓冲站里立即彻底删除 |
|
|
105
|
+
| `POST /api/dsh-session-manager/adopt` | `{ sessionId }`,把未分组会话按 cwd 挂回工作区 |
|
|
106
|
+
|
|
107
|
+
### 「未分组」里的会话可以用「归位」挂回工作区
|
|
108
|
+
|
|
109
|
+
**现象**:左侧「未分组」下面堆着一些会话,可它们的目录明明就是某个工作区的目录。
|
|
110
|
+
|
|
111
|
+
**原因**:DSH 的工作区登记只在启动时按目录把会话归并一次,之后新建的会话不会被收进去。
|
|
112
|
+
工作区里那个 id 没被登记,左侧就只能把它算作「未分组」。
|
|
113
|
+
|
|
114
|
+
**处理**:插件会算出每个未分组会话的 `cwd` 属于哪个工作区,在行上显示
|
|
115
|
+
「它的目录属于 XXX」并给一个「归位」按钮。点一下就走
|
|
116
|
+
`Workspace.attachSession()` 把它登记进去(该方法自己校验 cwd 必须解析到该工作区目录,
|
|
117
|
+
所以不会挂错),左侧随下一帧就能看到它回到正确的分组里。
|
|
118
|
+
|
|
119
|
+
只对「目录恰好等于某个已登记工作区」的会话提供归位;目录没有对应工作区的
|
|
120
|
+
会话不会出现这个按钮。
|
|
121
|
+
|
|
122
|
+
## 已知限制
|
|
123
|
+
|
|
124
|
+
- 会话标题来自日志里的标题事件;从未生成过标题的会话显示「未命名」。
|
|
125
|
+
- 正在运行的会话删不掉:插件会先拒绝(`running`),等那一轮结束再删。
|
|
126
|
+
- 打开着但没在跑的会话是「推迟搬运」的:先归档让它从列表消失,等它退出内存后
|
|
127
|
+
由巡检补搬日志文件;`stopActivity: true` 只是停掉它的活动,并不会替你保存正在跑的回合。
|
|
128
|
+
- 卸载插件不会动已经写下的 `state.json` 和回收站里的文件,也不会自动搬到别处;
|
|
129
|
+
想彻底清干净就删掉 `$DSH_HOME/session-manager/`。
|
|
130
|
+
- 回收站里的日志是完整文件,不是压缩包:清空回收站之前它会一直占着磁盘。
|
|
131
|
+
- 打开着的会话是「推迟搬运」的:归档先让它从列表消失,等它退出内存后由巡检补搬日志文件。
|
|
132
|
+
|
|
133
|
+
### 左侧列表可能残留一行(这是 DSH 客户端缓存,不是插件没删干净)
|
|
134
|
+
|
|
135
|
+
**现象**:彻底删除之后,左侧列表里仍然能看到那一行,通常挂在「未分组」下面;
|
|
136
|
+
点进去还会报 `历史加载失败: session "…" not found (session/not-found)`。
|
|
137
|
+
|
|
138
|
+
**原因**:DSH 的客户端把会话清单和投影缓存在内存里,只在收到事件时增量更新。
|
|
139
|
+
插件删除会话时,宿主侧是真的删干净了:
|
|
140
|
+
|
|
141
|
+
- 日志目录已不存在
|
|
142
|
+
- `~/.dsh/storages/workspace.json` 里已经摘掉这个 id
|
|
143
|
+
- `~/.dsh/session-manager/trash/` 里也没有它
|
|
144
|
+
- 宿主的会话列表里查不到它
|
|
145
|
+
|
|
146
|
+
但已经渲染出来的那一行要等客户端重新拉一次清单才会消失,
|
|
147
|
+
而 DSH 没有为「会话被外部删除」发事件,所以它就一直挂在那儿。
|
|
148
|
+
|
|
149
|
+
**处理**:用页面顶部「刷新界面」卡片里的 **刷新界面** 按钮。它调用
|
|
150
|
+
`globalThis.location.reload()`,让客户端重新拉一次会话列表——DSH 自己在升级提示里、
|
|
151
|
+
`ui-settings-general` 的 `reloadPage` 就是这么做的。
|
|
152
|
+
|
|
153
|
+
桌面版正式安装包的「应用」菜单里没有「刷新页面」这一项(源码里它包在
|
|
154
|
+
`...development ? [...] : []` 里,只有开发模式才出现),所以这个按钮是插件补上的入口。
|
|
155
|
+
按钮不可用时(页面不能自我刷新)会提示改用 F12 打开开发者工具后按 Ctrl+R。
|
|
156
|
+
|
|
157
|
+
**同理**,如果你开着「显示归档会话」开关,被归档但还没补搬文件的会话会**变灰**
|
|
158
|
+
留在原位置——灰色是 DSH 对归档会话的正常表现,不是插件的问题。
|
|
159
|
+
等它退出内存、巡检把日志搬进回收站之后,这一行才会真正消失。
|
|
Binary file
|
|
Binary file
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# dsh-session-manager(会话删除管理)
|
|
2
|
+
#
|
|
3
|
+
# 一份 bundle 只插一行:宿主行负责本地路由和缓冲站定时器,
|
|
4
|
+
# 浏览器半侧(package.json 的 dsh.client)负责设置页。
|
|
5
|
+
#
|
|
6
|
+
# 行 id 保持 dsh-session-manager 不变(它是插件的标识,改了会和已装副本撞车);
|
|
7
|
+
# name 必须等于 package.json 的 name —— 包已改为带作用域的 @psyduck25/dsh-session-manager,
|
|
8
|
+
# 因为无作用域的 dsh-session-manager 在 npm 上已被其他作者占用。
|
|
9
|
+
|
|
10
|
+
- insert:
|
|
11
|
+
- id: dsh-session-manager
|
|
12
|
+
name: '@psyduck25/dsh-session-manager'
|
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# Session manager
|
|
4
|
+
|
|
5
|
+
DSH can archive a session, but it cannot delete just one — the only way to clear a session for good
|
|
6
|
+
is to delete the whole workspace. This plugin fills that gap.
|
|
7
|
+
|
|
8
|
+
Open **Settings → 会话删除管理 (Session manager)** and you get every session in the profile, grouped by
|
|
9
|
+
workspace, with a lock button and a delete button on each row.
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
- **Every session, grouped by workspace** — workspace name, path, session title and last activity.
|
|
14
|
+
Running sessions and sessions whose log is missing are marked.
|
|
15
|
+
- **Lock** — a locked session cannot be deleted; the Host refuses too, so it is not just a disabled button.
|
|
16
|
+
Click again to unlock.
|
|
17
|
+
- **Delete with a second confirmation** — the row expands into a confirm bar that tells you exactly what
|
|
18
|
+
will happen, including how long the session stays recoverable. With a buffer of 0 it says outright
|
|
19
|
+
that the deletion cannot be undone.
|
|
20
|
+
- **Recycle bin** — confirmed deletions drop to the bottom of the page *and disappear from the left
|
|
21
|
+
workspace list*, because the log file is moved out of the session directory rather than merely archived.
|
|
22
|
+
- **Restore** — while the buffer lasts, one click puts the log back where it was. Title, position and
|
|
23
|
+
workspace membership are all unchanged, because the workspace registry never dropped the id.
|
|
24
|
+
- **Configurable buffer** — 24 hours by default, `0` means delete immediately after confirmation.
|
|
25
|
+
Range 0–720 hours.
|
|
26
|
+
- **Expiry really deletes** — a Host timer (every minute, plus once two seconds after startup) removes
|
|
27
|
+
expired logs, detaches the session from its workspace and clears the archive entry.
|
|
28
|
+
|
|
29
|
+
## Two-step deletion, step by step
|
|
30
|
+
|
|
31
|
+
| Stage | What happens to the session | What you see in the left list |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| Into the recycle bin | archived + log file moved to `$DSH_HOME/session-manager/trash/<session>/` | gone completely (not greyed out) |
|
|
34
|
+
| Restore | log moved back + unarchived | back in its original place |
|
|
35
|
+
| Delete for good | trash directory removed + workspace membership detached | no longer exists |
|
|
36
|
+
|
|
37
|
+
Moving the file matters: archiving alone only greys a row out while **Show archived sessions** is on.
|
|
38
|
+
With the file gone from the session directory, the store cannot list it, so the row is not there at all.
|
|
39
|
+
|
|
40
|
+
Only files starting with `session.` inside that one session's directory are touched; anything else you may
|
|
41
|
+
have put there is left alone, and the directory itself is removed only when it ends up empty.
|
|
42
|
+
|
|
43
|
+
## Where the data lives
|
|
44
|
+
|
|
45
|
+
`$DSH_HOME/session-manager/state.json` holds the settings, the locks and the buffer entries. Writes are
|
|
46
|
+
atomic (temp file + rename), and a corrupted file falls back to defaults instead of breaking startup.
|
|
47
|
+
Each trash directory also carries a `meta.json` with the original directory and file list, so the buffer
|
|
48
|
+
can still be recovered from disk if `state.json` is lost.
|
|
49
|
+
|
|
50
|
+
## Known limitations
|
|
51
|
+
|
|
52
|
+
- A session that is **running** cannot be deleted; the plugin refuses and asks you to stop it first.
|
|
53
|
+
- A session that is merely **open** is deferred: it is archived first so it leaves the list, then the
|
|
54
|
+
sweeper moves its log once it leaves memory. `stopActivity` stops activity, it does not save your turn.
|
|
55
|
+
- Sessions that never produced a title show as *unnamed*.
|
|
56
|
+
- The buffer holds real log files, not archives, so they keep using disk space until expiry or purge.
|
|
57
|
+
- **The left list may keep a stale row** after a deletion. That is the DSH client's in-memory snapshot,
|
|
58
|
+
not leftover data: the log directory, the workspace registry and the trash are all clean. DSH emits no
|
|
59
|
+
event for "a session was deleted externally", so the rendered row stays until the client refetches.
|
|
60
|
+
Use the **Reload UI** button on the settings page (it calls `location.reload()`) to clear it.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# 会话删除管理
|
|
4
|
+
|
|
5
|
+
DSH 本身能归档会话,但删不掉单个会话——想彻底清掉一条,只能连整个工作区一起删。
|
|
6
|
+
这个插件补的就是这一块。
|
|
7
|
+
|
|
8
|
+
打开 **设置 → 会话删除管理**,会看到这个配置下所有的会话,按工作区分组,每行一个锁定按钮和一个删除按钮。
|
|
9
|
+
|
|
10
|
+
## 能做什么
|
|
11
|
+
|
|
12
|
+
- **按工作区分组列出所有会话**:工作区名称、路径、会话标题、最后活动时间;正在运行的会话和日志缺失的会话都有标记。
|
|
13
|
+
- **锁定**:锁住的会话删不掉,宿主也会拒绝(不是只靠界面禁用)。再点一次解锁。
|
|
14
|
+
- **删除要二次确认**:点删除后行内展开确认条,明确写出会发生什么、多少小时内可以回档;
|
|
15
|
+
缓冲时长为 0 时文案直接告诉你无法撤销。
|
|
16
|
+
- **删除缓冲站**:二次确认通过的会话落到页面底部,**同时从左侧工作区列表消失**——
|
|
17
|
+
因为日志文件是被移出了会话目录,而不只是加了个归档标记。
|
|
18
|
+
- **回档**:缓冲期内点一下就把日志搬回原位,标题、位置、工作区归属都不变,
|
|
19
|
+
因为工作区登记里那个 id 自始至终没被删过。
|
|
20
|
+
- **缓冲时长可自定义**:默认 24 小时,填 `0` 就是二次确认后立即彻底删除。范围 0–720 小时。
|
|
21
|
+
- **到期真删**:宿主每分钟巡检一次(启动 2 秒后先清一次上一轮的欠账),
|
|
22
|
+
把到期条目的日志删掉、解除工作区归属、清空归档集合。
|
|
23
|
+
|
|
24
|
+
## 两段式删除具体做了什么
|
|
25
|
+
|
|
26
|
+
| 阶段 | 对会话做的事 | 左侧列表里的表现 |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| 进入缓冲站 | 归档 + 日志文件搬到 `$DSH_HOME/session-manager/trash/<会话>/` | 彻底消失(不是变灰) |
|
|
29
|
+
| 回档 | 日志搬回原目录 + 解除归档 | 回到原来的位置 |
|
|
30
|
+
| 彻底删除 | 回收站目录整个移除 + 摘掉工作区归属 | 彻底不存在 |
|
|
31
|
+
|
|
32
|
+
搬文件这一步是关键:只做归档的话,用户开着「显示归档会话」时那一行只会变灰留在原地;
|
|
33
|
+
文件不在会话目录里之后,存储层列不出它,这一行才真的不存在。
|
|
34
|
+
|
|
35
|
+
只动那一个会话目录里以 `session.` 开头的文件,你在旁边放的其他文件一概不碰;
|
|
36
|
+
目录空了才一并删掉。
|
|
37
|
+
|
|
38
|
+
## 数据放在哪
|
|
39
|
+
|
|
40
|
+
`$DSH_HOME/session-manager/state.json` 保存设置、锁和缓冲站条目。写入是原子的
|
|
41
|
+
(临时文件 + 替换),文件损坏时退回默认值而不是让插件起不来。
|
|
42
|
+
|
|
43
|
+
每个回收站目录里还有一份 `meta.json`,记着原目录和文件清单——`state.json` 万一丢了,
|
|
44
|
+
靠它也能还原。
|
|
45
|
+
|
|
46
|
+
## 已知限制
|
|
47
|
+
|
|
48
|
+
- **正在运行的会话删不掉**:插件会直接拒绝并让你先停掉它。
|
|
49
|
+
- 只是**打开着**的会话是「推迟搬运」的:先归档让它从列表消失,等它退出内存后由巡检补搬日志文件;
|
|
50
|
+
`stopActivity` 只停活动,不会替你保存正在跑的回合。
|
|
51
|
+
- 从未生成过标题的会话显示为**未命名**。
|
|
52
|
+
- 缓冲站里放的是完整日志而不是压缩包,到期或彻底删除之前会一直占着磁盘。
|
|
53
|
+
- **左侧列表可能残留一行**:那是 DSH 客户端的内存快照,不是数据没删干净
|
|
54
|
+
(日志目录、工作区登记、回收站都是干净的)。DSH 没有为「会话被外部删除」发事件,
|
|
55
|
+
已经渲染出来的行要等客户端重新拉清单才会消失。用设置页上的 **刷新界面** 按钮
|
|
56
|
+
(它调用 `location.reload()`)即可清掉。
|
package/docs/preview.svg
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300" role="img" aria-labelledby="t">
|
|
2
|
+
<title id="t">Sessions grouped by workspace with lock and delete controls, above a recycle bin holding deleted sessions</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="smCard" x1="0" y1="0" x2="0" y2="1">
|
|
5
|
+
<stop offset="0" stop-color="#ffffff"/>
|
|
6
|
+
<stop offset="1" stop-color="#f4f6f8"/>
|
|
7
|
+
</linearGradient>
|
|
8
|
+
<linearGradient id="smBin" x1="0" y1="0" x2="0" y2="1">
|
|
9
|
+
<stop offset="0" stop-color="#fdf6f5"/>
|
|
10
|
+
<stop offset="1" stop-color="#faeceb"/>
|
|
11
|
+
</linearGradient>
|
|
12
|
+
</defs>
|
|
13
|
+
|
|
14
|
+
<rect width="640" height="300" fill="#eef1f4"/>
|
|
15
|
+
|
|
16
|
+
<!-- session list card -->
|
|
17
|
+
<rect x="32" y="24" width="576" height="164" rx="12" fill="url(#smCard)" stroke="#d9dee4"/>
|
|
18
|
+
|
|
19
|
+
<!-- workspace header -->
|
|
20
|
+
<path d="M50 44c0-2.2 1.8-4 4-4h9l3.6 4.2h17.8c2.2 0 4 1.8 4 4v11c0 2.2-1.8 4-4 4H54c-2.2 0-4-1.8-4-4V44Z" fill="none" stroke="#7b8794" stroke-width="2" stroke-linejoin="round"/>
|
|
21
|
+
<rect x="105" y="49" width="74" height="7" rx="3.5" fill="#6b7785"/>
|
|
22
|
+
|
|
23
|
+
<!-- session row 1 -->
|
|
24
|
+
<rect x="46" y="72" width="548" height="34" rx="8" fill="#ffffff" stroke="#dde2e7"/>
|
|
25
|
+
<rect x="58" y="86" width="132" height="7" rx="3.5" fill="#4a5563"/>
|
|
26
|
+
<g stroke="#4a5563" stroke-width="1.9" fill="none" stroke-linecap="round">
|
|
27
|
+
<rect x="452" y="84" width="15" height="10" rx="2.5"/>
|
|
28
|
+
<path d="M455.5 84v-2.6a3.8 3.8 0 0 1 7.6 0V84"/>
|
|
29
|
+
</g>
|
|
30
|
+
<g stroke="#c2453b" stroke-width="1.9" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
31
|
+
<path d="M496 83h14"/>
|
|
32
|
+
<path d="M500.5 83v-2.2c0-.9.7-1.6 1.6-1.6h3.8c.9 0 1.6.7 1.6 1.6V83"/>
|
|
33
|
+
<path d="M498.6 83l.9 9.4c.1 1 .9 1.8 1.9 1.8h3.2c1 0 1.8-.8 1.9-1.8l.9-9.4"/>
|
|
34
|
+
</g>
|
|
35
|
+
|
|
36
|
+
<!-- session row 2 (locked) -->
|
|
37
|
+
<rect x="46" y="114" width="548" height="34" rx="8" fill="#ffffff" stroke="#dde2e7"/>
|
|
38
|
+
<rect x="58" y="128" width="98" height="7" rx="3.5" fill="#4a5563"/>
|
|
39
|
+
<rect x="166" y="125" width="44" height="14" rx="4" fill="#eef1f4" stroke="#d3d9df"/>
|
|
40
|
+
<g stroke="#3f4a57" stroke-width="1.8" fill="#3f4a57" fill-opacity="0.14" stroke-linecap="round">
|
|
41
|
+
<rect x="170" y="129" width="10" height="7" rx="2"/>
|
|
42
|
+
<path d="M172.2 129v-1.8a2.8 2.8 0 0 1 5.6 0V129"/>
|
|
43
|
+
</g>
|
|
44
|
+
<g stroke="#9aa4ae" stroke-width="1.9" fill="none" stroke-linecap="round">
|
|
45
|
+
<rect x="452" y="126" width="15" height="10" rx="2.5"/>
|
|
46
|
+
<path d="M455.5 126v-2.6a3.8 3.8 0 0 1 6.9-2.1"/>
|
|
47
|
+
</g>
|
|
48
|
+
<g stroke="#c0c7ce" stroke-width="1.9" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
49
|
+
<path d="M496 125h14"/>
|
|
50
|
+
<path d="M500.5 125v-2.2c0-.9.7-1.6 1.6-1.6h3.8c.9 0 1.6.7 1.6 1.6V125"/>
|
|
51
|
+
<path d="M498.6 125l.9 9.4c.1 1 .9 1.8 1.9 1.8h3.2c1 0 1.8-.8 1.9-1.8l.9-9.4"/>
|
|
52
|
+
</g>
|
|
53
|
+
|
|
54
|
+
<!-- session row 3 (confirm) -->
|
|
55
|
+
<rect x="46" y="156" width="548" height="20" rx="6" fill="#ffffff" stroke="#e6b3ae"/>
|
|
56
|
+
<rect x="58" y="162" width="112" height="7" rx="3.5" fill="#4a5563"/>
|
|
57
|
+
<rect x="330" y="160" width="112" height="12" rx="4" fill="#f7e4e2"/>
|
|
58
|
+
<rect x="456" y="160" width="58" height="12" rx="4" fill="#c2453b"/>
|
|
59
|
+
<rect x="522" y="160" width="58" height="12" rx="4" fill="#ffffff" stroke="#d3d9df"/>
|
|
60
|
+
|
|
61
|
+
<!-- recycle bin card -->
|
|
62
|
+
<rect x="32" y="200" width="576" height="76" rx="12" fill="url(#smBin)" stroke="#e3c9c6"/>
|
|
63
|
+
<g stroke="#c2453b" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
64
|
+
<path d="M50 220h16"/>
|
|
65
|
+
<path d="M55 220v-2.6c0-1 .8-1.8 1.8-1.8h4.4c1 0 1.8.8 1.8 1.8V220"/>
|
|
66
|
+
<path d="M52.6 220l1 11c.1 1.2 1.1 2.1 2.3 2.1h4c1.2 0 2.2-.9 2.3-2.1l1-11"/>
|
|
67
|
+
<path d="M58.4 224.6v5M63 224.6v5"/>
|
|
68
|
+
</g>
|
|
69
|
+
<rect x="82" y="214" width="66" height="7" rx="3.5" fill="#a1544d"/>
|
|
70
|
+
|
|
71
|
+
<rect x="46" y="232" width="548" height="32" rx="8" fill="#ffffff" stroke="#e9d5d2"/>
|
|
72
|
+
<rect x="58" y="244" width="124" height="7" rx="3.5" fill="#4a5563"/>
|
|
73
|
+
<rect x="196" y="242" width="86" height="12" rx="4" fill="#f6ecea"/>
|
|
74
|
+
<g stroke="#3f7a5c" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
75
|
+
<path d="M498 249.5a9 9 0 1 0 2.8-6.6"/>
|
|
76
|
+
<path d="M497.4 239.4v4.6h4.6"/>
|
|
77
|
+
</g>
|
|
78
|
+
<rect x="518" y="243" width="62" height="11" rx="4" fill="#eaf2ed" stroke="#cfe0d6"/>
|
|
79
|
+
</svg>
|
package/icon.svg
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36" role="img" aria-label="Session manager">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="smIconLid" x1="0" y1="0" x2="0" y2="1">
|
|
4
|
+
<stop offset="0" stop-color="#4a5563"/>
|
|
5
|
+
<stop offset="1" stop-color="#39424e"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="smIconBody" x1="0" y1="0" x2="0" y2="1">
|
|
8
|
+
<stop offset="0" stop-color="#5b6875"/>
|
|
9
|
+
<stop offset="1" stop-color="#454f5b"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
<g stroke="#39424e" stroke-width="2" stroke-linecap="round" fill="none">
|
|
13
|
+
<path d="M9 11.5h18"/>
|
|
14
|
+
<path d="M14.2 11.5V9.2c0-1.05.85-1.9 1.9-1.9h3.8c1.05 0 1.9.85 1.9 1.9v2.3"/>
|
|
15
|
+
</g>
|
|
16
|
+
<path d="M10.9 11.5h14.2l-1.05 14.6a2.6 2.6 0 0 1-2.6 2.4h-6.9a2.6 2.6 0 0 1-2.6-2.4L10.9 11.5Z" fill="url(#smIconBody)"/>
|
|
17
|
+
<path d="M10.9 11.5h14.2l-.13 1.9H11.03l-.13-1.9Z" fill="url(#smIconLid)"/>
|
|
18
|
+
<g stroke="#f2f5f8" stroke-width="1.8" stroke-linecap="round">
|
|
19
|
+
<path d="M15.6 17.4v6.4"/>
|
|
20
|
+
<path d="M20.4 17.4v6.4"/>
|
|
21
|
+
</g>
|
|
22
|
+
<path d="M25.3 22.6a4.2 4.2 0 1 0-1.3 3.1" fill="none" stroke="#c2453b" stroke-width="1.9" stroke-linecap="round"/>
|
|
23
|
+
<path d="M24.9 18.6v4.3h-4.3" fill="none" stroke="#c2453b" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/>
|
|
24
|
+
</svg>
|