dsh-remote-plugin 0.8.8 → 0.9.0
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.en.md +16 -5
- package/README.md +15 -4
- package/apk/dsh-remote.apk +0 -0
- package/gateway.cjs +527 -78
- package/index.mjs +1 -0
- package/package.json +8 -3
- package/public/activity.js +53 -4
- package/public/admin.html +34 -33
- package/public/admin.js +10 -2
- package/public/app.js +1204 -174
- package/public/bc-integration.css +81 -0
- package/public/build.json +2 -2
- package/public/composer-tools.css +184 -0
- package/public/composer-tools.js +888 -0
- package/public/desktop/desktop.html +92 -73
- package/public/desktop/desktop.js +631 -77
- package/public/file-inbox.js +77 -18
- package/public/genui.css +10 -0
- package/public/genui.js +22 -4
- package/public/host-queue.js +232 -0
- package/public/host-schedule.js +301 -0
- package/public/host-state.css +19 -0
- package/public/index.html +330 -140
- package/public/md.js +21 -1
- package/public/network.js +33 -1
- package/public/onboarding.js +3 -3
- package/public/operations.js +4 -3
- package/public/plan-review.css +297 -0
- package/public/plan-review.js +621 -0
- package/public/plugin.html +29 -28
- package/public/relay-autopair.js +25 -10
- package/public/relay-settings.css +11 -0
- package/public/relay-settings.js +350 -28
- package/public/session-management.css +61 -0
- package/public/session-management.js +742 -0
- package/public/session-search.css +137 -0
- package/public/session-search.js +977 -0
- package/public/skins/blue-fish/preview.html +3 -3
- package/public/skins/bocchi/preview.html +5 -5
- package/public/skins/kita/preview.html +6 -6
- package/public/skins/miku/SOURCES.json +10 -0
- package/public/skins/miku/chibi.png +0 -0
- package/public/skins/miku/preview.html +33 -0
- package/public/skins/miku/skin.css +82 -0
- package/public/skins/nijika/preview.html +6 -6
- package/public/skins/penguin/preview.html +3 -3
- package/public/skins/ryo/preview.html +6 -6
- package/public/slash-suggestions.js +15 -3
- package/public/sponsor-entry.js +11 -3
- package/public/styles.css +141 -21
- package/public/subagents.css +5 -0
- package/public/subagents.js +52 -0
- package/public/theme-vars.css +65 -1
- package/public/theme.js +4 -3
- package/public/turn-diff.css +323 -0
- package/public/turn-diff.js +778 -0
- package/public/update.json +8 -8
- package/public/version.json +1 -1
- package/public/workflow.css +305 -34
- package/public/workflow.js +141 -41
package/index.mjs
CHANGED
|
@@ -1448,6 +1448,7 @@ async function serveStatic(req, res, ctx) {
|
|
|
1448
1448
|
[`${MOUNT}/admin/api/device-keys/mode`, '/device-keys/mode'],
|
|
1449
1449
|
[`${MOUNT}/admin/api/device-keys/create`, '/device-keys/create'],
|
|
1450
1450
|
[`${MOUNT}/admin/api/device-keys/note`, '/device-keys/note'],
|
|
1451
|
+
[`${MOUNT}/admin/api/device-keys/host-state-access`, '/device-keys/host-state-access'],
|
|
1451
1452
|
[`${MOUNT}/admin/api/device-keys/rotate`, '/device-keys/rotate'],
|
|
1452
1453
|
[`${MOUNT}/admin/api/device-keys/revoke`, '/device-keys/revoke'],
|
|
1453
1454
|
])
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-plugin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "DSH Remote
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "DSH Remote:DeepSeek Harness 手机远程控制台,查看会话、接审批、回答提问、继续对话与收发文件;内置网关,支持 Android 与手机/桌面 WebUI。社区第三方插件,作者 Blank-not-black。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|
|
7
7
|
"exports": {
|
|
@@ -40,7 +40,12 @@
|
|
|
40
40
|
"dsh",
|
|
41
41
|
"bundle",
|
|
42
42
|
"remote-control",
|
|
43
|
-
"mobile"
|
|
43
|
+
"mobile",
|
|
44
|
+
"android",
|
|
45
|
+
"webui",
|
|
46
|
+
"remote-approvals",
|
|
47
|
+
"file-transfer",
|
|
48
|
+
"self-hosted"
|
|
44
49
|
],
|
|
45
50
|
"license": "MIT",
|
|
46
51
|
"homepage": "https://github.com/Blank-not-black/dsh-Remote",
|
package/public/activity.js
CHANGED
|
@@ -229,11 +229,58 @@
|
|
|
229
229
|
}
|
|
230
230
|
return null
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function continuationHtml(continuation) {
|
|
233
|
+
if (!continuation) return ''
|
|
234
|
+
const label = continuation.pending ? text('正在确认…','Confirming…') : text('继续生成','Continue generating')
|
|
235
|
+
return `<button type="button" class="history-page-control" data-continue-generation="${continuation.ending}"${continuation.pending?' disabled':''}>${esc(label)}</button>`
|
|
236
|
+
}
|
|
237
|
+
function failureHtml(value,attempt=false,continuation) {
|
|
233
238
|
if(!value)return ''
|
|
234
239
|
const message=typeof value==='string'?value:value.message
|
|
235
240
|
const facts=[value.code,value.status?`HTTP ${value.status}`:''].filter(item=>typeof item==='string'&&item)
|
|
236
|
-
return `<div class="chat-runtime-error" role="status"><strong>${esc(text(attempt?'模型请求失败':'运行出错',attempt?'Model request failed':'Run failed'))}</strong><div>${esc(cut(message||text('主机未提供错误详情','The host did not provide error details'),4000))}</div>${facts.length?`<small>${esc(facts.join(' · '))}</small>`:''}</div>`
|
|
241
|
+
return `<div class="chat-runtime-error" role="status"><strong>${esc(text(attempt?'模型请求失败':'运行出错',attempt?'Model request failed':'Run failed'))}</strong><div>${esc(cut(message||text('主机未提供错误详情','The host did not provide error details'),4000))}</div>${facts.length?`<small>${esc(facts.join(' · '))}</small>`:''}${continuationHtml(continuation)}</div>`
|
|
242
|
+
}
|
|
243
|
+
const continuationViews = new WeakMap()
|
|
244
|
+
function withContinuation(box, entries, options) {
|
|
245
|
+
let view = continuationViews.get(box)
|
|
246
|
+
if (!view) {
|
|
247
|
+
view = { histories: new WeakMap(), decorated: new WeakMap() }
|
|
248
|
+
continuationViews.set(box, view)
|
|
249
|
+
box.addEventListener('click', async event => {
|
|
250
|
+
const button = event.target.closest?.('[data-continue-generation]')
|
|
251
|
+
if (!button || !box.contains(button) || button.disabled) return
|
|
252
|
+
const current = view.options, ending = Number(button.dataset.continueGeneration)
|
|
253
|
+
if (!current.valid() || current.ending !== ending) return
|
|
254
|
+
const previous = view.histories.get(current.history)
|
|
255
|
+
if (previous?.ending === ending) return
|
|
256
|
+
const operation = { ending, pending: true }
|
|
257
|
+
view.histories.set(current.history, operation)
|
|
258
|
+
current.render()
|
|
259
|
+
try {
|
|
260
|
+
if (!(await current.submit(ending))?.accepted) throw new Error(text('主机未接受续跑请求','The Host did not accept continuation'))
|
|
261
|
+
operation.pending = false
|
|
262
|
+
} catch (error) {
|
|
263
|
+
if (view.histories.get(current.history) === operation) view.histories.delete(current.history)
|
|
264
|
+
current.failed(error)
|
|
265
|
+
} finally {
|
|
266
|
+
if (current.valid()) current.render()
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
view.options = options
|
|
271
|
+
const { ending, history } = options
|
|
272
|
+
if (!Number.isSafeInteger(ending) || ending < 0) return entries
|
|
273
|
+
const operation = view.histories.get(history)
|
|
274
|
+
const pending = operation?.ending === ending && operation.pending
|
|
275
|
+
if (operation?.ending === ending && !pending) return entries
|
|
276
|
+
return entries.map(entry => {
|
|
277
|
+
if (entry.seq !== ending || entry.event?.type !== 'turn/end' || !failure(entry.event)) return entry
|
|
278
|
+
const decorated = view.decorated.get(entry)
|
|
279
|
+
if (decorated?.view.continuation.pending === pending) return decorated
|
|
280
|
+
const row = { ...entry, view: { ...entry.view, continuation: { ending, pending } } }
|
|
281
|
+
view.decorated.set(entry, row)
|
|
282
|
+
return row
|
|
283
|
+
})
|
|
237
284
|
}
|
|
238
285
|
const failureGroups=new WeakMap()
|
|
239
286
|
function groupFailures(entries) {
|
|
@@ -263,7 +310,9 @@
|
|
|
263
310
|
function failureGroupHtml(group,renderEntry) {
|
|
264
311
|
const latest=failure(group.items.at(-1)?.event)
|
|
265
312
|
const hint=typeof latest==='string'?latest:latest?.message
|
|
266
|
-
|
|
313
|
+
const selected = group.items.find(entry => entry.view?.continuation)
|
|
314
|
+
const body = group.items.map(entry => renderEntry(entry === selected ? { ...entry, view: { ...entry.view, continuation: undefined } } : entry)).join('')
|
|
315
|
+
return shell('error','failure-group:'+group.items[0].seq,text(`连续报错 · ${group.count} 条`,`${group.count} consecutive errors`),brief(hint),text('详情','Details'),body,false,true) + continuationHtml(selected?.view.continuation)
|
|
267
316
|
}
|
|
268
317
|
function attemptHtml(event) {
|
|
269
318
|
const blocks=new Map(),data=event?.data||{}
|
|
@@ -277,7 +326,7 @@
|
|
|
277
326
|
return [...blocks].filter(([,value])=>value).map(([index,value])=>reasoning({text:value,key:`attempt:${event.seq}:${index}`})).join('')+failureHtml(failure(event),true)
|
|
278
327
|
}
|
|
279
328
|
const streamNotice=()=>`<div class="activity-note" role="status">${esc(text('弱网精简已隐藏实时思考,完成后可查看;可在网络设置中关闭精简。','Live reasoning is hidden in weak-network mode. View it after completion or disable trimming in network settings.'))}</div>`
|
|
280
|
-
const api={hasVisibleText,prepare,tool,toolEvent,isToolEvent,reasoning,reasoningKey,group,groupHtml,turnHtml,failure,failureHtml,groupFailures,failureGroupHtml,attemptHtml,streamNotice}
|
|
329
|
+
const api={hasVisibleText,prepare,tool,toolEvent,isToolEvent,reasoning,reasoningKey,group,groupHtml,turnHtml,failure,failureHtml,groupFailures,failureGroupHtml,attemptHtml,streamNotice,withContinuation}
|
|
281
330
|
if(typeof module!=='undefined'&&module.exports)module.exports=api
|
|
282
331
|
else root.DshActivity=api
|
|
283
332
|
})(typeof window==='undefined'?globalThis:window)
|
package/public/admin.html
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="zh-CN">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="dsh-remote-build" content="
|
|
4
|
+
<meta name="dsh-remote-build" content="62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
7
7
|
<meta name="theme-color" content="#0D1117">
|
|
8
8
|
<title>DSH Remote · 管理</title>
|
|
9
|
-
<script>/* 首帧前应用皮肤 */ (function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'&&t!=='penguin-logistics'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
10
|
-
<link rel="stylesheet" href="../styles.css?dsr-build=
|
|
11
|
-
<link rel="stylesheet" href="../relay-settings.css?dsr-build=
|
|
12
|
-
<link rel="stylesheet" href="../insights.css?dsr-build=
|
|
13
|
-
<link rel="stylesheet" href="../setup.css?dsr-build=
|
|
14
|
-
<link rel="stylesheet" href="../doctor.css?dsr-build=
|
|
15
|
-
<link rel="stylesheet" href="../skins/blue-fish/skin.css?dsr-build=
|
|
16
|
-
<link rel="stylesheet" href="../skins/penguin/skin.css?dsr-build=
|
|
17
|
-
<link rel="stylesheet" href="../skins/bocchi/skin.css?dsr-build=
|
|
18
|
-
<link rel="stylesheet" href="../skins/kessoku/skin.css?dsr-build=
|
|
19
|
-
<link rel="stylesheet" href="../skins/nijika/skin.css?dsr-build=
|
|
20
|
-
<link rel="stylesheet" href="../skins/ryo/skin.css?dsr-build=
|
|
21
|
-
<link rel="stylesheet" href="../skins/kita/skin.css?dsr-build=
|
|
22
|
-
<link rel="stylesheet" href="../skins/penguin-logistics/skin.css?dsr-build=
|
|
9
|
+
<script>/* 首帧前应用皮肤 */ (function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'&&t!=='penguin-logistics'&&t!=='miku'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
10
|
+
<link rel="stylesheet" href="../styles.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
11
|
+
<link rel="stylesheet" href="../relay-settings.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
12
|
+
<link rel="stylesheet" href="../insights.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
13
|
+
<link rel="stylesheet" href="../setup.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
14
|
+
<link rel="stylesheet" href="../doctor.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
15
|
+
<link rel="stylesheet" href="../skins/blue-fish/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
16
|
+
<link rel="stylesheet" href="../skins/penguin/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
17
|
+
<link rel="stylesheet" href="../skins/bocchi/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
18
|
+
<link rel="stylesheet" href="../skins/kessoku/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
19
|
+
<link rel="stylesheet" href="../skins/nijika/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
20
|
+
<link rel="stylesheet" href="../skins/ryo/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
21
|
+
<link rel="stylesheet" href="../skins/kita/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
22
|
+
<link rel="stylesheet" href="../skins/penguin-logistics/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
23
|
+
<link rel="stylesheet" href="../skins/miku/skin.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
23
24
|
<style>
|
|
24
25
|
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 40px; }
|
|
25
26
|
.admin-title {
|
|
@@ -349,8 +350,8 @@
|
|
|
349
350
|
.admin-title .left { gap: 7px; }
|
|
350
351
|
}
|
|
351
352
|
</style>
|
|
352
|
-
<link rel="stylesheet" href="../remote-ui.css?dsr-build=
|
|
353
|
-
<link rel="stylesheet" href="../theme-picker.css?dsr-build=
|
|
353
|
+
<link rel="stylesheet" href="../remote-ui.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
354
|
+
<link rel="stylesheet" href="../theme-picker.css?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979">
|
|
354
355
|
</head>
|
|
355
356
|
<body>
|
|
356
357
|
<div class="admin-wrap">
|
|
@@ -581,7 +582,7 @@
|
|
|
581
582
|
'doctor.realtime': '实时消息通道', 'doctor.realtimePass': 'mux 与 host 通道均已连接', 'doctor.realtimeFail': '实时通道未全部建立;可先使用轮询,检查 DSH 后会自动恢复',
|
|
582
583
|
'doctor.start': '启动', 'doctor.showQr': '显示二维码', 'doctor.copyAddress': '复制地址', 'doctor.copyCommand': '复制命令',
|
|
583
584
|
'doctor.reportCopied': '诊断报告已复制', 'doctor.commandCopied': '防火墙命令已复制,请确认网络范围后手动执行', 'doctor.addressCopied': '服务器地址已复制',
|
|
584
|
-
'theme.default': '默认深空', 'theme.dark': '落日', 'theme.light': '易北爱乐厅', 'theme.neutral': '草原孤塔', 'theme.mono': '黑曜白', 'theme.fish': '蓝色大肥鱼', 'theme.penguin': '企鹅女管·白昼', 'theme.penguin-night': '企鹅女管·极夜', 'theme.bocchi': '波奇酱', 'theme.nijika': '伊地知虹夏', 'theme.ryo': '山田凉', 'theme.kita': '喜多郁代', 'theme.penguin-logistics': '企鹅物流',
|
|
585
|
+
'theme.default': '默认深空', 'theme.dark': '落日', 'theme.light': '易北爱乐厅', 'theme.neutral': '草原孤塔', 'theme.mono': '黑曜白', 'theme.fish': '蓝色大肥鱼', 'theme.penguin': '企鹅女管·白昼', 'theme.penguin-night': '企鹅女管·极夜', 'theme.bocchi': '波奇酱', 'theme.nijika': '伊地知虹夏', 'theme.ryo': '山田凉', 'theme.kita': '喜多郁代', 'theme.penguin-logistics': '企鹅物流', 'theme.miku': '初音未来',
|
|
585
586
|
'theme.panelTitle': '选择配色', 'theme.close': '关闭',
|
|
586
587
|
'repo': '仓库',
|
|
587
588
|
'donateTitle': '赞赏支持', 'donateThanks': '感谢你的支持 ☕',
|
|
@@ -700,7 +701,7 @@
|
|
|
700
701
|
'doctor.realtime': 'Realtime channels', 'doctor.realtimePass': 'Both mux and host channels are connected', 'doctor.realtimeFail': 'Realtime channels are incomplete. Polling remains available and recovery is automatic.',
|
|
701
702
|
'doctor.start': 'Start', 'doctor.showQr': 'Show QR', 'doctor.copyAddress': 'Copy address', 'doctor.copyCommand': 'Copy command',
|
|
702
703
|
'doctor.reportCopied': 'Diagnostic report copied', 'doctor.commandCopied': 'Firewall command copied. Review the network scope before running it.', 'doctor.addressCopied': 'Server address copied',
|
|
703
|
-
'theme.default': 'Default', 'theme.dark': 'Sunset', 'theme.light': 'Elbphilharmonie', 'theme.neutral': 'Prairie Tower', 'theme.mono': 'Monochrome', 'theme.fish': 'Blue Fat Fish', 'theme.penguin': 'Penguin Admin Day', 'theme.penguin-night': 'Penguin Admin Night', 'theme.bocchi': 'Bocchi', 'theme.nijika': 'Nijika', 'theme.ryo': 'Ryo', 'theme.kita': 'Kita', 'theme.penguin-logistics': 'Penguin Logistics',
|
|
704
|
+
'theme.default': 'Default', 'theme.dark': 'Sunset', 'theme.light': 'Elbphilharmonie', 'theme.neutral': 'Prairie Tower', 'theme.mono': 'Monochrome', 'theme.fish': 'Blue Fat Fish', 'theme.penguin': 'Penguin Admin Day', 'theme.penguin-night': 'Penguin Admin Night', 'theme.bocchi': 'Bocchi', 'theme.nijika': 'Nijika', 'theme.ryo': 'Ryo', 'theme.kita': 'Kita', 'theme.penguin-logistics': 'Penguin Logistics', 'theme.miku': 'Hatsune Miku',
|
|
704
705
|
'theme.panelTitle': 'Choose theme', 'theme.close': 'Close',
|
|
705
706
|
'repo': 'Repo',
|
|
706
707
|
'donateTitle': 'Support', 'donateThanks': 'Thanks for your support ☕',
|
|
@@ -802,20 +803,20 @@
|
|
|
802
803
|
}
|
|
803
804
|
}
|
|
804
805
|
</script>
|
|
805
|
-
<script src="../setup.js?dsr-build=
|
|
806
|
-
<script src="../qrcode.min.js?dsr-build=
|
|
807
|
-
<script src="../i18n.js?dsr-build=
|
|
808
|
-
<script src="../theme.js?dsr-build=
|
|
809
|
-
<script src="../vendor/gsap/gsap.min.js?dsr-build=
|
|
810
|
-
<script src="../motion.js?dsr-build=
|
|
811
|
-
<script src="../remote-state.js?dsr-build=
|
|
812
|
-
<script src="../remote-ui.js?dsr-build=
|
|
813
|
-
<script src="../admin.js?dsr-build=
|
|
814
|
-
<script src="../doctor.js?dsr-build=
|
|
815
|
-
<script src="../doctor-entry.js?dsr-build=
|
|
816
|
-
<script src="../sponsor-entry.js?dsr-build=
|
|
817
|
-
<script src="../relay-devices.js?dsr-build=
|
|
818
|
-
<script src="../relay-settings.js?dsr-build=
|
|
806
|
+
<script src="../setup.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
807
|
+
<script src="../qrcode.min.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
808
|
+
<script src="../i18n.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
809
|
+
<script src="../theme.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
810
|
+
<script src="../vendor/gsap/gsap.min.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
811
|
+
<script src="../motion.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
812
|
+
<script src="../remote-state.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
813
|
+
<script src="../remote-ui.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
814
|
+
<script src="../admin.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
815
|
+
<script src="../doctor.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
816
|
+
<script src="../doctor-entry.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
817
|
+
<script src="../sponsor-entry.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
818
|
+
<script src="../relay-devices.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
819
|
+
<script src="../relay-settings.js?dsr-build=62134119698eef6589b38ff6409a46d4160345043eb1aad1ba54e22b19d0b979"></script>
|
|
819
820
|
<script>window.mountAdminRelaySettings?.()</script>
|
|
820
821
|
</body>
|
|
821
822
|
</html>
|
package/public/admin.js
CHANGED
|
@@ -474,6 +474,7 @@ function renderDeviceKeys(st, isGateway) {
|
|
|
474
474
|
<button class="mini-btn" type="button" data-device-key-show="${esc(entry.id)}">${esc(window.DshRemoteUI?.t(revealedDeviceKeys.has(entry.id) ? 'hide' : 'show') || '显示令牌')}</button>
|
|
475
475
|
<button class="mini-btn" type="button" data-device-key-qr="${esc(entry.id)}">${esc(t('qrCode'))}</button>
|
|
476
476
|
<button class="mini-btn" type="button" data-device-key-rotate="${esc(entry.id)}">${esc(t('rotateToken'))}</button>
|
|
477
|
+
<button class="mini-btn" type="button" data-device-key-access="${esc(entry.id)}" aria-pressed="${!!entry.hostStateReadOnly}">${esc(t(entry.hostStateReadOnly ? 'deviceKeys.hostStateReadOnly' : 'deviceKeys.hostStateWritable'))}</button>
|
|
477
478
|
<button class="mini-btn" type="button" data-device-key-copy="${esc(entry.id)}">${esc(t('copyToken'))}</button>
|
|
478
479
|
<button class="mini-btn danger" type="button" data-device-key-revoke="${esc(entry.id)}">${esc(t('deviceKeys.revoke'))}</button>
|
|
479
480
|
</div>
|
|
@@ -792,6 +793,12 @@ async function editDeviceKeyNote(entry) {
|
|
|
792
793
|
await loadState()
|
|
793
794
|
}
|
|
794
795
|
|
|
796
|
+
async function toggleDeviceKeyAccess(entry) {
|
|
797
|
+
if (!entry || deviceKeyBusy) return
|
|
798
|
+
const out = await deviceKeyMutation('host-state-access', { id: entry.id, readOnly: !entry.hostStateReadOnly })
|
|
799
|
+
if (out) await loadState()
|
|
800
|
+
}
|
|
801
|
+
|
|
795
802
|
function showDeviceKeyQr(entry) {
|
|
796
803
|
if (!entry?.token) return
|
|
797
804
|
window.DshConsole?.select('devices')
|
|
@@ -878,7 +885,7 @@ $('btn-device-key-add').addEventListener('click', createDeviceKey)
|
|
|
878
885
|
$('device-key-rows').addEventListener('click', event => {
|
|
879
886
|
const button = event.target.closest('button')
|
|
880
887
|
if (!button) return
|
|
881
|
-
for (const [name,handler] of [['note',editDeviceKeyNote],['qr',showDeviceKeyQr],['rotate',rotateDeviceKey],['copy',copyDeviceKey],['revoke',revokeDeviceKey]]) {
|
|
888
|
+
for (const [name,handler] of [['note',editDeviceKeyNote],['qr',showDeviceKeyQr],['rotate',rotateDeviceKey],['copy',copyDeviceKey],['revoke',revokeDeviceKey],['access',toggleDeviceKeyAccess]]) {
|
|
882
889
|
const id=button.dataset['deviceKey'+name[0].toUpperCase()+name.slice(1)]
|
|
883
890
|
if (id) { handler(lastState?.deviceKeys?.entries?.find(entry=>entry.id===id)); return }
|
|
884
891
|
}
|
|
@@ -1077,7 +1084,8 @@ const THEME_META = [
|
|
|
1077
1084
|
{ id: 'nijika', sw: ['#FFF3D5', '#FFFFFF', '#94600C'] },
|
|
1078
1085
|
{ id: 'ryo', sw: ['#E9F1FA', '#FFFFFF', '#315D91'] },
|
|
1079
1086
|
{ id: 'kita', sw: ['#FFE9E5', '#FFFFFF', '#B6373C'] },
|
|
1080
|
-
{ id: 'penguin-logistics', sw: ['#12161B', '#1D252E', '#E9B66F'] }
|
|
1087
|
+
{ id: 'penguin-logistics', sw: ['#12161B', '#1D252E', '#E9B66F'] },
|
|
1088
|
+
{ id: 'miku', sw: ['#F3FFFC', '#FFFFFF', '#126D69'] }
|
|
1081
1089
|
]
|
|
1082
1090
|
|
|
1083
1091
|
function renderThemeBtn() {
|