-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
388 lines (370 loc) · 20.4 KB
/
Copy pathindex.html
File metadata and controls
388 lines (370 loc) · 20.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DeepSeek Harness 桌面端</title>
<link rel="stylesheet" href="/src/styles.css" />
</head>
<body>
<div id="app">
<!-- 侧边栏:控制台 + DeepSeek Harness 两个入口 -->
<aside id="sidebar">
<div class="logo" title="DeepSeek Harness">
<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="5.5" r="2.2" />
<circle cx="4.5" cy="17.5" r="2.2" />
<circle cx="19.5" cy="17.5" r="2.2" />
<circle cx="12" cy="14" r="1.6" />
<path d="M12 7.7 L4.8 15.6 M12 7.7 L19.2 15.6 M6.2 17 L10.6 15 M17.8 17 L13.4 15" />
</svg>
</div>
<nav id="nav">
<button id="nav-console" class="nav-item" title="控制台">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="4" width="18" height="13" rx="2" />
<path d="M7 9 l2 2 -2 2 M12 13 h5" />
<path d="M5 20 h14" />
</svg>
<span>控制台</span>
</button>
<button id="nav-harness" class="nav-item" title="DeepSeek Harness">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="18" height="18" rx="3" />
<circle cx="12" cy="12" r="3" />
<path d="M12 9 V3 M12 21 V15 M9 12 H3 M21 12 H15" />
</svg>
<span>DeepSeek<br />Harness</span>
</button>
<div class="nav-sep"></div>
<button id="nav-market" class="nav-item" title="插件市场">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z" />
<path d="M12 4v3 M12 17v3 M4 12h3 M17 12h3" />
<path d="M12 8.5l1 2.5 2.5 1-2.5 1-1 2.5-1-2.5-2.5-1 2.5-1z" />
</svg>
<span>插件市场</span>
</button>
<button id="nav-skills" class="nav-item" title="技能广场">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 3l2.2 5.6L20 10.8l-5.8 2.2L12 18.6l-2.2-5.6L4 10.8l5.8-2.2z" />
<path d="M19 17l.8 2.2L22 20l-2.2.8L19 23l-.8-2.2L16 20l2.2-.8z" />
</svg>
<span>技能广场</span>
</button>
</nav>
<div class="sidebar-bottom">
<button id="btn-sidebar-settings" class="side-btn" title="设置">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3" />
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
</svg>
</button>
<button id="btn-sidebar-qr" class="side-btn" title="扫码访问(局域网)">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<rect x="3" y="3" width="7" height="7" />
<rect x="14" y="3" width="7" height="7" />
<rect x="3" y="14" width="7" height="7" />
<path d="M14 14h3v3h-3z M20 14h1 M14 20h1 M17 17v1 M17 21h-1" />
</svg>
</button>
<button id="btn-sidebar-update" class="side-btn" title="检查更新">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 12a9 9 0 1 1-2.64-6.36" />
<path d="M21 3v6h-6" />
</svg>
</button>
</div>
<div class="sidebar-footer" id="sidebar-footer">v0.2.1</div>
</aside>
<main id="main">
<!-- 视图一:控制台(状态 / 部署 / 启动) -->
<section id="view-control" class="view active">
<header class="panel-header">
<div class="panel-title">
<h1>DeepSeek Harness</h1>
<p class="sub">一键部署 · 一键启动 · 本地运行(http://127.0.0.1:3080)</p>
</div>
<div class="header-actions">
<span id="status-pill" class="pill pill-gray">检测中…</span>
<button id="btn-settings" class="icon-btn" title="设置">
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3" />
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h0a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h0a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v0a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
</svg>
</button>
</div>
</header>
<div class="cards">
<div class="card" id="card-node">
<div class="card-head"><span class="card-label">Node.js 环境</span><span class="card-badge" id="badge-node">-</span></div>
<div class="card-detail" id="detail-node">检测中…</div>
</div>
<div class="card" id="card-dsh">
<div class="card-head"><span class="card-label">Harness 运行时(npx 官方包)</span><span class="card-badge" id="badge-dsh">-</span></div>
<div class="card-detail" id="detail-dsh">检测中…</div>
</div>
<div class="card" id="card-service">
<div class="card-head"><span class="card-label">Harness 服务</span><span class="card-badge" id="badge-service">-</span></div>
<div class="card-detail" id="detail-service">检测中…</div>
</div>
</div>
<div class="action-area">
<button id="btn-primary" class="btn-primary" disabled>检测中…</button>
<button id="btn-secondary" class="btn-secondary" hidden>重新部署</button>
</div>
<div class="log-console">
<div class="log-head">运行日志</div>
<pre id="log"></pre>
</div>
</section>
<!-- 视图二:DeepSeek Harness 页面(iframe 内嵌) -->
<section id="view-page" class="view">
<!-- 可拖动悬浮操作按钮:点击展开 刷新 / 在浏览器打开 / 返回控制台 -->
<div id="float-fab" class="fab" title="操作">
<button id="fab-toggle" type="button" class="fab-btn" aria-haspopup="menu" aria-expanded="false">⋯</button>
<div id="fab-menu" class="fab-menu" hidden>
<button type="button" data-action="refresh">刷新</button>
<button type="button" data-action="open-browser">在浏览器打开</button>
<button type="button" data-action="back">返回控制台</button>
</div>
</div>
<div class="page-wrap">
<iframe id="harness-frame" title="DeepSeek Harness"></iframe>
<div id="page-overlay" hidden>
<div class="overlay-box">
<h2>Harness 服务未运行</h2>
<p>服务地址不可访问,请返回控制台启动服务。</p>
<button id="btn-overlay-back" class="btn-primary">返回控制台</button>
</div>
</div>
</div>
</section>
</main>
</div>
<!-- 设置弹窗 -->
<div id="modal-settings" class="modal" hidden>
<div class="modal-box">
<div class="modal-head">
<h2>设置</h2>
<button id="btn-close-settings" class="icon-btn">✕</button>
</div>
<div class="modal-body">
<label class="field">
<span>npm 镜像源(用于获取运行时)</span>
<input id="set-registry" type="text" spellcheck="false" placeholder="https://registry.npmmirror.com" />
</label>
<label class="field">
<span>服务端口</span>
<input id="set-port" type="number" min="1" max="65535" />
</label>
<label class="field check">
<input id="set-auto-start" type="checkbox" />
<span>部署完成后自动启动服务</span>
</label>
<label class="field check">
<input id="set-stop-on-exit" type="checkbox" />
<span>退出应用时自动停止服务</span>
</label>
<label class="field check">
<input id="set-allow-lan" type="checkbox" />
<span>允许局域网访问(重启服务后生效,绑定 0.0.0.0;同网络手机扫码可用)</span>
</label>
<label class="field">
<span>数据目录</span>
<input id="set-data-dir" type="text" readonly />
</label>
<label class="field">
<span>技能广场地址(技能 / 专家广场数据源,支持 skillhub.cn API 与旧版 skillshub index.json)</span>
<input id="set-skillshub-url" type="text" spellcheck="false" placeholder="https://api.skillhub.cn/api/skills?sortBy=score&pageSize=100" />
</label>
</div>
<div class="modal-foot">
<button id="btn-save-settings" class="btn-primary">保存</button>
</div>
</div>
</div>
<!-- 扫码访问弹窗 -->
<div id="modal-qr" class="modal" hidden>
<div class="modal-box modal-qr-box">
<div class="modal-head">
<h2>扫码访问 DeepSeek Harness</h2>
<button id="btn-close-qr" class="icon-btn">✕</button>
</div>
<div class="modal-body qr-body">
<p class="qr-desc">使用同一局域网内的手机或平板扫描下方二维码,即可访问本机 Harness 管理界面。</p>
<div class="qr-canvas-wrap">
<canvas id="qr-canvas" width="280" height="280"></canvas>
<div id="qr-empty" class="qr-empty">未检测到局域网地址</div>
</div>
<div class="qr-url-row">
<span class="qr-url-label">局域网地址</span>
<input id="qr-lan-url" type="text" readonly spellcheck="false" />
<button id="qr-copy" type="button" class="btn-secondary">复制</button>
</div>
<div class="qr-url-row">
<span class="qr-url-label">本机地址</span>
<input id="qr-local-url" type="text" readonly spellcheck="false" />
</div>
<div id="qr-lan-hint" class="qr-lan-hint"></div>
<div class="qr-lan-toggle">
<label class="field check">
<input id="qr-allow-lan" type="checkbox" />
<span>允许局域网访问(需重启服务后生效;开启后本机 Harness 将监听 0.0.0.0,注意网络范围内可直接访问)</span>
</label>
</div>
<p id="qr-multi" class="qr-multi"></p>
</div>
<div class="modal-foot">
<button id="btn-close-qr-2" class="btn-primary">关闭</button>
</div>
</div>
</div>
<!-- 插件市场弹窗 -->
<div id="modal-market" class="modal" hidden>
<div class="modal-box modal-lg modal-market-box">
<div class="modal-head">
<h2>插件市场</h2>
<button id="btn-close-market" class="icon-btn">✕</button>
</div>
<div class="modal-body">
<div class="market-tabs" id="market-tabs">
<button type="button" class="market-tab" data-tab="market" data-active="1">插件市场</button>
<button type="button" class="market-tab" data-tab="local">本地插件</button>
</div>
<!-- 插件市场:在线搜索 / 安装新插件(GitHub -> npm 兜底) -->
<div class="market-panel" id="panel-market" data-active="1">
<div class="market-hero">
<div class="market-hero-title">搜索并安装社区插件</div>
<p class="market-hero-desc">
输入关键词搜索 dsh 相关插件,优先从 GitHub 仓库查找,GitHub 不可用时自动回退到 npm registry。
安装后会解压到项目 <code>plugins/</code> 目录,随后可在「本地插件」中启用(重启 dsh 服务后生效)。
</p>
</div>
<div class="search-bar">
<input id="plugin-search-input" type="text" spellcheck="false" placeholder="搜索插件,如 i18n、theme、file-explorer…" />
<button id="plugin-search-btn" type="button" class="btn-primary">搜索</button>
</div>
<div class="market-section-head" id="plugin-search-status">输入关键词后点击「搜索」</div>
<div id="market-online-list" class="market-online-list">
<div class="market-card-empty">尚未搜索</div>
</div>
</div>
<!-- 本地插件:列出/启停已安装(含内置)插件 -->
<div class="market-panel" id="panel-local">
<div class="market-import">
<span class="market-import-label">本地导入插件:</span>
<button id="plugin-import-zip" type="button" class="btn-secondary">导入 zip</button>
<button id="plugin-import-dir" type="button" class="btn-secondary">导入文件夹</button>
<input id="plugin-zip-input" type="file" accept=".zip" hidden />
<input id="plugin-dir-input" type="file" webkitdirectory hidden />
</div>
<div class="market-section-head">内置插件(启停后重启 dsh 服务生效)</div>
<div id="market-list" class="plugin-list">
<div class="plugin-row dim">读取中…</div>
</div>
<div class="market-section-head">外部内置插件(配置 GitHub / npm 插件,安装后默认与内置插件一起启用)</div>
<div id="external-plugin-list" class="plugin-list">
<div class="plugin-row dim">读取中…</div>
</div>
<div class="external-add">
<select id="ext-source" class="ext-source">
<option value="github">GitHub</option>
<option value="npm">npm</option>
</select>
<input id="ext-full-name" type="text" spellcheck="false" placeholder="owner/repo 或 npm 包名,如 @dsh-kit/plugin-i18n-zh" />
<button id="ext-add-btn" type="button" class="btn-secondary">添加</button>
</div>
<div class="market-hint">
首次启动时,已配置的外部内置插件会与内置插件一起自动安装并默认启用;也可在下方对单个插件手动「安装并启用」。
</div>
</div>
</div>
<div class="modal-foot">
<button id="btn-market-refresh" class="btn-secondary">刷新</button>
<button id="btn-close-market-2" class="btn-primary">关闭</button>
</div>
</div>
</div>
<!-- 技能广场弹窗 -->
<div id="modal-skills" class="modal" hidden>
<div class="modal-box modal-lg modal-skills-box">
<div class="modal-head">
<h2>技能广场</h2>
<button id="btn-close-skills" class="icon-btn">✕</button>
</div>
<div class="modal-body">
<div class="skills-tabs" id="skills-tabs">
<button type="button" class="skills-tab" data-tab="my" data-active="1">我的技能</button>
<button type="button" class="skills-tab" data-tab="plaza-skills">技能广场</button>
<button type="button" class="skills-tab" data-tab="plaza-experts">专家广场</button>
</div>
<!-- 我的技能:本地可用 skills + 专家 -->
<div class="skills-panel" id="panel-my" data-active="1">
<div class="skills-import">
<span class="skills-import-label">本地导入技能:</span>
<button id="skills-import-zip" type="button" class="btn-secondary">导入 zip</button>
<button id="skills-import-dir" type="button" class="btn-secondary">导入文件夹</button>
<input id="skills-zip-input" type="file" accept=".zip" hidden />
<input id="skills-dir-input" type="file" webkitdirectory hidden />
</div>
<div class="skills-section-head">我的技能</div>
<div id="my-skills" class="skills-list">
<div class="skill-row dim">加载中…</div>
</div>
<div class="skills-section-head">我的专家</div>
<div id="my-experts" class="skills-list">
<div class="skill-row dim">加载中…</div>
</div>
</div>
<!-- 技能广场:从数据源(skillhub.cn 等)拉取可安装技能 -->
<div class="skills-panel" id="panel-plaza-skills">
<div class="search-bar skills-search">
<input id="skills-search-input" type="text" spellcheck="false" placeholder="搜索技能,如 pdf、文档、图片…" />
<button id="skills-search-btn" type="button" class="btn-primary">搜索</button>
</div>
<div class="skills-section-head">技能广场(点击安装到我的技能)</div>
<div id="plaza-skills" class="skills-list">
<div class="skill-row dim">加载中…</div>
</div>
</div>
<!-- 专家广场:从数据源(skillhub.cn 等)拉取可安装专家 -->
<div class="skills-panel" id="panel-plaza-experts">
<div class="skills-section-head">专家广场(点击安装)</div>
<div id="plaza-experts" class="skills-list">
<div class="skill-row dim">加载中…</div>
</div>
</div>
</div>
<div class="modal-foot">
<button id="btn-skills-refresh" class="btn-secondary">刷新</button>
<button id="btn-close-skills-2" class="btn-primary">关闭</button>
</div>
</div>
</div>
<!-- 更新弹窗 -->
<div id="modal-update" class="modal" hidden>
<div class="modal-box">
<div class="modal-head">
<h2>检查更新</h2>
<button id="btn-close-update" class="icon-btn">✕</button>
</div>
<div class="modal-body">
<p id="update-text" class="update-text">正在检查更新…</p>
<div id="release-list" class="release-list" hidden>
<div class="release-list-head">历史版本(可更新或回退)</div>
<div id="release-items" class="release-items"></div>
</div>
<div class="update-progress" id="update-progress" hidden>
<pre id="update-log" class="update-log"></pre>
</div>
</div>
<div class="modal-foot">
<button id="btn-update-cancel" class="btn-secondary">关闭</button>
<button id="btn-update-action" class="btn-primary" hidden>下载并安装</button>
</div>
</div>
</div>
<script type="module" src="/src/main.js"></script>
</body>
</html>