@jiyr0119/dsh-service-console 0.3.0 → 0.3.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/README.md +8 -1
- package/README.zh.md +7 -0
- package/demo/index.html +657 -0
- package/dsh.plugin.json +1 -1
- package/dynamic/host.js +0 -1
- package/lib/client.js +81 -51
- package/lib/host/lifecycle.js +0 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# DSH Service Console
|
|
2
2
|
|
|
3
|
-
**English**
|
|
3
|
+
**[English](README.md)** | [中文](README.zh.md)
|
|
4
4
|
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://www.npmjs.com/package/@jiyr0119/dsh-service-console)
|
|
7
7
|
[](https://www.npmjs.com/package/@jiyr0119/dsh-service-console)
|
|
8
8
|
[](https://awesome-dsh-plugin.com)
|
|
9
9
|
[](https://github.com/Jiyr0119/dsh-service-console)
|
|
10
|
+
[](https://github.com/Jiyr0119/dsh-service-console/stargazers)
|
|
10
11
|
|
|
11
12
|
> A local development service console for DSH: discover listening ports, identify services related to the current conversation or workspace, and safely inspect, stop, or restart them.
|
|
12
13
|
|
|
@@ -43,6 +44,8 @@ Alternative — dynamic paste (zero-build, process-local): paste `dynamic/host.j
|
|
|
43
44
|
|
|
44
45
|
The preview shows the complete local listening-service list and the expanded inspector card. The ownership badge remains visible as a safety signal, while the list itself is no longer split into conversation/workspace/machine categories.
|
|
45
46
|
|
|
47
|
+
**[→ Interactive Demo](./demo/index.html)** — try the Service Console UI in your browser (no installation required).
|
|
48
|
+
|
|
46
49
|
## Permissions & safety
|
|
47
50
|
|
|
48
51
|
- The client never sends raw PIDs or shell commands; it targets a service ID and the Host re-validates PID / start time / fingerprint before acting.
|
|
@@ -76,6 +79,10 @@ npm run build && node --test test/process-inspector.test.mjs # run a single fi
|
|
|
76
79
|
|
|
77
80
|
Unit tests import the built output under `lib/`, so the sources must be compiled first — `npm test` handles this automatically.
|
|
78
81
|
|
|
82
|
+
## Star
|
|
83
|
+
|
|
84
|
+
If you find this plugin useful, please consider giving it a ⭐ star on [GitHub](https://github.com/Jiyr0119/dsh-service-console). Your support helps keep the project alive and motivates further development.
|
|
85
|
+
|
|
79
86
|
## License
|
|
80
87
|
|
|
81
88
|
MIT
|
package/README.zh.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/@jiyr0119/dsh-service-console)
|
|
8
8
|
[](https://awesome-dsh-plugin.com)
|
|
9
9
|
[](https://github.com/Jiyr0119/dsh-service-console)
|
|
10
|
+
[](https://github.com/Jiyr0119/dsh-service-console/stargazers)
|
|
10
11
|
|
|
11
12
|
> A local development service console for DSH: discover listening ports, identify services related to the current conversation or workspace, and safely inspect, stop, or restart them.
|
|
12
13
|
>
|
|
@@ -45,6 +46,8 @@ dsh plugin --profile web add -w @jiyr0119/dsh-service-console@latest
|
|
|
45
46
|
|
|
46
47
|
预览展示本机完整监听服务列表与展开后的检查卡片。归属徽标仍作为安全提示保留,但列表不再按对话 / 工作区 / 本机拆分隐藏服务。
|
|
47
48
|
|
|
49
|
+
**[→ 交互式演示](./demo/index.html)** — 无需安装即可在浏览器中体验 Service Console 界面。
|
|
50
|
+
|
|
48
51
|
## 权限与安全
|
|
49
52
|
|
|
50
53
|
- Client 不直接传任意 PID 或 Shell 命令,只以 service ID 为目标,Host 在操作前重新校验 PID / 启动时间 / fingerprint。
|
|
@@ -78,6 +81,10 @@ npm run build && node --test test/process-inspector.test.mjs # 单独运行某
|
|
|
78
81
|
|
|
79
82
|
单元测试直接 import 构建产物(`lib/`),因此需要先编译源码——`npm test` 会自动完成。
|
|
80
83
|
|
|
84
|
+
## Star
|
|
85
|
+
|
|
86
|
+
如果觉得这个插件好用,欢迎在 [GitHub](https://github.com/Jiyr0119/dsh-service-console) 上给一个 ⭐ Star,你的支持是持续维护的动力!
|
|
87
|
+
|
|
81
88
|
## 许可证
|
|
82
89
|
|
|
83
90
|
MIT
|
package/demo/index.html
ADDED
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>DSH Service Console · Interactive Demo</title>
|
|
7
|
+
<meta name="description" content="Interactive mock preview of the DSH Service Console plugin: discover listening ports, identify services, and safely inspect, stop, or restart them." />
|
|
8
|
+
<style>
|
|
9
|
+
* { box-sizing: border-box; }
|
|
10
|
+
html, body { height: 100%; }
|
|
11
|
+
body {
|
|
12
|
+
margin: 0;
|
|
13
|
+
font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
|
|
14
|
+
color: #e8e8e8;
|
|
15
|
+
background: radial-gradient(1200px 600px at 20% -10%, #1c2430 0%, #0d1117 55%, #080b0f 100%);
|
|
16
|
+
display: flex; flex-direction: column; align-items: center;
|
|
17
|
+
padding: 24px 16px 40px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* ---- demo 说明条 ---- */
|
|
21
|
+
.demo-note {
|
|
22
|
+
max-width: 960px; width: 100%;
|
|
23
|
+
background: rgba(255,255,255,.05);
|
|
24
|
+
border: 1px solid rgba(255,255,255,.08);
|
|
25
|
+
border-radius: 12px;
|
|
26
|
+
padding: 10px 16px;
|
|
27
|
+
margin-bottom: 14px;
|
|
28
|
+
font-size: 12.5px;
|
|
29
|
+
color: #aeb6c2;
|
|
30
|
+
display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
|
|
31
|
+
}
|
|
32
|
+
.demo-note b { color: #e8e8e8; }
|
|
33
|
+
.demo-note a { color: #6ea8fe; text-decoration: none; }
|
|
34
|
+
.demo-note a:hover { text-decoration: underline; }
|
|
35
|
+
.demo-note .pill {
|
|
36
|
+
margin-left: auto; flex: none;
|
|
37
|
+
background: rgba(65,118,230,.16); color: #9ec5ff;
|
|
38
|
+
border: 1px solid rgba(65,118,230,.35);
|
|
39
|
+
border-radius: 999px; padding: 2px 10px; font-size: 11.5px;
|
|
40
|
+
}
|
|
41
|
+
.demo-lang {
|
|
42
|
+
flex: none; cursor: pointer; border: 1px solid rgba(255,255,255,.2); background: transparent;
|
|
43
|
+
color: #cfd6e0; border-radius: 999px; padding: 2px 10px; font-size: 11.5px;
|
|
44
|
+
}
|
|
45
|
+
.demo-lang:hover { border-color: #6ea8fe; color: #fff; }
|
|
46
|
+
|
|
47
|
+
/* ---- 舞台:模拟 DSH 窗口 ---- */
|
|
48
|
+
.demo-stage {
|
|
49
|
+
position: relative;
|
|
50
|
+
width: min(960px, 100%);
|
|
51
|
+
height: min(620px, calc(100dvh - 130px));
|
|
52
|
+
min-height: 440px;
|
|
53
|
+
background: #15171a;
|
|
54
|
+
border: 1px solid rgba(255,255,255,.09);
|
|
55
|
+
border-radius: 18px;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
box-shadow: 0 24px 70px rgba(0,0,0,.55);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* ---- 会话头部(面包屑 + 工具区) ---- */
|
|
61
|
+
.demo-header {
|
|
62
|
+
position: absolute; top: 0; left: 0; right: 0; z-index: 5;
|
|
63
|
+
display: flex; align-items: center; gap: 12px;
|
|
64
|
+
padding: 8px 16px;
|
|
65
|
+
border-bottom: 1px solid rgba(255,255,255,.07);
|
|
66
|
+
background: rgba(21,23,26,.92);
|
|
67
|
+
}
|
|
68
|
+
.demo-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
|
|
69
|
+
.demo-header-left .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
|
|
70
|
+
.demo-crumbs { display: flex; align-items: center; gap: 4px; font-size: 12.5px; min-width: 0; overflow: hidden; }
|
|
71
|
+
.demo-crumbs .crumb { color: #9aa3b0; background: transparent; border: 0; padding: 2px 4px; border-radius: 6px; font: inherit; }
|
|
72
|
+
.demo-crumbs .crumb-sep { color: #565e69; }
|
|
73
|
+
.demo-crumbs .crumb-current { color: #e8e8e8; font-weight: 600; }
|
|
74
|
+
.demo-header-utils { display: flex; align-items: center; gap: 8px; flex: none; }
|
|
75
|
+
|
|
76
|
+
/* Session log 胶囊(DSH 原生) */
|
|
77
|
+
.demo-sessionlog {
|
|
78
|
+
border: 1px solid rgba(255,255,255,.16);
|
|
79
|
+
min-width: 96px; height: 32px;
|
|
80
|
+
color: #e8e8e8; font-family: inherit; cursor: default;
|
|
81
|
+
background: transparent; border-radius: 18px;
|
|
82
|
+
justify-content: center; align-items: center; gap: 4px;
|
|
83
|
+
padding: 6px 12px; font-size: 13px; font-weight: 400; line-height: 20px;
|
|
84
|
+
display: inline-flex; flex: none; opacity: .85;
|
|
85
|
+
}
|
|
86
|
+
.demo-sessionlog span, .demo-sessionlog svg { flex: none; }
|
|
87
|
+
.demo-sessionlog span { white-space: nowrap; }
|
|
88
|
+
.demo-sessionlog:hover { background: rgba(255,255,255,.07); }
|
|
89
|
+
|
|
90
|
+
/* 插件入口胶囊:功能名称 + 图标(与真实插件一致) */
|
|
91
|
+
.demo-stage .sc-hicon {
|
|
92
|
+
border: 1px solid rgba(255,255,255,.16);
|
|
93
|
+
height: 32px;
|
|
94
|
+
color: #e8e8e8;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
background: transparent;
|
|
97
|
+
border-radius: 18px;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
align-items: center;
|
|
100
|
+
gap: 4px;
|
|
101
|
+
padding: 6px 12px;
|
|
102
|
+
font-size: 13px;
|
|
103
|
+
font-weight: 400;
|
|
104
|
+
line-height: 20px;
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
flex: none;
|
|
107
|
+
}
|
|
108
|
+
.demo-stage .sc-hicon:hover { background: rgba(255,255,255,.07); }
|
|
109
|
+
.demo-stage .sc-hicon.active {
|
|
110
|
+
background: rgba(65,118,230,.18);
|
|
111
|
+
border-color: rgba(65,118,230,.45);
|
|
112
|
+
color: #9ec5ff;
|
|
113
|
+
}
|
|
114
|
+
.demo-stage .sc-hicon svg { flex: none; }
|
|
115
|
+
|
|
116
|
+
/* ---- Service Console 面板 ---- */
|
|
117
|
+
.sc-panel {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 44px;
|
|
120
|
+
right: 16px;
|
|
121
|
+
width: 520px;
|
|
122
|
+
max-height: calc(100% - 60px);
|
|
123
|
+
background: #1e2025;
|
|
124
|
+
border: 1px solid rgba(255,255,255,.12);
|
|
125
|
+
border-radius: 12px;
|
|
126
|
+
box-shadow: 0 12px 40px rgba(0,0,0,.45);
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
z-index: 10;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
opacity: 0;
|
|
132
|
+
transform: translateY(-8px) scale(.97);
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
transition: opacity .18s, transform .18s;
|
|
135
|
+
}
|
|
136
|
+
.sc-panel.open {
|
|
137
|
+
opacity: 1;
|
|
138
|
+
transform: translateY(0) scale(1);
|
|
139
|
+
pointer-events: auto;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* 面板头部 */
|
|
143
|
+
.sc-head {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
gap: 8px;
|
|
147
|
+
padding: 10px 14px;
|
|
148
|
+
border-bottom: 1px solid rgba(255,255,255,.08);
|
|
149
|
+
background: rgba(30,32,37,.95);
|
|
150
|
+
}
|
|
151
|
+
.sc-head-title {
|
|
152
|
+
flex: 1;
|
|
153
|
+
font-size: 14px;
|
|
154
|
+
font-weight: 600;
|
|
155
|
+
color: #e8e8e8;
|
|
156
|
+
}
|
|
157
|
+
.sc-head-btn {
|
|
158
|
+
width: 28px; height: 28px;
|
|
159
|
+
display: flex; align-items: center; justify-content: center;
|
|
160
|
+
background: transparent;
|
|
161
|
+
border: 1px solid rgba(255,255,255,.12);
|
|
162
|
+
border-radius: 6px;
|
|
163
|
+
color: #9aa3b0;
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
font-size: 12px;
|
|
166
|
+
}
|
|
167
|
+
.sc-head-btn:hover { background: rgba(255,255,255,.08); color: #e8e8e8; }
|
|
168
|
+
|
|
169
|
+
/* Tab 栏 */
|
|
170
|
+
.sc-tabs {
|
|
171
|
+
display: flex;
|
|
172
|
+
border-bottom: 1px solid rgba(255,255,255,.08);
|
|
173
|
+
background: rgba(30,32,37,.95);
|
|
174
|
+
}
|
|
175
|
+
.sc-tab {
|
|
176
|
+
flex: 1;
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
gap: 6px;
|
|
181
|
+
padding: 10px 0;
|
|
182
|
+
font-size: 13px;
|
|
183
|
+
color: #9aa3b0;
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
border: none;
|
|
186
|
+
background: transparent;
|
|
187
|
+
border-bottom: 2px solid transparent;
|
|
188
|
+
transition: color .15s, border-color .15s;
|
|
189
|
+
}
|
|
190
|
+
.sc-tab:hover { color: #e8e8e8; }
|
|
191
|
+
.sc-tab.active {
|
|
192
|
+
color: #e8e8e8;
|
|
193
|
+
border-bottom-color: #6ea8fe;
|
|
194
|
+
}
|
|
195
|
+
.sc-tab svg { flex: none; }
|
|
196
|
+
|
|
197
|
+
/* 搜索栏 */
|
|
198
|
+
.sc-search {
|
|
199
|
+
padding: 10px 14px;
|
|
200
|
+
border-bottom: 1px solid rgba(255,255,255,.06);
|
|
201
|
+
}
|
|
202
|
+
.sc-search input {
|
|
203
|
+
width: 100%;
|
|
204
|
+
padding: 8px 12px;
|
|
205
|
+
background: rgba(255,255,255,.06);
|
|
206
|
+
border: 1px solid rgba(255,255,255,.1);
|
|
207
|
+
border-radius: 8px;
|
|
208
|
+
color: #e8e8e8;
|
|
209
|
+
font-size: 13px;
|
|
210
|
+
outline: none;
|
|
211
|
+
}
|
|
212
|
+
.sc-search input::placeholder { color: #6b7280; }
|
|
213
|
+
.sc-search input:focus { border-color: rgba(65,118,230,.5); }
|
|
214
|
+
|
|
215
|
+
/* 状态提示 */
|
|
216
|
+
.sc-status {
|
|
217
|
+
padding: 8px 14px;
|
|
218
|
+
font-size: 12px;
|
|
219
|
+
color: #9aa3b0;
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
gap: 6px;
|
|
223
|
+
border-bottom: 1px solid rgba(255,255,255,.06);
|
|
224
|
+
}
|
|
225
|
+
.sc-status .dot {
|
|
226
|
+
width: 6px; height: 6px;
|
|
227
|
+
border-radius: 50%;
|
|
228
|
+
background: #22c55e;
|
|
229
|
+
animation: pulse 2s infinite;
|
|
230
|
+
}
|
|
231
|
+
@keyframes pulse {
|
|
232
|
+
0%, 100% { opacity: 1; }
|
|
233
|
+
50% { opacity: .4; }
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* 服务列表 */
|
|
237
|
+
.sc-list {
|
|
238
|
+
flex: 1;
|
|
239
|
+
overflow-y: auto;
|
|
240
|
+
padding: 8px 0;
|
|
241
|
+
}
|
|
242
|
+
.sc-list::-webkit-scrollbar { width: 6px; }
|
|
243
|
+
.sc-list::-webkit-scrollbar-track { background: transparent; }
|
|
244
|
+
.sc-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
|
|
245
|
+
|
|
246
|
+
/* 服务行 */
|
|
247
|
+
.sc-svc {
|
|
248
|
+
padding: 10px 14px;
|
|
249
|
+
border-bottom: 1px solid rgba(255,255,255,.05);
|
|
250
|
+
transition: background .1s;
|
|
251
|
+
}
|
|
252
|
+
.sc-svc:hover { background: rgba(255,255,255,.04); }
|
|
253
|
+
.sc-svc:last-child { border-bottom: none; }
|
|
254
|
+
|
|
255
|
+
.sc-svc-main {
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
gap: 8px;
|
|
259
|
+
flex-wrap: wrap;
|
|
260
|
+
}
|
|
261
|
+
.sc-svc-dot { color: #22c55e; font-size: 10px; }
|
|
262
|
+
.sc-svc-dot.warn { color: #fbbf24; }
|
|
263
|
+
.sc-svc-dot.err { color: #f87171; }
|
|
264
|
+
.sc-svc-name { font-weight: 600; font-size: 13px; color: #e8e8e8; }
|
|
265
|
+
.sc-svc-meta { font-size: 12px; color: #6b7280; }
|
|
266
|
+
.sc-svc-badge {
|
|
267
|
+
font-size: 10px;
|
|
268
|
+
padding: 1px 6px;
|
|
269
|
+
border-radius: 4px;
|
|
270
|
+
border: 1px solid currentColor;
|
|
271
|
+
white-space: nowrap;
|
|
272
|
+
}
|
|
273
|
+
.sc-svc-badge.chat { color: #22c55e; }
|
|
274
|
+
.sc-svc-badge.workspace { color: #fbbf24; }
|
|
275
|
+
.sc-svc-badge.other { color: #94a3b8; }
|
|
276
|
+
.sc-svc-badge.unknown { color: #f87171; }
|
|
277
|
+
|
|
278
|
+
.sc-svc-actions {
|
|
279
|
+
margin-left: auto;
|
|
280
|
+
display: flex;
|
|
281
|
+
gap: 6px;
|
|
282
|
+
flex: none;
|
|
283
|
+
}
|
|
284
|
+
.sc-svc-btn {
|
|
285
|
+
padding: 4px 10px;
|
|
286
|
+
font-size: 11px;
|
|
287
|
+
border: 1px solid rgba(255,255,255,.15);
|
|
288
|
+
border-radius: 6px;
|
|
289
|
+
background: transparent;
|
|
290
|
+
color: #9aa3b0;
|
|
291
|
+
cursor: pointer;
|
|
292
|
+
transition: all .15s;
|
|
293
|
+
}
|
|
294
|
+
.sc-svc-btn:hover { background: rgba(255,255,255,.08); color: #e8e8e8; }
|
|
295
|
+
.sc-svc-btn.stop:hover { border-color: rgba(248,113,113,.5); color: #f87171; }
|
|
296
|
+
.sc-svc-btn.restart:hover { border-color: rgba(34,197,94,.5); color: #22c55e; }
|
|
297
|
+
|
|
298
|
+
.sc-svc-sub {
|
|
299
|
+
margin-top: 4px;
|
|
300
|
+
font-size: 11px;
|
|
301
|
+
color: #6b7280;
|
|
302
|
+
white-space: nowrap;
|
|
303
|
+
overflow: hidden;
|
|
304
|
+
text-overflow: ellipsis;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/* 空状态 */
|
|
308
|
+
.sc-empty {
|
|
309
|
+
padding: 40px 14px;
|
|
310
|
+
text-align: center;
|
|
311
|
+
color: #6b7280;
|
|
312
|
+
font-size: 13px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* 设置面板 */
|
|
316
|
+
.sc-settings {
|
|
317
|
+
padding: 14px;
|
|
318
|
+
}
|
|
319
|
+
.sc-settings-section {
|
|
320
|
+
font-size: 12px;
|
|
321
|
+
font-weight: 600;
|
|
322
|
+
color: #9aa3b0;
|
|
323
|
+
text-transform: uppercase;
|
|
324
|
+
letter-spacing: .5px;
|
|
325
|
+
margin-bottom: 12px;
|
|
326
|
+
}
|
|
327
|
+
.sc-settings-row {
|
|
328
|
+
display: flex;
|
|
329
|
+
align-items: center;
|
|
330
|
+
justify-content: space-between;
|
|
331
|
+
padding: 10px 0;
|
|
332
|
+
border-bottom: 1px solid rgba(255,255,255,.06);
|
|
333
|
+
}
|
|
334
|
+
.sc-settings-label { font-size: 13px; color: #e8e8e8; }
|
|
335
|
+
.sc-settings-desc { font-size: 11px; color: #6b7280; margin-top: 2px; }
|
|
336
|
+
.sc-settings-input {
|
|
337
|
+
width: 100px;
|
|
338
|
+
padding: 6px 10px;
|
|
339
|
+
background: rgba(255,255,255,.06);
|
|
340
|
+
border: 1px solid rgba(255,255,255,.1);
|
|
341
|
+
border-radius: 6px;
|
|
342
|
+
color: #e8e8e8;
|
|
343
|
+
font-size: 12px;
|
|
344
|
+
text-align: right;
|
|
345
|
+
}
|
|
346
|
+
.sc-settings-switch {
|
|
347
|
+
width: 36px; height: 20px;
|
|
348
|
+
border-radius: 10px;
|
|
349
|
+
background: rgba(255,255,255,.15);
|
|
350
|
+
border: none;
|
|
351
|
+
cursor: pointer;
|
|
352
|
+
position: relative;
|
|
353
|
+
transition: background .2s;
|
|
354
|
+
}
|
|
355
|
+
.sc-settings-switch.on { background: #6ea8fe; }
|
|
356
|
+
.sc-settings-switch::after {
|
|
357
|
+
content: '';
|
|
358
|
+
position: absolute;
|
|
359
|
+
top: 2px; left: 2px;
|
|
360
|
+
width: 16px; height: 16px;
|
|
361
|
+
border-radius: 50%;
|
|
362
|
+
background: #fff;
|
|
363
|
+
transition: transform .2s;
|
|
364
|
+
}
|
|
365
|
+
.sc-settings-switch.on::after { transform: translateX(16px); }
|
|
366
|
+
|
|
367
|
+
/* ---- 模拟对话内容 ---- */
|
|
368
|
+
.demo-chat {
|
|
369
|
+
position: absolute;
|
|
370
|
+
top: 44px; left: 0; right: 0; bottom: 0;
|
|
371
|
+
padding: 20px;
|
|
372
|
+
overflow-y: auto;
|
|
373
|
+
opacity: .3;
|
|
374
|
+
}
|
|
375
|
+
.demo-msg {
|
|
376
|
+
max-width: 480px;
|
|
377
|
+
margin-bottom: 16px;
|
|
378
|
+
}
|
|
379
|
+
.demo-msg.user { margin-left: auto; }
|
|
380
|
+
.demo-msg-bubble {
|
|
381
|
+
padding: 10px 14px;
|
|
382
|
+
border-radius: 12px;
|
|
383
|
+
font-size: 13px;
|
|
384
|
+
line-height: 1.5;
|
|
385
|
+
}
|
|
386
|
+
.demo-msg.assistant .demo-msg-bubble {
|
|
387
|
+
background: rgba(255,255,255,.08);
|
|
388
|
+
color: #e8e8e8;
|
|
389
|
+
}
|
|
390
|
+
.demo-msg.user .demo-msg-bubble {
|
|
391
|
+
background: rgba(65,118,230,.2);
|
|
392
|
+
color: #e8e8e8;
|
|
393
|
+
}
|
|
394
|
+
.demo-msg-label {
|
|
395
|
+
font-size: 11px;
|
|
396
|
+
color: #6b7280;
|
|
397
|
+
margin-bottom: 4px;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* ---- 语言切换逻辑 ---- */
|
|
401
|
+
[data-lang="en"] { display: none; }
|
|
402
|
+
body.lang-en [data-lang="en"] { display: inline; }
|
|
403
|
+
body.lang-en [data-lang="zh"] { display: none; }
|
|
404
|
+
body.lang-en .demo-note [data-lang="en"] { display: inline; }
|
|
405
|
+
body.lang-en .demo-note [data-lang="zh"] { display: none; }
|
|
406
|
+
</style>
|
|
407
|
+
</head>
|
|
408
|
+
<body>
|
|
409
|
+
<!-- 说明条 -->
|
|
410
|
+
<div class="demo-note">
|
|
411
|
+
<span><b>DSH Service Console</b> — <span data-lang="zh">交互式演示</span><span data-lang="en">Interactive Demo</span></span>
|
|
412
|
+
<span data-lang="zh">点击右上角 <b>🖥 SC</b> 按钮打开控制台面板</span>
|
|
413
|
+
<span data-lang="en">Click the <b>🖥 SC</b> button in the header to open the console</span>
|
|
414
|
+
<a href="https://github.com/Jiyr0119/dsh-service-console" target="_blank">GitHub</a>
|
|
415
|
+
<button class="demo-lang" onclick="toggleLang()">EN / 中文</button>
|
|
416
|
+
<span class="pill">v0.3.1</span>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
<!-- 舞台 -->
|
|
420
|
+
<div class="demo-stage">
|
|
421
|
+
<!-- 模拟 DSH 会话头部 -->
|
|
422
|
+
<div class="demo-header">
|
|
423
|
+
<div class="demo-header-left">
|
|
424
|
+
<div class="dot"></div>
|
|
425
|
+
<div class="demo-crumbs">
|
|
426
|
+
<button class="crumb">workspace</button>
|
|
427
|
+
<span class="crumb-sep">/</span>
|
|
428
|
+
<button class="crumb">project</button>
|
|
429
|
+
<span class="crumb-sep">/</span>
|
|
430
|
+
<span class="crumb-current">main</span>
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
<div class="demo-header-utils">
|
|
434
|
+
<button class="demo-sessionlog">
|
|
435
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M8 1v6l4 2" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"/><circle cx="8" cy="8" r="6.5" stroke="currentColor" stroke-width="1.3"/></svg>
|
|
436
|
+
<span>Session Log</span>
|
|
437
|
+
</button>
|
|
438
|
+
<button class="sc-hicon" id="scEntry" onclick="togglePanel()">
|
|
439
|
+
<svg viewBox="0 0 16 16" width="13" height="13" aria-hidden="true">
|
|
440
|
+
<rect x="2" y="3" width="12" height="10" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
441
|
+
<path d="M5 7h6M5 10h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
442
|
+
</svg>
|
|
443
|
+
<span>SC</span>
|
|
444
|
+
</button>
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
447
|
+
|
|
448
|
+
<!-- 模拟对话内容 -->
|
|
449
|
+
<div class="demo-chat">
|
|
450
|
+
<div class="demo-msg assistant">
|
|
451
|
+
<div class="demo-msg-label">Assistant</div>
|
|
452
|
+
<div class="demo-msg-bubble">I'll help you set up the development server. Let me start the Vite dev server for you.</div>
|
|
453
|
+
</div>
|
|
454
|
+
<div class="demo-msg user">
|
|
455
|
+
<div class="demo-msg-label">You</div>
|
|
456
|
+
<div class="demo-msg-bubble">Great, please start it on port 5173.</div>
|
|
457
|
+
</div>
|
|
458
|
+
<div class="demo-msg assistant">
|
|
459
|
+
<div class="demo-msg-label">Assistant</div>
|
|
460
|
+
<div class="demo-msg-bubble">✅ Dev server started on http://localhost:5173<br/>You can now open the Service Console to monitor it.</div>
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
|
|
464
|
+
<!-- Service Console 面板 -->
|
|
465
|
+
<div class="sc-panel" id="scPanel">
|
|
466
|
+
<!-- 头部 -->
|
|
467
|
+
<div class="sc-head">
|
|
468
|
+
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">
|
|
469
|
+
<rect x="2" y="3" width="12" height="10" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
470
|
+
<path d="M5 7h6M5 10h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
471
|
+
</svg>
|
|
472
|
+
<span class="sc-head-title">Service Console</span>
|
|
473
|
+
<button class="sc-head-btn" title="Refresh">
|
|
474
|
+
<svg viewBox="0 0 16 16" width="12" height="12"><path d="M13.5 8a5.5 5.5 0 1 1-1.61-3.89M13.5 1.5v3h-3" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
|
|
475
|
+
</button>
|
|
476
|
+
<button class="sc-head-btn" onclick="togglePanel()" title="Close">
|
|
477
|
+
<svg viewBox="0 0 16 16" width="12" height="12"><path d="M4 4l8 8M12 4l-8 8" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
|
|
478
|
+
</button>
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
<!-- Tab 栏 -->
|
|
482
|
+
<div class="sc-tabs">
|
|
483
|
+
<button class="sc-tab active" onclick="switchTab('services')">
|
|
484
|
+
<svg viewBox="0 0 16 16" width="13" height="13" aria-hidden="true">
|
|
485
|
+
<rect x="2" y="3" width="12" height="10" rx="1.5" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
486
|
+
<path d="M5 7h6M5 10h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
487
|
+
</svg>
|
|
488
|
+
<span data-lang="zh">服务</span>
|
|
489
|
+
<span data-lang="en">Services</span>
|
|
490
|
+
</button>
|
|
491
|
+
<button class="sc-tab" onclick="switchTab('settings')">
|
|
492
|
+
<svg viewBox="0 0 16 16" width="13" height="13" aria-hidden="true">
|
|
493
|
+
<circle cx="8" cy="8" r="2.5" fill="none" stroke="currentColor" stroke-width="1.3"/>
|
|
494
|
+
<path d="M8 4.3V2.9M8 13.1v-1.4M4.3 8H2.9M13.1 8h-1.4M5.2 5.2L4.1 4.1M11.9 11.9l-1.1-1.1M5.2 10.8L4.1 11.9M11.9 4.1l-1.1 1.1" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
|
|
495
|
+
</svg>
|
|
496
|
+
<span data-lang="zh">设置</span>
|
|
497
|
+
<span data-lang="en">Settings</span>
|
|
498
|
+
</button>
|
|
499
|
+
</div>
|
|
500
|
+
|
|
501
|
+
<!-- 服务列表 Tab -->
|
|
502
|
+
<div id="tabServices">
|
|
503
|
+
<!-- 搜索栏 -->
|
|
504
|
+
<div class="sc-search">
|
|
505
|
+
<input type="text" placeholder="搜索服务、端口或路径…" id="searchInput" oninput="filterServices()" />
|
|
506
|
+
</div>
|
|
507
|
+
|
|
508
|
+
<!-- 状态 -->
|
|
509
|
+
<div class="sc-status">
|
|
510
|
+
<div class="dot"></div>
|
|
511
|
+
<span data-lang="zh">3 项服务</span>
|
|
512
|
+
<span data-lang="en">3 services</span>
|
|
513
|
+
<span style="margin-left:auto;font-size:11px;color:#6b7280;">15:32:08</span>
|
|
514
|
+
</div>
|
|
515
|
+
|
|
516
|
+
<!-- 服务列表 -->
|
|
517
|
+
<div class="sc-list" id="serviceList">
|
|
518
|
+
<!-- Vite Dev Server -->
|
|
519
|
+
<div class="sc-svc" data-name="vite" data-port="5173">
|
|
520
|
+
<div class="sc-svc-main">
|
|
521
|
+
<span class="sc-svc-dot">●</span>
|
|
522
|
+
<span class="sc-svc-name">node</span>
|
|
523
|
+
<span class="sc-svc-meta">:5173 · pid 12345</span>
|
|
524
|
+
<span class="sc-svc-badge chat" data-lang="zh">本次对话</span>
|
|
525
|
+
<span class="sc-svc-badge chat" data-lang="en">This chat</span>
|
|
526
|
+
<span class="sc-svc-badge" style="color:#22c55e;">↻</span>
|
|
527
|
+
<div class="sc-svc-actions">
|
|
528
|
+
<button class="sc-svc-btn stop" data-lang="zh">停止</button>
|
|
529
|
+
<button class="sc-svc-btn stop" data-lang="en">Stop</button>
|
|
530
|
+
<button class="sc-svc-btn restart" data-lang="zh">重启</button>
|
|
531
|
+
<button class="sc-svc-btn restart" data-lang="en">Restart</button>
|
|
532
|
+
<button class="sc-svc-btn" data-lang="zh">详情</button>
|
|
533
|
+
<button class="sc-svc-btn" data-lang="en">Detail</button>
|
|
534
|
+
</div>
|
|
535
|
+
</div>
|
|
536
|
+
<div class="sc-svc-sub">node_modules/.bin/vite --port 5173</div>
|
|
537
|
+
<div class="sc-svc-sub">/Users/dev/my-project</div>
|
|
538
|
+
</div>
|
|
539
|
+
|
|
540
|
+
<!-- Next.js Dev Server -->
|
|
541
|
+
<div class="sc-svc" data-name="next" data-port="3000">
|
|
542
|
+
<div class="sc-svc-main">
|
|
543
|
+
<span class="sc-svc-dot">●</span>
|
|
544
|
+
<span class="sc-svc-name">next-server</span>
|
|
545
|
+
<span class="sc-svc-meta">:3000 · pid 12890</span>
|
|
546
|
+
<span class="sc-svc-badge workspace" data-lang="zh">工作区推断</span>
|
|
547
|
+
<span class="sc-svc-badge workspace" data-lang="en">Workspace</span>
|
|
548
|
+
<span class="sc-svc-badge" style="color:#22c55e;">↻</span>
|
|
549
|
+
<div class="sc-svc-actions">
|
|
550
|
+
<button class="sc-svc-btn stop" data-lang="zh">停止</button>
|
|
551
|
+
<button class="sc-svc-btn stop" data-lang="en">Stop</button>
|
|
552
|
+
<button class="sc-svc-btn restart" data-lang="zh">重启</button>
|
|
553
|
+
<button class="sc-svc-btn restart" data-lang="en">Restart</button>
|
|
554
|
+
<button class="sc-svc-btn" data-lang="zh">详情</button>
|
|
555
|
+
<button class="sc-svc-btn" data-lang="en">Detail</button>
|
|
556
|
+
</div>
|
|
557
|
+
</div>
|
|
558
|
+
<div class="sc-svc-sub">next dev --port 3000</div>
|
|
559
|
+
<div class="sc-svc-sub">/Users/dev/web-app</div>
|
|
560
|
+
</div>
|
|
561
|
+
|
|
562
|
+
<!-- PostgreSQL -->
|
|
563
|
+
<div class="sc-svc" data-name="postgres" data-port="5432">
|
|
564
|
+
<div class="sc-svc-main">
|
|
565
|
+
<span class="sc-svc-dot warn">●</span>
|
|
566
|
+
<span class="sc-svc-name">postgres</span>
|
|
567
|
+
<span class="sc-svc-meta">:5432 · pid 9876</span>
|
|
568
|
+
<span class="sc-svc-badge other" data-lang="zh">本机其他</span>
|
|
569
|
+
<span class="sc-svc-badge other" data-lang="en">Other local</span>
|
|
570
|
+
<div class="sc-svc-actions">
|
|
571
|
+
<button class="sc-svc-btn" data-lang="zh">详情</button>
|
|
572
|
+
<button class="sc-svc-btn" data-lang="en">Detail</button>
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
<div class="sc-svc-sub">postgres -D /usr/local/var/postgres</div>
|
|
576
|
+
</div>
|
|
577
|
+
</div>
|
|
578
|
+
</div>
|
|
579
|
+
|
|
580
|
+
<!-- 设置 Tab -->
|
|
581
|
+
<div id="tabSettings" style="display:none;">
|
|
582
|
+
<div class="sc-settings">
|
|
583
|
+
<div class="sc-settings-section" data-lang="zh">通用</div>
|
|
584
|
+
<div class="sc-settings-section" data-lang="en">General</div>
|
|
585
|
+
|
|
586
|
+
<div class="sc-settings-row">
|
|
587
|
+
<div>
|
|
588
|
+
<div class="sc-settings-label" data-lang="zh">优雅超时 (ms)</div>
|
|
589
|
+
<div class="sc-settings-label" data-lang="en">Graceful timeout (ms)</div>
|
|
590
|
+
</div>
|
|
591
|
+
<input class="sc-settings-input" type="number" value="3000" />
|
|
592
|
+
</div>
|
|
593
|
+
|
|
594
|
+
<div class="sc-settings-row">
|
|
595
|
+
<div>
|
|
596
|
+
<div class="sc-settings-label" data-lang="zh">允许强制终止</div>
|
|
597
|
+
<div class="sc-settings-label" data-lang="en">Allow force kill</div>
|
|
598
|
+
<div class="sc-settings-desc" data-lang="zh">优雅超时后发送 SIGKILL</div>
|
|
599
|
+
<div class="sc-settings-desc" data-lang="en">Send SIGKILL after graceful timeout</div>
|
|
600
|
+
</div>
|
|
601
|
+
<button class="sc-settings-switch" onclick="this.classList.toggle('on')"></button>
|
|
602
|
+
</div>
|
|
603
|
+
|
|
604
|
+
<div class="sc-settings-row" style="border:none;">
|
|
605
|
+
<div class="sc-settings-desc" data-lang="zh">配置在本次会话内生效,重启插件后恢复默认。</div>
|
|
606
|
+
<div class="sc-settings-desc" data-lang="en">Settings apply for this run; they reset when the plugin restarts.</div>
|
|
607
|
+
</div>
|
|
608
|
+
</div>
|
|
609
|
+
</div>
|
|
610
|
+
</div>
|
|
611
|
+
</div>
|
|
612
|
+
|
|
613
|
+
<script>
|
|
614
|
+
// 语言切换
|
|
615
|
+
let currentLang = 'zh';
|
|
616
|
+
function toggleLang() {
|
|
617
|
+
currentLang = currentLang === 'zh' ? 'en' : 'zh';
|
|
618
|
+
document.body.classList.toggle('lang-en', currentLang === 'en');
|
|
619
|
+
// 更新搜索框 placeholder
|
|
620
|
+
const input = document.getElementById('searchInput');
|
|
621
|
+
input.placeholder = currentLang === 'zh' ? '搜索服务、端口或路径…' : 'Search services, ports, or paths…';
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// 面板开关
|
|
625
|
+
let panelOpen = false;
|
|
626
|
+
function togglePanel() {
|
|
627
|
+
panelOpen = !panelOpen;
|
|
628
|
+
document.getElementById('scPanel').classList.toggle('open', panelOpen);
|
|
629
|
+
document.getElementById('scEntry').classList.toggle('active', panelOpen);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// Tab 切换
|
|
633
|
+
function switchTab(tab) {
|
|
634
|
+
document.querySelectorAll('.sc-tab').forEach(t => t.classList.remove('active'));
|
|
635
|
+
event.currentTarget.classList.add('active');
|
|
636
|
+
document.getElementById('tabServices').style.display = tab === 'services' ? '' : 'none';
|
|
637
|
+
document.getElementById('tabSettings').style.display = tab === 'settings' ? '' : 'none';
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// 搜索过滤
|
|
641
|
+
function filterServices() {
|
|
642
|
+
const q = document.getElementById('searchInput').value.toLowerCase();
|
|
643
|
+
document.querySelectorAll('.sc-svc').forEach(svc => {
|
|
644
|
+
const name = svc.dataset.name || '';
|
|
645
|
+
const port = svc.dataset.port || '';
|
|
646
|
+
const show = name.includes(q) || port.includes(q);
|
|
647
|
+
svc.style.display = show ? '' : 'none';
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
// 初始化:默认打开面板
|
|
652
|
+
window.addEventListener('DOMContentLoaded', () => {
|
|
653
|
+
setTimeout(() => togglePanel(), 500);
|
|
654
|
+
});
|
|
655
|
+
</script>
|
|
656
|
+
</body>
|
|
657
|
+
</html>
|
package/dsh.plugin.json
CHANGED
package/dynamic/host.js
CHANGED
|
@@ -265,7 +265,6 @@ return {
|
|
|
265
265
|
const svc = s.services.find((x) => x.id === serviceId)
|
|
266
266
|
if (!svc) return err('TARGET_GONE', '该服务已结束,列表已刷新')
|
|
267
267
|
if (svc.protected) return err('PROTECTED_PROCESS', '该进程受保护,不能通过 Service Console 操作')
|
|
268
|
-
if (svc.ownership === 'unknown') return err('UNKNOWN_OWNERSHIP', '无法确认服务来源,默认不允许控制')
|
|
269
268
|
const target = svc.processGroupId ? '-' + svc.processGroupId : String(svc.pid)
|
|
270
269
|
await runCommand('kill -TERM ' + target, 3000)
|
|
271
270
|
const deadline = Date.now() + (config.gracefulTimeout || 3000)
|
package/lib/client.js
CHANGED
|
@@ -29,7 +29,7 @@ window.__ModuleLoader__.load({
|
|
|
29
29
|
react = __toESM(react, 1);
|
|
30
30
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
31
31
|
//#region \0dsh-css:/home/runner/work/dsh-service-console/dsh-service-console/src/client/service-console.module.css.mjs
|
|
32
|
-
const css = ".PuSt5a_layer{z-index:100;pointer-events:none;position:fixed;inset:0}.PuSt5a_popup{background:var(--dsw-alias-bg-layer-2,#262626);border:1px solid var(--dsw-alias-border-inverted,#80808047);width:420px;box-shadow:var(--dsw-shadow-lv3,0 12px 32px #00000059);color:var(--dsw-alias-label-primary,#e8e8e8);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2,#80808066);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2,#80808099);pointer-events:auto;opacity:0;transform-origin:100% 0;border-radius:16px;flex-direction:column;font:13px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;transition:opacity .18s,transform .18s;display:flex;position:fixed;right:16px;overflow:hidden;transform:translateY(-8px)scale(.98)}.PuSt5a_popupOn{opacity:1;transform:translateY(0)scale(1)}@media (prefers-reduced-motion:reduce){.PuSt5a_popup{transition:none}}.PuSt5a_head{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;align-items:center;gap:8px;padding:14px 16px 12px 18px;display:flex}.PuSt5a_headIco{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;display:inline-flex}.PuSt5a_headTitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:15px;font-weight:600;overflow:hidden}.PuSt5a_icoBtn{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;display:inline-flex}.PuSt5a_icoBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#80808024);color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabs{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;gap:2px;padding:0 14px;display:flex}.PuSt5a_tab{height:36px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:10px 10px 0 0;flex:1;justify-content:center;align-items:center;gap:6px;font-size:12.5px;font-weight:500;display:inline-flex;position:relative}.PuSt5a_tab:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#80808014)}.PuSt5a_tabOn{color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabInd{background:var(--dsw-alias-state-business-primary,#4176e6);opacity:0;border-radius:999px;height:2px;transition:opacity .16s,transform .16s;position:absolute;bottom:-1px;left:24%;right:24%;transform:scaleX(.4)}.PuSt5a_tabOn .PuSt5a_tabInd{opacity:1;transform:scaleX(1)}.PuSt5a_tab:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (prefers-reduced-motion:reduce){.PuSt5a_tabInd{transition:none}}.PuSt5a_tabBody{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden auto}.PuSt5a_tabBody::-webkit-scrollbar{width:6px}.PuSt5a_tabBody::-webkit-scrollbar-thumb{background:var(--dsh-scrollbar-thumb);border-radius:3px}.PuSt5a_tabBody::-webkit-scrollbar-thumb:hover{background:var(--dsh-scrollbar-thumb-hover)}.PuSt5a_tabBody::-webkit-scrollbar-track{background:0 0}.PuSt5a_filterRow{align-items:center;gap:6px;padding:12px 16px 6px;display:flex}.PuSt5a_filter{min-width:0;height:30px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:1;padding:0 8px;font-size:12.5px}.PuSt5a_filter:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_filter::placeholder{color:var(--dsw-alias-label-caption,#8a8a8a)}.PuSt5a_filterClear{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.PuSt5a_filterClear:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_hintLine{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:6px;padding:4px 18px 8px;font-size:11px;display:flex}.PuSt5a_liveDot{background:var(--dsw-alias-state-success-primary,#55d187);width:7px;height:7px;box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-success-primary,#55d187) 18%, transparent);border-radius:50%;flex:none}.PuSt5a_row{border:1px solid var(--dsw-alias-border-l3,#80808026);background:var(--dsw-alias-bg-layer-1,#ffffff08);border-radius:12px;margin:0 12px 8px;padding:12px 16px;transition:background .12s,border-color .12s}.PuSt5a_row:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014);border-color:var(--dsw-alias-border-l2,#80808040)}.PuSt5a_rowMain{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}.PuSt5a_rowDot{flex-shrink:0;font-size:8px;line-height:1}.PuSt5a_rowName{letter-spacing:-.01em;word-break:break-word;font-size:13px;font-weight:600}.PuSt5a_rowMeta{color:var(--dsw-alias-label-secondary,#9a9a9a);font-variant-numeric:tabular-nums;word-break:break-all;font-size:11.5px}.PuSt5a_rowSub{color:var(--dsw-alias-label-secondary,#9a9a9a);word-break:break-all;margin-top:4px;font-size:11.5px;line-height:1.4}.PuSt5a_spacer{flex:1}.PuSt5a_badge{white-space:nowrap;border:1px solid;border-radius:999px;padding:1px 6px;font-size:10px;font-weight:500}.PuSt5a_rowBtn{border:1px solid var(--dsw-alias-border-l2,#8080804d);height:24px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0 7px;font-size:11px;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_rowAct{color:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:5px;flex:none;justify-content:center;align-items:center;width:22px;height:22px;text-decoration:none;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowAct:hover{color:var(--dsw-alias-state-business-primary,#4176e6);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_confirmRow{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 8%, transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 15%, transparent);border-radius:10px;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;padding:10px 12px;display:flex}.PuSt5a_confirmTxt{min-width:0;color:var(--dsw-alias-label-secondary,#b0b3ba);flex:1;font-size:12px}.PuSt5a_confirmOk{background:var(--dsw-alias-state-error-primary,#e5484d);color:#fff;height:26px;font:inherit;cursor:pointer;border:none;border-radius:7px;flex:none;padding:0 10px;font-size:11px;font-weight:500;transition:opacity .1s}.PuSt5a_confirmOk:hover{opacity:.85}.PuSt5a_confirmCancel{border:1px solid var(--dsw-alias-border-l2,#80808059);height:26px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:7px;flex:none;padding:0 10px;font-size:11px;transition:color .1s,background .1s}.PuSt5a_confirmCancel:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_detailBox{border:1px solid var(--dsw-alias-border-l2,#8080804d);background:var(--dsw-alias-bg-layer-1,#00000026);box-shadow:inset 3px 0 0 var(--dsw-alias-state-business-primary,#4176e6);border-radius:10px;margin-top:10px;padding:14px}.PuSt5a_detailHead{justify-content:space-between;align-items:center;margin-bottom:12px;font-size:12px;font-weight:600;display:flex}.PuSt5a_detailAccent{color:var(--dsw-alias-state-business-primary,#4176e6);letter-spacing:.12em;text-transform:uppercase;font-size:9px;font-weight:650}.PuSt5a_detailGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.PuSt5a_detailGrid>div{flex-direction:column;gap:3px;min-width:0;display:flex}.PuSt5a_detailLabel{color:var(--dsw-alias-label-caption,#7a7d85);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600}.PuSt5a_detailGrid code{overflow-wrap:anywhere;word-break:break-all;color:var(--dsw-alias-label-primary,#d8d9dc);font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.PuSt5a_evidenceBlock{border-top:1px solid var(--dsw-alias-border-l3,#80808026);margin-top:14px;padding-top:12px;overflow:hidden}.PuSt5a_evidenceItem{color:var(--dsw-alias-label-secondary,#8a8d95);gap:6px;margin-top:5px;font-size:11px;line-height:1.4;display:flex}.PuSt5a_evidenceArrow{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;font-size:10px}.PuSt5a_note{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:8px;padding:6px 16px;font-size:12px;display:flex}.PuSt5a_noteErr{color:var(--dsw-alias-state-error-primary,#e5484d);padding:6px 16px;font-size:12px}.PuSt5a_noteWarn{color:var(--dsw-alias-state-warn-primary,#e7b85d);padding:6px 16px;font-size:12px}.PuSt5a_okText{color:var(--dsw-alias-state-success-primary,#55d187);margin-top:4px;font-size:12px}.PuSt5a_errText{color:var(--dsw-alias-state-error-primary,#e5484d);margin-top:4px;font-size:12px}.PuSt5a_empty{color:var(--dsw-alias-label-secondary,#9a9a9a);padding:24px 18px;font-size:12.5px}.PuSt5a_spin{border:2px solid var(--dsw-alias-border-l2,#80808066);border-top-color:var(--dsw-alias-state-business-primary,#4176e6);border-radius:50%;flex:none;width:13px;height:13px;animation:.7s linear infinite PuSt5a_sc-spin}@keyframes PuSt5a_sc-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.PuSt5a_spin{animation-duration:1.6s}}.PuSt5a_headerBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:32px;color:var(--dsw-alias-label-primary,#e8e8e8);cursor:pointer;background:0 0;border-radius:18px;flex:none;justify-content:center;align-items:center;gap:4px;padding:6px 12px;font-size:13px;font-weight:400;line-height:20px;display:inline-flex}.PuSt5a_headerBtn span,.PuSt5a_headerBtn svg{flex:none}.PuSt5a_headerBtn span{white-space:nowrap}.PuSt5a_headerBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_headerBtnOn{color:var(--dsw-alias-state-business-primary,#4176e6);border-color:#4176e680}.PuSt5a_setPage{padding:8px 16px 28px}.PuSt5a_setSection{letter-spacing:.05em;text-transform:uppercase;color:var(--dsw-alias-label-caption,#8a8a8a);padding:10px 4px 6px;font-size:11px;font-weight:600}.PuSt5a_setRow{border-radius:12px;align-items:center;gap:12px;padding:9px 10px;display:flex}.PuSt5a_setRow:hover{background:var(--dsw-alias-interactive-bg-hover,#8080800f)}.PuSt5a_setInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.PuSt5a_setLabel{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:12.5px}.PuSt5a_setCap{color:var(--dsw-alias-label-caption,#8a8a8a);font-size:11px}.PuSt5a_setInput{width:80px;min-width:80px;height:28px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:none;padding:0 8px;font-size:12px}.PuSt5a_setInput:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_switch{border:1px solid var(--dsw-alias-border-l2,#80808066);background:var(--dsw-alias-interactive-bg-hover,#8080802e);cursor:pointer;border-radius:999px;flex:none;width:34px;height:20px;padding:0;transition:background .15s,border-color .15s;position:relative}.PuSt5a_switch:after{content:\"\";background:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}.PuSt5a_switch[aria-checked=true]{background:var(--dsw-alias-state-business-primary,#4176e6);border-color:#0000}.PuSt5a_switch[aria-checked=true]:after{background:#fff;transform:translate(14px)}@media (prefers-reduced-motion:reduce){.PuSt5a_switch,.PuSt5a_switch:after{transition:none}}.PuSt5a_prevBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:28px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0 10px;font-size:12px;display:inline-flex}.PuSt5a_prevBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_setFooter{justify-content:flex-end;padding:8px 4px 2px;display:flex}.PuSt5a_setNote{color:var(--dsw-alias-label-dimmed,#777);padding:2px 10px 8px;font-size:11px}.PuSt5a_rowBtn:focus-visible,.PuSt5a_headerBtn:focus-visible,.PuSt5a_icoBtn:focus-visible,.PuSt5a_prevBtn:focus-visible,.PuSt5a_filter:focus-visible,.PuSt5a_tab:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (width<=480px){.PuSt5a_popup{width:calc(100vw - 16px);right:8px}.PuSt5a_detailGrid{grid-template-columns:1fr}}";
|
|
32
|
+
const css = ".PuSt5a_layer{z-index:100;pointer-events:none;position:fixed;inset:0}.PuSt5a_popup{background:var(--dsw-alias-bg-layer-2,#262626);border:1px solid var(--dsw-alias-border-inverted,#80808047);width:420px;box-shadow:var(--dsw-shadow-lv3,0 12px 32px #00000059);color:var(--dsw-alias-label-primary,#e8e8e8);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2,#80808066);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2,#80808099);pointer-events:auto;opacity:0;transform-origin:100% 0;border-radius:16px;flex-direction:column;font:13px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;transition:opacity .18s,transform .18s;display:flex;position:fixed;right:16px;overflow:hidden;transform:translateY(-8px)scale(.98)}.PuSt5a_popupOn{opacity:1;transform:translateY(0)scale(1)}@media (prefers-reduced-motion:reduce){.PuSt5a_popup{transition:none}}.PuSt5a_head{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;align-items:center;gap:8px;padding:14px 16px 12px 18px;display:flex}.PuSt5a_headIco{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;display:inline-flex}.PuSt5a_headTitle{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:15px;font-weight:600;overflow:hidden}.PuSt5a_icoBtn{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;display:inline-flex}.PuSt5a_icoBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#80808024);color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabs{border-bottom:1px solid var(--dsw-alias-border-l3,#80808033);flex:none;gap:2px;padding:0 14px;display:flex}.PuSt5a_tab{height:36px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border:0;border-radius:10px 10px 0 0;flex:1;justify-content:center;align-items:center;gap:6px;font-size:12.5px;font-weight:500;display:inline-flex;position:relative}.PuSt5a_tab:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#80808014)}.PuSt5a_tabOn{color:var(--dsw-alias-label-primary,#e8e8e8)}.PuSt5a_tabInd{background:var(--dsw-alias-state-business-primary,#4176e6);opacity:0;border-radius:999px;height:2px;transition:opacity .16s,transform .16s;position:absolute;bottom:-1px;left:24%;right:24%;transform:scaleX(.4)}.PuSt5a_tabOn .PuSt5a_tabInd{opacity:1;transform:scaleX(1)}.PuSt5a_tab:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (prefers-reduced-motion:reduce){.PuSt5a_tabInd{transition:none}}.PuSt5a_tabBody{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden auto}.PuSt5a_tabBody::-webkit-scrollbar{width:6px}.PuSt5a_tabBody::-webkit-scrollbar-thumb{background:var(--dsh-scrollbar-thumb);border-radius:3px}.PuSt5a_tabBody::-webkit-scrollbar-thumb:hover{background:var(--dsh-scrollbar-thumb-hover)}.PuSt5a_tabBody::-webkit-scrollbar-track{background:0 0}.PuSt5a_filterRow{align-items:center;gap:6px;padding:12px 16px 6px;display:flex}.PuSt5a_filter{min-width:0;height:30px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:1;padding:0 8px;font-size:12.5px}.PuSt5a_filter:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_filter::placeholder{color:var(--dsw-alias-label-caption,#8a8a8a)}.PuSt5a_filterClear{color:var(--dsw-alias-label-secondary,#9a9a9a);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;justify-content:center;align-items:center;width:26px;height:26px;display:inline-flex}.PuSt5a_filterClear:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_hintLine{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:6px;padding:4px 18px 8px;font-size:11px;display:flex}.PuSt5a_liveDot{background:var(--dsw-alias-state-success-primary,#55d187);width:7px;height:7px;box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-success-primary,#55d187) 18%, transparent);border-radius:50%;flex:none}.PuSt5a_row{border:1px solid var(--dsw-alias-border-l3,#80808026);background:var(--dsw-alias-bg-layer-1,#ffffff08);border-radius:12px;margin:0 12px 8px;padding:12px 16px;transition:background .12s,border-color .12s}.PuSt5a_row:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014);border-color:var(--dsw-alias-border-l2,#80808040)}.PuSt5a_rowMain{flex-wrap:wrap;align-items:center;gap:8px;min-width:0;display:flex}.PuSt5a_rowDot{flex-shrink:0;font-size:8px;line-height:1}.PuSt5a_rowName{letter-spacing:-.01em;word-break:break-word;font-size:13px;font-weight:600}.PuSt5a_rowMeta{color:var(--dsw-alias-label-secondary,#9a9a9a);font-variant-numeric:tabular-nums;word-break:break-all;font-size:11.5px}.PuSt5a_rowSub{color:var(--dsw-alias-label-secondary,#9a9a9a);word-break:break-all;margin-top:4px;font-size:11.5px;line-height:1.4}.PuSt5a_spacer{flex:1}.PuSt5a_badge{white-space:nowrap;border:1px solid;border-radius:999px;padding:1px 6px;font-size:10px;font-weight:500}.PuSt5a_rowBtn{border:1px solid var(--dsw-alias-border-l2,#8080804d);height:24px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:6px;flex:none;justify-content:center;align-items:center;padding:0 7px;font-size:11px;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_rowAct{color:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:5px;flex:none;justify-content:center;align-items:center;width:22px;height:22px;text-decoration:none;transition:color .1s,background .1s;display:inline-flex}.PuSt5a_rowAct:hover{color:var(--dsw-alias-state-business-primary,#4176e6);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_confirmRow{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 8%, transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary,#e7b85d) 15%, transparent);border-radius:10px;flex-wrap:wrap;align-items:center;gap:6px;margin-top:10px;padding:10px 12px;display:flex}.PuSt5a_confirmTxt{min-width:0;color:var(--dsw-alias-label-secondary,#b0b3ba);flex:1;font-size:12px}.PuSt5a_confirmOk{background:var(--dsw-alias-state-error-primary,#e5484d);color:#fff;height:26px;font:inherit;cursor:pointer;border:none;border-radius:7px;flex:none;padding:0 10px;font-size:11px;font-weight:500;transition:opacity .1s}.PuSt5a_confirmOk:hover{opacity:.85}.PuSt5a_confirmCancel{border:1px solid var(--dsw-alias-border-l2,#80808059);height:26px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:7px;flex:none;padding:0 10px;font-size:11px;transition:color .1s,background .1s}.PuSt5a_confirmCancel:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_detailBox{border:1px solid var(--dsw-alias-border-l2,#8080804d);background:var(--dsw-alias-bg-layer-1,#00000026);box-shadow:inset 3px 0 0 var(--dsw-alias-state-business-primary,#4176e6);border-radius:10px;margin-top:10px;padding:14px}.PuSt5a_detailHead{justify-content:space-between;align-items:center;margin-bottom:12px;font-size:12px;font-weight:600;display:flex}.PuSt5a_detailAccent{color:var(--dsw-alias-state-business-primary,#4176e6);letter-spacing:.12em;text-transform:uppercase;font-size:9px;font-weight:650}.PuSt5a_detailGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;display:grid}.PuSt5a_detailGrid>div{flex-direction:column;gap:3px;min-width:0;display:flex}.PuSt5a_detailLabel{color:var(--dsw-alias-label-caption,#7a7d85);letter-spacing:.06em;text-transform:uppercase;font-size:10px;font-weight:600}.PuSt5a_detailGrid code{overflow-wrap:anywhere;word-break:break-all;color:var(--dsw-alias-label-primary,#d8d9dc);font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.PuSt5a_evidenceBlock{border-top:1px solid var(--dsw-alias-border-l3,#80808026);margin-top:14px;padding-top:12px;overflow:hidden}.PuSt5a_evidenceItem{color:var(--dsw-alias-label-secondary,#8a8d95);gap:6px;margin-top:5px;font-size:11px;line-height:1.4;display:flex}.PuSt5a_evidenceArrow{color:var(--dsw-alias-state-business-primary,#4176e6);flex:none;font-size:10px}.PuSt5a_note{color:var(--dsw-alias-label-caption,#8a8a8a);align-items:center;gap:8px;padding:6px 16px;font-size:12px;display:flex}.PuSt5a_noteErr{color:var(--dsw-alias-state-error-primary,#e5484d);padding:6px 16px;font-size:12px}.PuSt5a_noteWarn{color:var(--dsw-alias-state-warn-primary,#e7b85d);padding:6px 16px;font-size:12px}.PuSt5a_okText{color:var(--dsw-alias-state-success-primary,#55d187);margin-top:4px;font-size:12px}.PuSt5a_errText{color:var(--dsw-alias-state-error-primary,#e5484d);margin-top:4px;font-size:12px}.PuSt5a_empty{color:var(--dsw-alias-label-secondary,#9a9a9a);padding:24px 18px;font-size:12.5px}.PuSt5a_spin{border:2px solid var(--dsw-alias-border-l2,#80808066);border-top-color:var(--dsw-alias-state-business-primary,#4176e6);border-radius:50%;flex:none;width:13px;height:13px;animation:.7s linear infinite PuSt5a_sc-spin}@keyframes PuSt5a_sc-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.PuSt5a_spin{animation-duration:1.6s}}.PuSt5a_headerBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:32px;color:var(--dsw-alias-label-primary,#e8e8e8);cursor:pointer;background:0 0;border-radius:18px;flex:none;justify-content:center;align-items:center;gap:4px;padding:6px 12px;font-size:13px;font-weight:400;line-height:20px;display:inline-flex}.PuSt5a_headerBtn span,.PuSt5a_headerBtn svg{flex:none}.PuSt5a_headerBtn span{white-space:nowrap}.PuSt5a_headerBtn:hover{background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_headerBtnOn{color:var(--dsw-alias-state-business-primary,#4176e6);border-color:#4176e680}.PuSt5a_setPage{padding:8px 16px 28px}.PuSt5a_setSection{letter-spacing:.05em;text-transform:uppercase;color:var(--dsw-alias-label-caption,#8a8a8a);padding:10px 4px 6px;font-size:11px;font-weight:600}.PuSt5a_setRow{border-radius:12px;align-items:center;gap:12px;padding:9px 10px;display:flex}.PuSt5a_setRow:hover{background:var(--dsw-alias-interactive-bg-hover,#8080800f)}.PuSt5a_setInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.PuSt5a_setLabel{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:12.5px}.PuSt5a_setCap{color:var(--dsw-alias-label-caption,#8a8a8a);font-size:11px}.PuSt5a_setInput{width:80px;min-width:80px;height:28px;color:var(--dsw-alias-label-primary,#e8e8e8);border:1px solid var(--dsw-alias-border-l2,#80808059);font:inherit;background:0 0;border-radius:8px;outline:none;flex:none;padding:0 8px;font-size:12px}.PuSt5a_setInput:focus-visible{border-color:var(--dsw-alias-state-business-primary,#4176e6)}.PuSt5a_switch{border:1px solid var(--dsw-alias-border-l2,#80808066);background:var(--dsw-alias-interactive-bg-hover,#8080802e);cursor:pointer;border-radius:999px;flex:none;width:34px;height:20px;padding:0;transition:background .15s,border-color .15s;position:relative}.PuSt5a_switch:after{content:\"\";background:var(--dsw-alias-label-secondary,#9a9a9a);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}.PuSt5a_switch[aria-checked=true]{background:var(--dsw-alias-state-business-primary,#4176e6);border-color:#0000}.PuSt5a_switch[aria-checked=true]:after{background:#fff;transform:translate(14px)}@media (prefers-reduced-motion:reduce){.PuSt5a_switch,.PuSt5a_switch:after{transition:none}}.PuSt5a_prevBtn{border:1px solid var(--dsw-alias-border-l2,#80808059);height:28px;color:var(--dsw-alias-label-secondary,#9a9a9a);font:inherit;cursor:pointer;background:0 0;border-radius:8px;flex:none;justify-content:center;align-items:center;padding:0 10px;font-size:12px;display:inline-flex}.PuSt5a_prevBtn:hover{color:var(--dsw-alias-label-primary,#e8e8e8);background:var(--dsw-alias-interactive-bg-hover,#8080801f)}.PuSt5a_setFooter{justify-content:flex-end;padding:8px 4px 2px;display:flex}.PuSt5a_setNote{color:var(--dsw-alias-label-dimmed,#777);padding:2px 10px 8px;font-size:11px}.PuSt5a_starSection{border:1px solid var(--dsw-alias-border-l3,#80808026);background:var(--dsw-alias-bg-layer-1,#ffffff08);border-radius:12px;margin-top:12px;padding:12px 10px}.PuSt5a_starRow{align-items:center;gap:12px;display:flex}.PuSt5a_starInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.PuSt5a_starLabel{color:var(--dsw-alias-label-primary,#e8e8e8);font-size:12.5px}.PuSt5a_starLink{color:var(--dsw-alias-state-business-primary,#4176e6);text-underline-offset:2px;white-space:nowrap;flex:none;font-size:12px;line-height:1.6;text-decoration:underline}.PuSt5a_starLink:hover{opacity:.85}.PuSt5a_rowBtn:focus-visible,.PuSt5a_headerBtn:focus-visible,.PuSt5a_icoBtn:focus-visible,.PuSt5a_prevBtn:focus-visible,.PuSt5a_filter:focus-visible,.PuSt5a_tab:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#4176e6);outline-offset:-2px}@media (width<=480px){.PuSt5a_popup{width:calc(100vw - 16px);right:8px}.PuSt5a_detailGrid{grid-template-columns:1fr}}";
|
|
33
33
|
const tagId = "@jiyr0119/dsh-service-console/service-console.module.css";
|
|
34
34
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
35
35
|
const tag = document.createElement("style");
|
|
@@ -39,66 +39,71 @@ window.__ModuleLoader__.load({
|
|
|
39
39
|
document.head.appendChild(tag);
|
|
40
40
|
}
|
|
41
41
|
var service_console_module_css_default = {
|
|
42
|
+
"setFooter": "PuSt5a_setFooter",
|
|
43
|
+
"liveDot": "PuSt5a_liveDot",
|
|
44
|
+
"setInput": "PuSt5a_setInput",
|
|
45
|
+
"filter": "PuSt5a_filter",
|
|
46
|
+
"noteWarn": "PuSt5a_noteWarn",
|
|
47
|
+
"setCap": "PuSt5a_setCap",
|
|
48
|
+
"rowAct": "PuSt5a_rowAct",
|
|
49
|
+
"rowMain": "PuSt5a_rowMain",
|
|
50
|
+
"spacer": "PuSt5a_spacer",
|
|
51
|
+
"rowDot": "PuSt5a_rowDot",
|
|
52
|
+
"tabOn": "PuSt5a_tabOn",
|
|
42
53
|
"popupOn": "PuSt5a_popupOn",
|
|
43
|
-
"setInfo": "PuSt5a_setInfo",
|
|
44
|
-
"headTitle": "PuSt5a_headTitle",
|
|
45
54
|
"head": "PuSt5a_head",
|
|
46
|
-
"
|
|
55
|
+
"filterRow": "PuSt5a_filterRow",
|
|
56
|
+
"tabInd": "PuSt5a_tabInd",
|
|
57
|
+
"sc-spin": "PuSt5a_sc-spin",
|
|
58
|
+
"row": "PuSt5a_row",
|
|
59
|
+
"rowName": "PuSt5a_rowName",
|
|
60
|
+
"evidenceArrow": "PuSt5a_evidenceArrow",
|
|
61
|
+
"starSection": "PuSt5a_starSection",
|
|
62
|
+
"confirmTxt": "PuSt5a_confirmTxt",
|
|
47
63
|
"evidenceItem": "PuSt5a_evidenceItem",
|
|
48
|
-
"
|
|
64
|
+
"tabBody": "PuSt5a_tabBody",
|
|
65
|
+
"spin": "PuSt5a_spin",
|
|
66
|
+
"empty": "PuSt5a_empty",
|
|
67
|
+
"setInfo": "PuSt5a_setInfo",
|
|
68
|
+
"starRow": "PuSt5a_starRow",
|
|
69
|
+
"starLabel": "PuSt5a_starLabel",
|
|
70
|
+
"setSection": "PuSt5a_setSection",
|
|
49
71
|
"setRow": "PuSt5a_setRow",
|
|
50
|
-
"switch": "PuSt5a_switch",
|
|
51
|
-
"evidenceBlock": "PuSt5a_evidenceBlock",
|
|
52
|
-
"rowMain": "PuSt5a_rowMain",
|
|
53
72
|
"confirmCancel": "PuSt5a_confirmCancel",
|
|
54
73
|
"filterClear": "PuSt5a_filterClear",
|
|
55
|
-
"
|
|
56
|
-
"rowMeta": "PuSt5a_rowMeta",
|
|
74
|
+
"okText": "PuSt5a_okText",
|
|
57
75
|
"detailLabel": "PuSt5a_detailLabel",
|
|
58
|
-
"
|
|
59
|
-
"note": "PuSt5a_note",
|
|
60
|
-
"rowName": "PuSt5a_rowName",
|
|
61
|
-
"headIco": "PuSt5a_headIco",
|
|
76
|
+
"starInfo": "PuSt5a_starInfo",
|
|
62
77
|
"rowBtn": "PuSt5a_rowBtn",
|
|
78
|
+
"starLink": "PuSt5a_starLink",
|
|
79
|
+
"detailGrid": "PuSt5a_detailGrid",
|
|
80
|
+
"rowSub": "PuSt5a_rowSub",
|
|
81
|
+
"headTitle": "PuSt5a_headTitle",
|
|
82
|
+
"popup": "PuSt5a_popup",
|
|
83
|
+
"rowMeta": "PuSt5a_rowMeta",
|
|
84
|
+
"setLabel": "PuSt5a_setLabel",
|
|
85
|
+
"headerBtnOn": "PuSt5a_headerBtnOn",
|
|
86
|
+
"detailAccent": "PuSt5a_detailAccent",
|
|
87
|
+
"prevBtn": "PuSt5a_prevBtn",
|
|
88
|
+
"detailBox": "PuSt5a_detailBox",
|
|
63
89
|
"errText": "PuSt5a_errText",
|
|
64
|
-
"
|
|
65
|
-
"detailHead": "PuSt5a_detailHead",
|
|
66
|
-
"headerBtn": "PuSt5a_headerBtn",
|
|
67
|
-
"evidenceArrow": "PuSt5a_evidenceArrow",
|
|
68
|
-
"layer": "PuSt5a_layer",
|
|
69
|
-
"rowAct": "PuSt5a_rowAct",
|
|
70
|
-
"tabInd": "PuSt5a_tabInd",
|
|
90
|
+
"evidenceBlock": "PuSt5a_evidenceBlock",
|
|
71
91
|
"setNote": "PuSt5a_setNote",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"confirmOk": "PuSt5a_confirmOk",
|
|
75
|
-
"confirmTxt": "PuSt5a_confirmTxt",
|
|
76
|
-
"okText": "PuSt5a_okText",
|
|
92
|
+
"note": "PuSt5a_note",
|
|
93
|
+
"layer": "PuSt5a_layer",
|
|
77
94
|
"tabs": "PuSt5a_tabs",
|
|
78
|
-
"empty": "PuSt5a_empty",
|
|
79
|
-
"rowDot": "PuSt5a_rowDot",
|
|
80
|
-
"noteErr": "PuSt5a_noteErr",
|
|
81
|
-
"sc-spin": "PuSt5a_sc-spin",
|
|
82
|
-
"setLabel": "PuSt5a_setLabel",
|
|
83
|
-
"spin": "PuSt5a_spin",
|
|
84
|
-
"detailAccent": "PuSt5a_detailAccent",
|
|
85
|
-
"tabOn": "PuSt5a_tabOn",
|
|
86
|
-
"spacer": "PuSt5a_spacer",
|
|
87
|
-
"setInput": "PuSt5a_setInput",
|
|
88
|
-
"liveDot": "PuSt5a_liveDot",
|
|
89
|
-
"setCap": "PuSt5a_setCap",
|
|
90
|
-
"rowSub": "PuSt5a_rowSub",
|
|
91
|
-
"confirmRow": "PuSt5a_confirmRow",
|
|
92
|
-
"headerBtnOn": "PuSt5a_headerBtnOn",
|
|
93
|
-
"filter": "PuSt5a_filter",
|
|
94
|
-
"popup": "PuSt5a_popup",
|
|
95
|
-
"setFooter": "PuSt5a_setFooter",
|
|
96
|
-
"tabBody": "PuSt5a_tabBody",
|
|
97
95
|
"tab": "PuSt5a_tab",
|
|
96
|
+
"hintLine": "PuSt5a_hintLine",
|
|
98
97
|
"icoBtn": "PuSt5a_icoBtn",
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
98
|
+
"headIco": "PuSt5a_headIco",
|
|
99
|
+
"badge": "PuSt5a_badge",
|
|
100
|
+
"noteErr": "PuSt5a_noteErr",
|
|
101
|
+
"setPage": "PuSt5a_setPage",
|
|
102
|
+
"switch": "PuSt5a_switch",
|
|
103
|
+
"headerBtn": "PuSt5a_headerBtn",
|
|
104
|
+
"confirmRow": "PuSt5a_confirmRow",
|
|
105
|
+
"confirmOk": "PuSt5a_confirmOk",
|
|
106
|
+
"detailHead": "PuSt5a_detailHead"
|
|
102
107
|
};
|
|
103
108
|
//#endregion
|
|
104
109
|
//#region src/client/ServiceConsole.tsx
|
|
@@ -294,6 +299,25 @@ window.__ModuleLoader__.load({
|
|
|
294
299
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
295
300
|
className: service_console_module_css_default.setNote,
|
|
296
301
|
children: tr("settings.note")
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
304
|
+
className: service_console_module_css_default.starSection,
|
|
305
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
306
|
+
className: service_console_module_css_default.starRow,
|
|
307
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
308
|
+
className: service_console_module_css_default.starInfo,
|
|
309
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
310
|
+
className: service_console_module_css_default.starLabel,
|
|
311
|
+
children: tr("star.ask")
|
|
312
|
+
})
|
|
313
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
314
|
+
className: service_console_module_css_default.starLink,
|
|
315
|
+
href: "https://github.com/Jiyr0119/dsh-service-console",
|
|
316
|
+
target: "_blank",
|
|
317
|
+
rel: "noreferrer",
|
|
318
|
+
children: tr("star.cta")
|
|
319
|
+
})]
|
|
320
|
+
})
|
|
297
321
|
})
|
|
298
322
|
]
|
|
299
323
|
});
|
|
@@ -497,7 +521,7 @@ window.__ModuleLoader__.load({
|
|
|
497
521
|
const badgeKey = OWNERSHIP_KEY[svc.ownership] ?? "own.unknown";
|
|
498
522
|
const ports = svc.listeners.map((l) => String(l.port)).join(", ");
|
|
499
523
|
const url = svc.listeners.map((l) => l.url).filter(Boolean)[0] ?? null;
|
|
500
|
-
const canControl = svc.
|
|
524
|
+
const canControl = !svc.protected;
|
|
501
525
|
const isConfirming = confirming?.id === svc.id;
|
|
502
526
|
const result = opResult?.id === svc.id ? opResult : null;
|
|
503
527
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -899,7 +923,10 @@ window.__ModuleLoader__.load({
|
|
|
899
923
|
"settings.forceKill.desc": "优雅超时后发送 SIGKILL",
|
|
900
924
|
"settings.restore": "恢复默认",
|
|
901
925
|
"settings.note": "配置在本次会话内生效,重启插件后恢复默认。",
|
|
902
|
-
"settings.nav": "Service Console"
|
|
926
|
+
"settings.nav": "Service Console",
|
|
927
|
+
"star.developer": "开发者",
|
|
928
|
+
"star.ask": "⭐ 顺手留颗 Star,作者能高兴一整天",
|
|
929
|
+
"star.cta": "行,给你一颗 Star"
|
|
903
930
|
};
|
|
904
931
|
const EN_DICT = {
|
|
905
932
|
"panel.title": "Service Console",
|
|
@@ -957,7 +984,10 @@ window.__ModuleLoader__.load({
|
|
|
957
984
|
"settings.forceKill.desc": "Send SIGKILL after graceful timeout",
|
|
958
985
|
"settings.restore": "Reset to defaults",
|
|
959
986
|
"settings.note": "Settings apply for this run; they reset when the plugin restarts.",
|
|
960
|
-
"settings.nav": "Service Console"
|
|
987
|
+
"settings.nav": "Service Console",
|
|
988
|
+
"star.developer": "Developer",
|
|
989
|
+
"star.ask": "⭐ Drop a Star if it helped — it makes the author's day",
|
|
990
|
+
"star.cta": "★ Give a Star"
|
|
961
991
|
};
|
|
962
992
|
//#endregion
|
|
963
993
|
//#region src/client/index.tsx
|
package/lib/host/lifecycle.js
CHANGED
|
@@ -20,7 +20,6 @@ async function stopService(deps, serviceId, mode) {
|
|
|
20
20
|
const svc = (await deps.buildSnapshot()).services.find((x) => x.id === serviceId);
|
|
21
21
|
if (!svc) return err("TARGET_GONE", "该服务已结束,列表已刷新");
|
|
22
22
|
if (svc.protected) return err("PROTECTED_PROCESS", "该进程受保护,不能通过 Service Console 操作");
|
|
23
|
-
if (svc.ownership === "unknown") return err("UNKNOWN_OWNERSHIP", "无法确认服务来源,默认不允许控制");
|
|
24
23
|
const target = svc.processGroupId ? "-" + svc.processGroupId : String(svc.pid);
|
|
25
24
|
await (deps.commandRunner || runCommand)("kill -TERM " + target, 3e3);
|
|
26
25
|
const deadline = Date.now() + (deps.config.gracefulTimeout || 3e3);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jiyr0119/dsh-service-console",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "DeepSeek Harness 本地开发服务控制台(原生插件):发现监听端口,识别服务归属,安全查看/停止/重启。Local development service console for DSH.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"dynamic",
|
|
40
40
|
"docs",
|
|
41
41
|
"assets",
|
|
42
|
+
"demo",
|
|
42
43
|
"README.md",
|
|
43
44
|
"README.zh.md",
|
|
44
45
|
"LICENSE",
|