dsh-remote-plugin 0.8.1 → 0.8.3
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 +1 -1
- package/apk/dsh-remote.apk +0 -0
- package/cordis.patch.yml +2 -1
- package/gateway.cjs +323 -64
- package/index.mjs +2 -2
- package/insights.mjs +5 -3
- package/market.mjs +4 -1
- package/package.json +1 -1
- package/plugin-center.mjs +120 -7
- package/plugin-transaction.mjs +10 -3
- package/public/admin.html +19 -14
- package/public/admin.js +71 -23
- package/public/announcements.json +192 -0
- package/public/app.js +192 -60
- package/public/build.json +2 -2
- package/public/chat-copy.js +46 -0
- package/public/desktop/desktop.css +10 -0
- package/public/desktop/desktop.html +28 -15
- package/public/desktop/desktop.js +74 -22
- package/public/diagnostics.js +115 -21
- package/public/history.js +45 -9
- package/public/image-cache.js +141 -0
- package/public/image-preview.js +48 -5
- package/public/index.html +39 -34
- package/public/lan-discovery.js +94 -0
- package/public/md.js +8 -2
- package/public/plugin-center.js +1 -1
- package/public/plugin.html +8 -2
- package/public/relay-settings.js +7 -6
- package/public/skins/blue-fish/DESIGN.md +24 -0
- package/public/skins/blue-fish/preview.html +11 -289
- package/public/skins/blue-fish/skin.css +95 -585
- package/public/skins/blue-fish/sparkles.svg +18 -0
- package/public/skins/bocchi/DESIGN.md +99 -0
- package/public/skins/bocchi/face.png +0 -0
- package/public/skins/bocchi/grain.png +0 -0
- package/public/skins/bocchi/icon-blush.png +0 -0
- package/public/skins/bocchi/icon-sleep.png +0 -0
- package/public/skins/bocchi/icon-smile.png +0 -0
- package/public/skins/bocchi/icon-star.png +0 -0
- package/public/skins/bocchi/icon-wink.png +0 -0
- package/public/skins/bocchi/icon.png +0 -0
- package/public/skins/bocchi/pattern-soft.png +0 -0
- package/public/skins/bocchi/pattern.png +0 -0
- package/public/skins/bocchi/preview.html +54 -0
- package/public/skins/bocchi/skin.css +233 -0
- package/public/skins/bocchi/stage-bg.png +0 -0
- package/public/skins/bocchi/stage-soft.png +0 -0
- package/public/skins/bocchi/stand.png +0 -0
- package/public/skins/bocchi/sticker-guitar.png +0 -0
- package/public/skins/kessoku/DESIGN.md +38 -0
- package/public/skins/kessoku/grain.png +0 -0
- package/public/skins/kessoku/skin.css +212 -0
- package/public/skins/kita/SOURCES.json +51 -0
- package/public/skins/kita/face.png +0 -0
- package/public/skins/kita/icon-live.png +0 -0
- package/public/skins/kita/icon-reddress.png +0 -0
- package/public/skins/kita/icon-seifuku.png +0 -0
- package/public/skins/kita/pattern.png +0 -0
- package/public/skins/kita/preview.html +55 -0
- package/public/skins/kita/skin.css +26 -0
- package/public/skins/kita/stand.png +0 -0
- package/public/skins/kita/sticker-live.png +0 -0
- package/public/skins/nijika/SOURCES.json +51 -0
- package/public/skins/nijika/face.png +0 -0
- package/public/skins/nijika/icon-live.png +0 -0
- package/public/skins/nijika/icon-reddress.png +0 -0
- package/public/skins/nijika/icon-seifuku.png +0 -0
- package/public/skins/nijika/pattern.png +0 -0
- package/public/skins/nijika/preview.html +55 -0
- package/public/skins/nijika/skin.css +25 -0
- package/public/skins/nijika/stand.png +0 -0
- package/public/skins/nijika/sticker-live.png +0 -0
- package/public/skins/penguin/DESIGN.md +33 -0
- package/public/skins/penguin/SOURCES.json +22 -0
- package/public/skins/penguin/aic-blueprint.svg +24 -0
- package/public/skins/penguin/endfield-triangles.svg +4 -0
- package/public/skins/penguin/face.png +0 -0
- package/public/skins/penguin/icon-blush.png +0 -0
- package/public/skins/penguin/icon-dizzy.png +0 -0
- package/public/skins/penguin/icon-laugh.png +0 -0
- package/public/skins/penguin/icon-sleep.png +0 -0
- package/public/skins/penguin/icon-smile.png +0 -0
- package/public/skins/penguin/icon-star.png +0 -0
- package/public/skins/penguin/icon-wink.png +0 -0
- package/public/skins/penguin/icon.png +0 -0
- package/public/skins/penguin/mascot.png +0 -0
- package/public/skins/penguin/pattern-night.png +0 -0
- package/public/skins/penguin/pattern.png +0 -0
- package/public/skins/penguin/preview.html +11 -0
- package/public/skins/penguin/skin.css +212 -0
- package/public/skins/ryo/SOURCES.json +51 -0
- package/public/skins/ryo/face.png +0 -0
- package/public/skins/ryo/icon-live.png +0 -0
- package/public/skins/ryo/icon-reddress.png +0 -0
- package/public/skins/ryo/icon-seifuku.png +0 -0
- package/public/skins/ryo/pattern.png +0 -0
- package/public/skins/ryo/preview.html +55 -0
- package/public/skins/ryo/skin.css +25 -0
- package/public/skins/ryo/stand.png +0 -0
- package/public/skins/ryo/sticker-live.png +0 -0
- package/public/sponsor-entry.js +22 -0
- package/public/styles.css +13 -0
- package/public/theme-picker.css +58 -0
- package/public/theme-vars.css +532 -5
- package/public/theme.js +111 -3
- package/public/update.json +12 -12
- package/public/version.json +1 -1
- package/public/workflow.css +2 -1
- package/public/workflow.js +24 -1
- package/skills/dsh-remote-doctor/references/wiki/notifications.md +4 -0
package/public/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
9
9
|
<title>DSH Remote</title>
|
|
10
10
|
<script>/* 统一入口: 桌面浏览器(宽屏且 UA 非移动)访问根地址自动切换到桌面端, 手机/窄窗口继续 App 界面 */ (function(){try{if(new URLSearchParams(location.search).get('layout')==='mobile'){sessionStorage.setItem('dshRemoteLayout','mobile');return}if(sessionStorage.getItem('dshRemoteLayout')==='mobile')return;var proto=location.protocol;var ua=navigator.userAgent||'';var mobile=/Android|iPhone|iPad|iPod|Mobile|Windows Phone/i.test(ua);if((proto==='http:'||proto==='https:')&&!mobile&&window.innerWidth>=1024){var p=location.pathname;if(p==='/'||/\/index\.html$/.test(p)){location.replace('desktop/desktop.html'+location.search)}}}catch(e){}})()</script>
|
|
11
|
-
<script>/* 首帧前应用皮肤, 避免闪白/闪黑 */ (function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
11
|
+
<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='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
12
12
|
<link rel="manifest" href="manifest.webmanifest">
|
|
13
13
|
<link rel="icon" href="icon.svg" type="image/svg+xml">
|
|
14
14
|
<link rel="stylesheet" href="styles.css">
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
<link rel="stylesheet" href="relay-settings.css">
|
|
24
24
|
<link rel="stylesheet" href="subagents.css">
|
|
25
25
|
<link rel="stylesheet" href="skins/blue-fish/skin.css">
|
|
26
|
+
<link rel="stylesheet" href="skins/penguin/skin.css">
|
|
27
|
+
<link rel="stylesheet" href="skins/bocchi/skin.css">
|
|
28
|
+
<link rel="stylesheet" href="skins/kessoku/skin.css">
|
|
29
|
+
<link rel="stylesheet" href="skins/nijika/skin.css">
|
|
30
|
+
<link rel="stylesheet" href="skins/ryo/skin.css">
|
|
31
|
+
<link rel="stylesheet" href="skins/kita/skin.css">
|
|
32
|
+
<link rel="stylesheet" href="theme-picker.css">
|
|
26
33
|
</head>
|
|
27
34
|
<body>
|
|
28
35
|
<header class="topbar">
|
|
@@ -434,6 +441,7 @@
|
|
|
434
441
|
</div>
|
|
435
442
|
<div id="server-list" class="server-list"></div>
|
|
436
443
|
<div class="server-add">
|
|
444
|
+
<button id="btn-lan-discover" class="mini-btn hidden" type="button" data-i18n="settings.lanDiscover">搜索电脑</button>
|
|
437
445
|
<input id="server-input" type="url" placeholder="http://IP:8787">
|
|
438
446
|
<button id="btn-server-add" class="mini-btn" data-i18n="settings.add">添加</button>
|
|
439
447
|
</div>
|
|
@@ -464,11 +472,12 @@
|
|
|
464
472
|
<label class="switch"><input type="checkbox" id="opt-peak-remind" aria-label="峰谷计费提醒 · dsh-cost-meter"><span class="slider"></span></label>
|
|
465
473
|
</div>
|
|
466
474
|
<div class="setting-row">
|
|
467
|
-
<div><div class="setting-name" data-i18n="settings.testNotifyTitle">测试通知</div><div class="setting-desc" data-i18n="settings.testNotifyDesc"
|
|
475
|
+
<div><div class="setting-name" data-i18n="settings.testNotifyTitle">测试通知</div><div class="setting-desc" data-i18n="settings.testNotifyDesc">Android 使用所选类型的实际通知渠道测试,不执行真实任务</div></div>
|
|
476
|
+
<select id="test-notify-kind" class="setting-select" aria-label="通知测试类型"><option value="approval" data-i18n="settings.testApproval">审批提醒</option><option value="turn" data-i18n="settings.testTurn">本轮结束</option><option value="error" data-i18n="settings.testError">执行失败</option></select>
|
|
468
477
|
<button id="btn-test-notify" class="mini-btn" data-i18n="settings.testNotify">发送测试通知</button>
|
|
469
478
|
</div>
|
|
470
479
|
<div class="setting-row">
|
|
471
|
-
<div><div class="setting-name" data-i18n="settings.bgTitle">后台轮询</div><div class="setting-desc" data-i18n="settings.bgDesc"
|
|
480
|
+
<div><div class="setting-name" data-i18n="settings.bgTitle">后台轮询</div><div class="setting-desc" data-i18n="settings.bgDesc">退后台后由前台服务接收事件;系统省电与服务时限可能延迟提醒</div><div id="bg-auth-status" class="setting-desc hidden" data-i18n="settings.bgAuthFailed">登录失效:连续 3 次 401,后台轮询已停止</div></div>
|
|
472
481
|
<label class="switch"><input type="checkbox" id="opt-bg-poll"><span class="slider"></span></label>
|
|
473
482
|
</div>
|
|
474
483
|
<div class="setting-row">
|
|
@@ -481,7 +490,7 @@
|
|
|
481
490
|
</select>
|
|
482
491
|
</div>
|
|
483
492
|
<div class="setting-row">
|
|
484
|
-
<div><div class="setting-name" data-i18n="settings.taskDoneTitle">任务结束通知</div><div class="setting-desc" data-i18n="settings.taskDoneDesc"
|
|
493
|
+
<div><div class="setting-name" data-i18n="settings.taskDoneTitle">任务结束通知</div><div class="setting-desc" data-i18n="settings.taskDoneDesc">分别提醒本轮结束、目标完成与执行失败,点击进入对应会话</div></div>
|
|
485
494
|
<label class="switch"><input type="checkbox" id="opt-task-done"><span class="slider"></span></label>
|
|
486
495
|
</div>
|
|
487
496
|
<div class="setting-row">
|
|
@@ -668,12 +677,14 @@
|
|
|
668
677
|
<button class="fb-chip" data-fb-type="suggestion" data-i18n="feedback.typeSuggestion">建议</button>
|
|
669
678
|
<button class="fb-chip" data-fb-type="other" data-i18n="feedback.typeOther">其他</button>
|
|
670
679
|
</div>
|
|
671
|
-
<textarea id="fb-msg" class="fb-textarea" rows="5"
|
|
680
|
+
<textarea id="fb-msg" class="fb-textarea" rows="5" aria-describedby="fb-length" data-i18n-placeholder="feedback.messagePlaceholder" placeholder="请描述遇到的问题或建议(必填,最多 20000 字符)"></textarea>
|
|
681
|
+
<p id="fb-length" class="feedback-length" role="status" aria-live="polite"></p>
|
|
682
|
+
<button id="fb-copy-draft" type="button" class="btn subtle fb-copy-draft">复制全文</button>
|
|
672
683
|
<input id="fb-contact" class="fb-input" maxlength="200" data-i18n-placeholder="feedback.contactPlaceholder" placeholder="联系方式(可选):邮箱 / 微信 / B站 ID">
|
|
673
|
-
<label class="fb-diagnostics"><input id="fb-include-diagnostics" type="checkbox"> <span data-i18n="feedback.includeDiagnostics"
|
|
684
|
+
<label class="fb-diagnostics"><input id="fb-include-diagnostics" type="checkbox"> <span data-i18n="feedback.includeDiagnostics">附带客户端与网关诊断(可选)</span><small data-i18n="feedback.diagnosticsPrivacy">上传客户端操作与错误位置、存储占用、版本和网关链路状态;不含令牌、Cookie、对话正文、答案或完整路径。可在下方预览。</small></label>
|
|
674
685
|
<label class="fb-diagnostics"><input id="fb-include-crashes" type="checkbox"> <span data-i18n="feedback.includeCrashes">附带崩溃日志摘要(可选)</span><small data-i18n="feedback.crashPrivacy">默认仅在本机记录。勾选后上传最近 3 条退出、重启和错误位置摘要,不含对话、密钥或完整路径。</small></label>
|
|
675
686
|
<section class="client-diagnostics" aria-label="操作诊断日志">
|
|
676
|
-
<p data-log-label="privacy"
|
|
687
|
+
<p data-log-label="privacy">操作日志默认保存在此设备。提交反馈时勾选诊断选项可附带脱敏日志,也可复制或导出。</p>
|
|
677
688
|
<details id="fb-client-log-details"><summary data-log-label="details">查看操作诊断日志</summary><pre id="fb-client-log-preview"></pre></details>
|
|
678
689
|
<div class="client-log-actions"><button id="fb-log-preview" type="button" data-log-label="refresh">刷新预览</button><button id="fb-log-copy" type="button" data-log-label="copy">复制日志</button><button id="fb-log-export" type="button" data-log-label="export">导出日志</button><button id="fb-log-clear" type="button" data-log-label="clear">清除日志</button></div>
|
|
679
690
|
<p id="fb-client-log-status" role="status" aria-live="polite"></p>
|
|
@@ -695,6 +706,7 @@
|
|
|
695
706
|
</div>
|
|
696
707
|
<div id="feedback-success-title" class="modal-title feedback-success-title" data-i18n="feedback.successTitle">反馈发送成功</div>
|
|
697
708
|
<div class="modal-body feedback-success-body" data-i18n="feedback.successBody">服务器已确认收到这条反馈,感谢你的帮助。</div>
|
|
709
|
+
<p id="feedback-diagnostics-status" class="hidden" role="status" aria-live="polite"></p>
|
|
698
710
|
<div class="modal-actions">
|
|
699
711
|
<button id="feedback-success-confirm" class="btn primary" data-i18n="feedback.successConfirm">知道了</button>
|
|
700
712
|
</div>
|
|
@@ -843,18 +855,8 @@
|
|
|
843
855
|
</div>
|
|
844
856
|
</div>
|
|
845
857
|
|
|
846
|
-
<!-- 皮肤选择模态 -->
|
|
847
|
-
<div id="modal-theme" class="modal hidden" role="dialog" aria-modal="true">
|
|
848
|
-
<div class="modal-card">
|
|
849
|
-
<div class="modal-title" data-i18n="theme.panelTitle">选择配色</div>
|
|
850
|
-
<div id="theme-options" class="theme-panel-list"></div>
|
|
851
|
-
<div class="modal-actions">
|
|
852
|
-
<button id="theme-close" class="btn subtle" data-i18n="theme.close">关闭</button>
|
|
853
|
-
</div>
|
|
854
|
-
</div>
|
|
855
|
-
</div>
|
|
856
|
-
|
|
857
858
|
<!-- 赞赏支持模态 -->
|
|
859
|
+
<script src="sponsor-entry.js" defer></script>
|
|
858
860
|
<div id="modal-donate" class="modal hidden" role="dialog" aria-modal="true">
|
|
859
861
|
<div class="modal-card">
|
|
860
862
|
<div class="modal-title" data-i18n="settings.donate">赞赏支持</div>
|
|
@@ -1160,7 +1162,7 @@
|
|
|
1160
1162
|
'settings.servers': '服务器地址(可多个)', 'settings.speedTest': '测速', 'settings.add': '添加',
|
|
1161
1163
|
'settings.scanTitle': '扫码连接', 'settings.scanDesc': '实时相机识别二维码,也可拍照/相册本地解码;无需谷歌服务', 'settings.scan': '扫码',
|
|
1162
1164
|
'settings.notifyTitle': '通知', 'settings.notifyDesc': '收到审批/提问时推送', 'settings.announcementHistoryTitle': '历史公告', 'settings.announcementHistoryDesc': '查看以前收到的公告', 'settings.announcementHistory': '查看记录',
|
|
1163
|
-
'settings.testNotifyTitle': '测试通知', 'settings.testNotifyDesc': '
|
|
1165
|
+
'settings.testApproval': '审批提醒', 'settings.testTurn': '本轮结束', 'settings.testError': '执行失败', 'settings.testNotifyTitle': '测试通知', 'settings.testNotifyDesc': 'Android 使用所选类型的实际通知渠道测试,不执行真实任务', 'settings.testNotify': '发送测试通知',
|
|
1164
1166
|
'settings.testNotifySent': '测试通知已排定,3 秒后到达', 'settings.testNotifyFailed': '发送测试通知失败:{msg}', 'settings.testNotifyUnavailable': '测试通知仅在 App 内可用',
|
|
1165
1167
|
'settings.peakRemindTitle': '峰谷计费提醒 · dsh-cost-meter', 'settings.peakRemindDesc': '按费用插件的峰谷窗口、节假日、提前量与提醒类型发送 Android 通知。无需保持 DSH 页面打开;请允许通知并将系统省电设为无限制。',
|
|
1166
1168
|
'peakRemind.enterPeak': '已进入高峰计费时段', 'peakRemind.enterOff': '已进入空闲计费时段',
|
|
@@ -1168,13 +1170,13 @@
|
|
|
1168
1170
|
'peakRemind.peak1418': '高峰 14:00-18:00', 'peakRemind.off1809': '空闲 18:00-次日 9:00',
|
|
1169
1171
|
'peakRemind.browserOnly': '峰谷提醒仅在 App 内有效',
|
|
1170
1172
|
'peakRemind.on': '峰谷提醒已开启', 'peakRemind.off': '峰谷提醒已关闭', 'peakRemind.failed': '峰谷提醒服务启动失败,请重试',
|
|
1171
|
-
'settings.bgTitle': '后台轮询', 'settings.bgDesc': '
|
|
1173
|
+
'settings.bgTitle': '后台轮询', 'settings.bgDesc': '退后台后由前台服务接收事件;系统省电与服务时限可能延迟提醒',
|
|
1172
1174
|
'settings.bgIntervalTitle': '轮询间隔', 'settings.bgIntervalDesc': '灭屏后系统可能拉长间隔(Doze 平台限制)',
|
|
1173
1175
|
'settings.bgInterval30s': '30 秒', 'settings.bgInterval1m': '1 分钟', 'settings.bgInterval5m': '5 分钟', 'settings.bgInterval15m': '15 分钟',
|
|
1174
1176
|
'settings.bgOn': '后台轮询已开启', 'settings.bgOff': '后台轮询已关闭',
|
|
1175
1177
|
'settings.bgNativeOnly': '后台轮询仅 Android App 内可用', 'settings.bgNeedToken': '请先设置访问令牌',
|
|
1176
1178
|
'settings.bgAuthFailed': '登录失效:连续 3 次 401,后台轮询已停止',
|
|
1177
|
-
'settings.taskDoneTitle': '任务结束通知', 'settings.taskDoneDesc': '
|
|
1179
|
+
'settings.lanDiscover': '搜索电脑', 'settings.taskDoneTitle': '任务结束通知', 'settings.taskDoneDesc': '分别提醒本轮结束、目标完成与执行失败,点击进入对应会话',
|
|
1178
1180
|
'bg.eventTitle': 'dsh-remote:{n} 条新事件', 'bg.eventText': '点击查看',
|
|
1179
1181
|
'presets.title': '预设提示词', 'presets.desc': '常用提示词,对话界面一键插入(最多 20 条)',
|
|
1180
1182
|
'presets.add': '新增', 'presets.edit': '编辑', 'presets.delete': '删除', 'presets.empty': '暂无预设',
|
|
@@ -1184,8 +1186,8 @@
|
|
|
1184
1186
|
'settings.toolsTitle': '显示工具调用', 'settings.toolsDesc': '关闭后隐藏 🔧/📦 工具调用与结果',
|
|
1185
1187
|
'settings.mobileEnterTitle': '手机回车行为', 'settings.mobileEnterDesc': '选择手机端按 Enter 时换行或直接发送', 'settings.mobileEnterNewline': '回车换行', 'settings.mobileEnterSend': '回车发送',
|
|
1186
1188
|
'settings.langTitle': '语言 / Language', 'settings.langDesc': '界面语言,跟随系统或手动切换',
|
|
1187
|
-
'settings.themeTitle': '皮肤', 'settings.themeDesc': '默认深空 / 落日 / 易北爱乐厅 / 草原孤塔 / 黑曜白 / 蓝色大肥鱼',
|
|
1188
|
-
'theme.default': '默认深空', 'theme.dark': '落日', 'theme.light': '易北爱乐厅', 'theme.neutral': '草原孤塔', 'theme.mono': '黑曜白', 'theme.fish': '蓝色大肥鱼',
|
|
1189
|
+
'settings.themeTitle': '皮肤', 'settings.themeDesc': '默认深空 / 落日 / 易北爱乐厅 / 草原孤塔 / 黑曜白 / 蓝色大肥鱼 / 企鹅女管·白昼 / 企鹅女管·极夜 / 波奇酱 / 伊地知虹夏 / 山田凉 / 喜多郁代',
|
|
1190
|
+
'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': '喜多郁代',
|
|
1189
1191
|
'theme.panelTitle': '选择配色', 'theme.close': '关闭',
|
|
1190
1192
|
'settings.tokenTitle': '访问令牌', 'settings.change': '更换',
|
|
1191
1193
|
'settings.unknown': '未知', 'settings.dshRecovering': '正在等待网关恢复并核验操作结果…',
|
|
@@ -1203,12 +1205,12 @@
|
|
|
1203
1205
|
'feedback.doctor': 'AI 排查问题', 'feedback.doctorDesc': '使用你的 DSH 和模型,只读诊断',
|
|
1204
1206
|
'feedback.biliDesc': 'UP 动态页交流', 'feedback.copyLink': '复制项目链接', 'feedback.copyDesc': '手动分享给朋友',
|
|
1205
1207
|
'feedback.copied': '项目链接已复制', 'feedback.copyFailed': '复制失败,请手动复制',
|
|
1206
|
-
'feedback.write': '写反馈', 'feedback.writeDesc': 'App 内直接提交', 'feedback.modalTitle': '写反馈', 'feedback.includeDiagnostics': '
|
|
1208
|
+
'feedback.write': '写反馈', 'feedback.writeDesc': 'App 内直接提交', 'feedback.modalTitle': '写反馈', 'feedback.includeDiagnostics': '附带客户端与网关诊断(可选)', 'feedback.diagnosticsPrivacy': '上传客户端操作与错误位置、存储占用、版本和网关链路状态;不含令牌、Cookie、对话正文、答案或完整路径。可在下方预览。', 'feedback.includeCrashes': '附带崩溃日志摘要(可选)', 'feedback.crashPrivacy': '默认仅在本机记录。勾选后上传最近 3 条退出、重启和错误位置摘要,不含对话、密钥或完整路径。', 'feedback.crashPreview': '查看拟上传的日志摘要', 'feedback.crashLoading': '读取本机日志…', 'feedback.crashUnavailable': '当前网关暂时无法读取日志,请更新网关或稍后重试。',
|
|
1207
1209
|
'feedback.typeBug': 'Bug', 'feedback.typeSuggestion': '建议', 'feedback.typeOther': '其他',
|
|
1208
|
-
'feedback.messagePlaceholder': '
|
|
1210
|
+
'feedback.messagePlaceholder': '请描述遇到的问题或建议(必填,最多 20000 字符)',
|
|
1209
1211
|
'feedback.contactPlaceholder': '联系方式(可选):邮箱 / 微信 / B站 ID',
|
|
1210
1212
|
'feedback.cancel': '取消', 'feedback.submit': '提交',
|
|
1211
|
-
'feedback.empty': '请填写描述内容', 'feedback.tooLong': '描述不能超过
|
|
1213
|
+
'feedback.empty': '请填写描述内容', 'feedback.tooLong': '描述不能超过 20000 字符,全文已保留',
|
|
1212
1214
|
'feedback.submitted': '已提交,感谢反馈',
|
|
1213
1215
|
'feedback.successTitle': '反馈发送成功', 'feedback.successBody': '服务器已确认收到这条反馈,感谢你的帮助。', 'feedback.successConfirm': '知道了',
|
|
1214
1216
|
'feedback.rateLimited': '提交太频繁,请稍后再试', 'feedback.rateLimitedAt': '提交太频繁,请 {n} 秒后再试', 'feedback.submitFailed': '提交失败:{msg}', 'feedback.networkError': '网络错误',
|
|
@@ -1425,7 +1427,7 @@
|
|
|
1425
1427
|
'settings.servers': 'Servers (one or more)', 'settings.speedTest': 'Test', 'settings.add': 'Add',
|
|
1426
1428
|
'settings.scanTitle': 'Scan to pair', 'settings.scanDesc': 'Use the live camera or photo/gallery QR decoding; no Google services required', 'settings.scan': 'Scan',
|
|
1427
1429
|
'settings.notifyTitle': 'Notifications', 'settings.notifyDesc': 'Push on approvals / questions', 'settings.announcementHistoryTitle': 'Announcement history', 'settings.announcementHistoryDesc': 'Review announcements you received before', 'settings.announcementHistory': 'View history',
|
|
1428
|
-
'settings.testNotifyTitle': 'Test notification', 'settings.testNotifyDesc': '
|
|
1430
|
+
'settings.testNotifyTitle': 'Test notification', 'settings.testNotifyDesc': 'Test the selected Android notification channel without running a task', 'settings.testNotify': 'Send test notification',
|
|
1429
1431
|
'settings.testNotifySent': 'Test notification scheduled, arriving in 3s', 'settings.testNotifyFailed': 'Failed to send test notification: {msg}', 'settings.testNotifyUnavailable': 'Test notification is only available in the app',
|
|
1430
1432
|
'settings.peakRemindTitle': 'Peak/off-peak reminders · dsh-cost-meter', 'settings.peakRemindDesc': 'Android notifications follow the plugin’s windows, holidays, lead time and reminder type. The DSH page can be closed. Allow notifications and unrestricted battery use.',
|
|
1431
1433
|
'peakRemind.enterPeak': 'Peak pricing period started', 'peakRemind.enterOff': 'Off-peak pricing period started',
|
|
@@ -1433,13 +1435,13 @@
|
|
|
1433
1435
|
'peakRemind.peak1418': 'Peak 14:00-18:00', 'peakRemind.off1809': 'Off-peak 18:00-9:00 next day',
|
|
1434
1436
|
'peakRemind.browserOnly': 'Peak reminders only work in the app',
|
|
1435
1437
|
'peakRemind.on': 'Peak reminders enabled', 'peakRemind.off': 'Peak reminders disabled', 'peakRemind.failed': 'Could not start peak reminder service; try again',
|
|
1436
|
-
'settings.bgTitle': 'Background polling', 'settings.bgDesc': 'A foreground service
|
|
1438
|
+
'settings.bgTitle': 'Background polling', 'settings.bgDesc': 'A foreground service receives background events; system power and service limits may delay alerts',
|
|
1437
1439
|
'settings.bgIntervalTitle': 'Polling interval', 'settings.bgIntervalDesc': 'Screen-off may stretch the interval (Doze platform limit)',
|
|
1438
1440
|
'settings.bgInterval30s': '30 seconds', 'settings.bgInterval1m': '1 minute', 'settings.bgInterval5m': '5 minutes', 'settings.bgInterval15m': '15 minutes',
|
|
1439
1441
|
'settings.bgOn': 'Background polling enabled', 'settings.bgOff': 'Background polling disabled',
|
|
1440
1442
|
'settings.bgNativeOnly': 'Background polling is only available in the Android app', 'settings.bgNeedToken': 'Set an access token first',
|
|
1441
1443
|
'settings.bgAuthFailed': 'Login expired: 3 consecutive 401s, background polling stopped',
|
|
1442
|
-
'settings.taskDoneTitle': 'Task
|
|
1444
|
+
'settings.lanDiscover': 'Find computer', 'settings.testApproval': 'Approval', 'settings.testTurn': 'Turn finished', 'settings.testError': 'Execution failed', 'settings.taskDoneTitle': 'Task result notifications', 'settings.taskDoneDesc': 'Separate turn, goal and failure alerts; tap to open the session',
|
|
1443
1445
|
'bg.eventTitle': 'dsh-remote: {n} new events', 'bg.eventText': 'Tap to view',
|
|
1444
1446
|
'presets.title': 'Prompt presets', 'presets.desc': 'Common prompts, insert into the composer in one tap (max 20)',
|
|
1445
1447
|
'presets.add': 'Add', 'presets.edit': 'Edit', 'presets.delete': 'Delete', 'presets.empty': 'No presets yet',
|
|
@@ -1449,8 +1451,8 @@
|
|
|
1449
1451
|
'settings.toolsTitle': 'Show tool calls', 'settings.toolsDesc': 'Hide 🔧/📦 tool calls and results when off',
|
|
1450
1452
|
'settings.mobileEnterTitle': 'Mobile Enter behavior', 'settings.mobileEnterDesc': 'Choose whether Enter inserts a newline or sends', 'settings.mobileEnterNewline': 'Enter = newline', 'settings.mobileEnterSend': 'Enter = send',
|
|
1451
1453
|
'settings.langTitle': 'Language / 语言', 'settings.langDesc': 'UI language, follows system or switch manually',
|
|
1452
|
-
'settings.themeTitle': 'Theme', 'settings.themeDesc': 'Deep Space / Sunset / Elbphilharmonie / Prairie Tower / Monochrome / Blue Fat Fish',
|
|
1453
|
-
'theme.default': 'Default', 'theme.dark': 'Sunset', 'theme.light': 'Elbphilharmonie', 'theme.neutral': 'Prairie Tower', 'theme.mono': 'Monochrome', 'theme.fish': 'Blue Fat Fish',
|
|
1454
|
+
'settings.themeTitle': 'Theme', 'settings.themeDesc': 'Deep Space / Sunset / Elbphilharmonie / Prairie Tower / Monochrome / Blue Fat Fish / Penguin Admin Day / Penguin Admin Night / Bocchi / Nijika / Ryo / Kita',
|
|
1455
|
+
'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',
|
|
1454
1456
|
'theme.panelTitle': 'Choose theme', 'theme.close': 'Close',
|
|
1455
1457
|
'settings.tokenTitle': 'Access token', 'settings.change': 'Change',
|
|
1456
1458
|
'settings.unknown': 'Unknown', 'settings.dshRecovering': 'Waiting for the gateway and verifying the operation…',
|
|
@@ -1468,12 +1470,12 @@
|
|
|
1468
1470
|
'feedback.doctor': 'AI diagnosis', 'feedback.doctorDesc': 'Read-only diagnosis with your own DSH and model',
|
|
1469
1471
|
'feedback.biliDesc': 'Chat on the UP\'s Bilibili page', 'feedback.copyLink': 'Copy project link', 'feedback.copyDesc': 'Share it manually',
|
|
1470
1472
|
'feedback.copied': 'Project link copied', 'feedback.copyFailed': 'Copy failed, copy manually',
|
|
1471
|
-
'feedback.write': 'Write feedback', 'feedback.writeDesc': 'Submit from the app', 'feedback.modalTitle': 'Write feedback', 'feedback.includeDiagnostics': 'Include
|
|
1473
|
+
'feedback.write': 'Write feedback', 'feedback.writeDesc': 'Submit from the app', 'feedback.modalTitle': 'Write feedback', 'feedback.includeDiagnostics': 'Include client and gateway diagnostics (optional)', 'feedback.diagnosticsPrivacy': 'Uploads operation stages, error locations, storage sizes, versions and gateway status. No credentials, conversation bodies, answers or full paths. Preview below.', 'feedback.includeCrashes': 'Include crash summary (optional)', 'feedback.crashPrivacy': 'Recorded locally by default. Opt in to upload up to 3 recent exit, restart and error-location records. No conversations, credentials or full paths.', 'feedback.crashPreview': 'Preview the log summary to upload', 'feedback.crashLoading': 'Reading local logs…', 'feedback.crashUnavailable': 'Logs are unavailable. Update the gateway or try again later.',
|
|
1472
1474
|
'feedback.typeBug': 'Bug', 'feedback.typeSuggestion': 'Suggestion', 'feedback.typeOther': 'Other',
|
|
1473
|
-
'feedback.messagePlaceholder': 'Describe the bug or suggestion (required,
|
|
1475
|
+
'feedback.messagePlaceholder': 'Describe the bug or suggestion (required, up to 20000 characters)',
|
|
1474
1476
|
'feedback.contactPlaceholder': 'Contact (optional): email / WeChat / Bilibili ID',
|
|
1475
1477
|
'feedback.cancel': 'Cancel', 'feedback.submit': 'Submit',
|
|
1476
|
-
'feedback.empty': 'Please fill in the description', 'feedback.tooLong': 'Description must be
|
|
1478
|
+
'feedback.empty': 'Please fill in the description', 'feedback.tooLong': 'Description must be within 20000 characters; your text is preserved',
|
|
1477
1479
|
'feedback.submitted': 'Submitted — thanks!',
|
|
1478
1480
|
'feedback.successTitle': 'Feedback sent', 'feedback.successBody': 'The server confirmed receipt of your feedback. Thank you for helping improve DSH Remote.', 'feedback.successConfirm': 'Got it',
|
|
1479
1481
|
'feedback.rateLimited': 'Too frequent, try again later', 'feedback.rateLimitedAt': 'Too frequent, try again in {n}s', 'feedback.submitFailed': 'Submit failed: {msg}', 'feedback.networkError': 'Network error',
|
|
@@ -1514,6 +1516,8 @@
|
|
|
1514
1516
|
<script src="announcement-forms.js"></script>
|
|
1515
1517
|
<script src="activity.js"></script>
|
|
1516
1518
|
<script src="turn-results.js"></script>
|
|
1519
|
+
<script src="image-cache.js"></script>
|
|
1520
|
+
<script src="chat-copy.js"></script>
|
|
1517
1521
|
<script src="image-preview.js"></script>
|
|
1518
1522
|
<script src="link-check.js"></script>
|
|
1519
1523
|
<script src="network.js"></script>
|
|
@@ -1530,6 +1534,7 @@
|
|
|
1530
1534
|
<script src="file-inbox.js"></script>
|
|
1531
1535
|
<link rel="stylesheet" href="session-deck.css">
|
|
1532
1536
|
<script src="session-deck.js"></script>
|
|
1537
|
+
<script src="lan-discovery.js"></script>
|
|
1533
1538
|
<script src="app.js"></script>
|
|
1534
1539
|
</body>
|
|
1535
1540
|
</html>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* Android system bridge; browsers keep the existing QR/manual connection paths. */
|
|
2
|
+
;(function(root) {
|
|
3
|
+
'use strict'
|
|
4
|
+
root.DshLanDiscovery = { mount(button, paired) {
|
|
5
|
+
const bridge = root.NativeLan
|
|
6
|
+
if (!button || !bridge?.search) return
|
|
7
|
+
button.classList.remove('hidden')
|
|
8
|
+
const en = () => root.I18N?.lang === 'en'
|
|
9
|
+
const text = (zh, english) => en() ? english : zh
|
|
10
|
+
let modal, timer, selected = '', hosts = [], signature = '', busy = false, open = false
|
|
11
|
+
function status(value) { modal.querySelector('[data-lan-status]').textContent = value }
|
|
12
|
+
function close() {
|
|
13
|
+
open = false; clearTimeout(timer); bridge.cancel(); modal?.remove(); modal = null
|
|
14
|
+
button.focus()
|
|
15
|
+
}
|
|
16
|
+
function search() {
|
|
17
|
+
selected = ''; signature = ''; hosts = []; busy = false
|
|
18
|
+
modal.querySelector('[data-lan-pair]').classList.add('hidden')
|
|
19
|
+
modal.querySelector('[data-lan-list]').replaceChildren()
|
|
20
|
+
status(text('正在搜索同一 Wi-Fi 下开放配对的电脑…', 'Searching for computers accepting pairing on this Wi-Fi…'))
|
|
21
|
+
bridge.search()
|
|
22
|
+
clearTimeout(timer); tick()
|
|
23
|
+
}
|
|
24
|
+
function tick() {
|
|
25
|
+
if (!open || !modal) return
|
|
26
|
+
try {
|
|
27
|
+
const state = JSON.parse(bridge.getState() || '{}')
|
|
28
|
+
busy = state.phase === 'pairing'
|
|
29
|
+
modal.querySelector('[data-lan-search]').disabled = busy
|
|
30
|
+
modal.querySelector('[data-lan-connect]').disabled = busy
|
|
31
|
+
modal.querySelector('[data-lan-code]').disabled = busy
|
|
32
|
+
const entries = Array.isArray(state.hosts) ? state.hosts.slice(0, 32) : []
|
|
33
|
+
const next = JSON.stringify(entries)
|
|
34
|
+
if (next !== signature) {
|
|
35
|
+
signature = next; hosts = entries
|
|
36
|
+
const list = modal.querySelector('[data-lan-list]'); list.replaceChildren()
|
|
37
|
+
for (const host of hosts) {
|
|
38
|
+
const entry = document.createElement('button'); entry.type = 'button'; entry.className = 'btn subtle'
|
|
39
|
+
entry.textContent = String(host.name || 'DSH Remote') + ' · ' + String(host.server || '')
|
|
40
|
+
entry.addEventListener('click', () => {
|
|
41
|
+
if (busy) return
|
|
42
|
+
selected = host.id
|
|
43
|
+
modal.querySelector('[data-lan-selected]').textContent = String(host.name || host.server)
|
|
44
|
+
modal.querySelector('[data-lan-pair]').classList.remove('hidden')
|
|
45
|
+
modal.querySelector('[data-lan-code]').focus()
|
|
46
|
+
}); list.append(entry)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (state.phase === 'paired') {
|
|
50
|
+
const result = JSON.parse(bridge.takePairResult() || '{}')
|
|
51
|
+
if (!hosts.some(host => host.server === result.server) || typeof result.token !== 'string') throw Error('PAIRING_RESPONSE_INVALID')
|
|
52
|
+
// Close before applying credentials, so no stale poll can apply them a second time.
|
|
53
|
+
close(); paired(result); return
|
|
54
|
+
}
|
|
55
|
+
if (state.phase === 'pairing') status(text('正在验证配对码并连接…', 'Verifying the pairing code…'))
|
|
56
|
+
else if (state.phase === 'done') status(hosts.length ? text('请选择电脑并输入配对码。', 'Select a computer and enter its pairing code.')
|
|
57
|
+
: text('没有找到电脑。请在电脑端开启局域网配对,确认同一 Wi-Fi;也可继续扫码或手动连接。', 'No computers found. Open LAN pairing on the computer and check Wi-Fi, or use QR/manual connection.'))
|
|
58
|
+
else if (state.phase === 'error') {
|
|
59
|
+
const errors = {
|
|
60
|
+
WIFI_REQUIRED: text('请先连接 Wi-Fi。', 'Connect to Wi-Fi first.'),
|
|
61
|
+
NETWORK_PERMISSION_REQUIRED: text('请检查系统网络访问权限。', 'Check system network permissions.'),
|
|
62
|
+
PAIRING_CODE_INVALID: text('配对码不匹配,请核对电脑端显示的配对码。', 'Pairing code does not match the computer.'),
|
|
63
|
+
PAIRING_CLOSED: text('配对已关闭或过期,请在电脑端重新开启。', 'Pairing expired or closed. Reopen it on the computer.'),
|
|
64
|
+
}
|
|
65
|
+
status(errors[state.error] || text('搜索或配对失败,请检查网络后重试;也可扫码连接。', 'Search or pairing failed. Check the network or use QR pairing.'))
|
|
66
|
+
}
|
|
67
|
+
} catch { if (modal) status(text('无法读取搜索状态,请重新搜索。', 'Unable to read discovery status. Search again.')) }
|
|
68
|
+
timer = setTimeout(tick, 300)
|
|
69
|
+
}
|
|
70
|
+
button.addEventListener('click', () => {
|
|
71
|
+
if (open) return
|
|
72
|
+
open = true
|
|
73
|
+
modal = document.createElement('div'); modal.className = 'modal'; modal.setAttribute('role', 'dialog'); modal.setAttribute('aria-modal', 'true')
|
|
74
|
+
modal.innerHTML = '<div class="modal-card lan-discovery-card"><div class="modal-title" data-lan-title></div><p data-lan-status role="status" aria-live="polite"></p><div data-lan-list class="lan-host-list"></div><div data-lan-pair class="hidden"><p data-lan-selected></p><label><span data-lan-label></span><input data-lan-code type="password" maxlength="24" autocomplete="off" spellcheck="false" placeholder="XXXX-XXXX-XXXX-XXXX-XXXX"></label><button data-lan-connect class="btn primary" type="button"></button></div><div class="modal-actions"><button data-lan-search class="btn subtle" type="button"></button><button data-lan-close class="btn subtle" type="button"></button></div></div>'
|
|
75
|
+
modal.querySelector('[data-lan-title]').textContent = text('搜索局域网电脑', 'Find a computer on Wi-Fi')
|
|
76
|
+
modal.querySelector('[data-lan-label]').textContent = text('电脑端显示的限时配对码', 'One-time code shown on the computer')
|
|
77
|
+
modal.querySelector('[data-lan-connect]').textContent = text('配对连接', 'Pair and connect')
|
|
78
|
+
modal.querySelector('[data-lan-search]').textContent = text('重新搜索', 'Search again')
|
|
79
|
+
modal.querySelector('[data-lan-close]').textContent = text('关闭', 'Close')
|
|
80
|
+
modal.querySelector('[data-lan-close]').addEventListener('click', close)
|
|
81
|
+
modal.querySelector('[data-lan-search]').addEventListener('click', search)
|
|
82
|
+
modal.querySelector('[data-lan-connect]').addEventListener('click', () => {
|
|
83
|
+
if (busy) return
|
|
84
|
+
const input = modal.querySelector('[data-lan-code]'), code = input.value
|
|
85
|
+
if (!selected || !/^[a-f0-9]{20}$/i.test(code.replace(/[\s-]/g, ''))) return status(text('请选择电脑,输入完整的 20 位配对码。', 'Select a computer and enter the full 20-character code.'))
|
|
86
|
+
if (!bridge.pair(selected, code)) return status(text('无法开始配对,请重新搜索后重试。', 'Could not start pairing. Search again.'))
|
|
87
|
+
input.value = ''; busy = true; clearTimeout(timer); tick()
|
|
88
|
+
})
|
|
89
|
+
modal.addEventListener('keydown', event => { if (event.key === 'Escape') { event.preventDefault(); close() } })
|
|
90
|
+
document.body.append(modal); modal.querySelector('[data-lan-search]').focus(); search()
|
|
91
|
+
})
|
|
92
|
+
document.addEventListener('visibilitychange', () => { if (document.hidden && open) close() })
|
|
93
|
+
} }
|
|
94
|
+
})(typeof window === 'object' ? window : globalThis)
|
package/public/md.js
CHANGED
|
@@ -267,6 +267,10 @@
|
|
|
267
267
|
return html
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
+
function codeHtml(code, options) {
|
|
271
|
+
var pre = '<pre><code>' + escapeHtml(code) + '</code></pre>'
|
|
272
|
+
return options?.copyCode ? '<div class="chat-code"><button type="button" class="chat-copy-button" data-chat-copy-code>' + escapeHtml(options.copyCodeLabel || '复制代码') + '</button>' + pre + '</div>' : pre
|
|
273
|
+
}
|
|
270
274
|
function mdToHtml(text, options) {
|
|
271
275
|
if (options?.imageLabel) imageLabel = String(options.imageLabel)
|
|
272
276
|
var raw = String(text == null ? '' : text).replace(/\r\n?/g, '\n')
|
|
@@ -286,11 +290,13 @@
|
|
|
286
290
|
out += genui.render(JSON.parse(fence[2])); continue
|
|
287
291
|
}
|
|
288
292
|
if (language === 'html' || language === 'htm') {
|
|
289
|
-
out += genui.html(fence[2]) + '<details><summary>HTML / 源码</summary
|
|
293
|
+
out += genui.html(fence[2]) + '<details><summary>HTML / 源码</summary>' + codeHtml(fence[2], options) + '</details>'; continue
|
|
290
294
|
}
|
|
291
295
|
} catch (_) { /* Invalid or over-budget specs remain source, never execute. */ }
|
|
292
296
|
}
|
|
293
|
-
|
|
297
|
+
// A language header belongs to the fence, not to the copied source.
|
|
298
|
+
var content = options?.copyCode && /^[a-zA-Z0-9_+.-]{1,40}[ \t]*\n/.test(parts[i]) && fence ? fence[2] : code
|
|
299
|
+
out += codeHtml(content, options)
|
|
294
300
|
} else {
|
|
295
301
|
var escaped = escapeHtml(parts[i])
|
|
296
302
|
out += renderLines(escaped.split('\n').map(function (line) {
|
package/public/plugin-center.js
CHANGED
|
@@ -61,7 +61,7 @@ window.DshPluginCenter = (() => {
|
|
|
61
61
|
const current = generation
|
|
62
62
|
const response = await fetch(connection.url('/remote/api/plugins' + path), {
|
|
63
63
|
method: body ? 'POST' : 'GET', headers: { ...connection.headers, 'content-type': 'application/json' },
|
|
64
|
-
...(body ? { body: JSON.stringify(body) } : {}), signal: AbortSignal.timeout(30000),
|
|
64
|
+
...(body ? { body: JSON.stringify(body) } : {}), signal: AbortSignal.timeout(path === '/preflight' ? 130000 : 30000),
|
|
65
65
|
})
|
|
66
66
|
if (current !== generation || !dialog.open || !connection.valid()) throw new Error('连接已切换,请重新打开插件中心')
|
|
67
67
|
let data
|
package/public/plugin.html
CHANGED
|
@@ -4,14 +4,20 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
6
|
<title>DSH Remote</title>
|
|
7
|
-
<script>(function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
7
|
+
<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='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
8
8
|
<link rel="stylesheet" href="theme-vars.css">
|
|
9
9
|
<link rel="stylesheet" href="setup.css">
|
|
10
10
|
<link rel="stylesheet" href="insights.css">
|
|
11
11
|
<link rel="stylesheet" href="remote-ui.css">
|
|
12
12
|
<link rel="stylesheet" href="doctor.css">
|
|
13
13
|
<link rel="stylesheet" href="skins/blue-fish/skin.css">
|
|
14
|
-
<
|
|
14
|
+
<link rel="stylesheet" href="skins/penguin/skin.css">
|
|
15
|
+
<link rel="stylesheet" href="skins/bocchi/skin.css">
|
|
16
|
+
<link rel="stylesheet" href="skins/kessoku/skin.css">
|
|
17
|
+
<link rel="stylesheet" href="skins/nijika/skin.css">
|
|
18
|
+
<link rel="stylesheet" href="skins/ryo/skin.css">
|
|
19
|
+
<link rel="stylesheet" href="skins/kita/skin.css">
|
|
20
|
+
<style>html[data-theme="light"],html[data-theme="neutral"],html[data-theme="fish"],html[data-theme="penguin"],html[data-theme="bocchi"],html[data-theme="nijika"],html[data-theme="ryo"],html[data-theme="kita"]{color-scheme:light}</style>
|
|
15
21
|
</head>
|
|
16
22
|
<body class="remote-panel-body">
|
|
17
23
|
<main class="plugin-shell" data-motion-view>
|
package/public/relay-settings.js
CHANGED
|
@@ -43,19 +43,20 @@
|
|
|
43
43
|
intro.textContent=text('让手机通过公网连接这台主机。每位用户使用自己的中转密钥,首次开通会绑定此主机。','Connect to this host over the internet. Your personal relay key binds to this host when activated.')
|
|
44
44
|
const phase=value?.phase||(readError?'unavailable':loading?'loading':'unconfigured')
|
|
45
45
|
const names={loading:['正在读取','Loading'],unavailable:['状态读取失败','Status unavailable'],unconfigured:['尚未开通','Not configured'],disabled:['已停用','Disabled'],connecting:['正在连接','Connecting'],online:['已连接','Connected'],reconnecting:['正在重连','Reconnecting'],expired:['授权已到期','Expired'],'authorization-inactive':['授权已撤销或到期','Authorization inactive'],'quota-exceeded':['今日流量已用完','Daily quota reached'],'quota-unavailable':['流量服务暂不可用','Quota service unavailable'],error:['连接异常','Connection error']}
|
|
46
|
-
badge.textContent=text(...(names[phase]||names.error));badge.dataset.phase=phase
|
|
46
|
+
badge.textContent=phase==='quota-exceeded'&&value?.daily?.period==='month'?text('本月流量已用完','Monthly quota reached'):text(...(names[phase]||names.error));badge.dataset.phase=phase
|
|
47
47
|
status.textContent=busy?text('正在保存并绑定,请稍候…','Saving and binding…'):value?.error?text('请检查主机配置或刷新状态。','Check the host configuration or refresh.'):text('开通后会随 Remote 网关启动,无需单独运行工具。','Starts with the Remote gateway after activation.')
|
|
48
48
|
let safeUrl=''
|
|
49
49
|
try { const url=new URL(value?.publicUrl);if(url.protocol==='https:'&&!url.username&&!url.password)safeUrl=url.origin } catch {}
|
|
50
50
|
address.hidden=!safeUrl;link.textContent=safeUrl;link.href=safeUrl||'#';copy.textContent=text('复制地址','Copy URL')
|
|
51
51
|
const daily=value?.daily
|
|
52
52
|
quota.hidden=!daily
|
|
53
|
-
if(daily?.unavailable){usage.textContent=text('
|
|
53
|
+
if(daily?.unavailable){usage.textContent=text('无法确认流量额度,云端暂停传输。','Quota unavailable; cloud transfer is paused.');meter.hidden=true;reset.textContent=''}
|
|
54
54
|
else if(daily){
|
|
55
55
|
meter.hidden=false;meter.value=Math.min(100,Math.max(0,Number(daily.usedBytes)/Number(daily.limitBytes)*100))
|
|
56
56
|
const gb=bytes=>(Math.max(0,Number(bytes)||0)/1e9).toFixed(2)
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const monthly=daily.period==='month'
|
|
58
|
+
usage.textContent=text(`${monthly?'本月':'今日'}已用 ${gb(daily.usedBytes)} / ${gb(daily.limitBytes)} GB · 剩余 ${gb(daily.remainingBytes)} GB`,`${monthly?'This month':'Today'} ${gb(daily.usedBytes)} / ${gb(daily.limitBytes)} GB · ${gb(daily.remainingBytes)} GB left`)
|
|
59
|
+
reset.textContent=monthly?text('上传与下载及对话图片合计;额度覆盖本次开通的服务月,不包含文件传输。','Uploads, downloads and chat images share this service month quota; file transfer is excluded.'):text('上传与下载合计;北京时间每天 00:00 重置。','Uploads + downloads; resets daily at 00:00 Beijing time.')
|
|
59
60
|
}
|
|
60
61
|
const expires=value?.expiresAt?new Date(value.expiresAt).toLocaleString():''
|
|
61
62
|
binding.textContent=value?.fingerprint?text(`已绑定此主机 · ${value.fingerprint.slice(0,12)}${expires?' · 有效期至 '+expires:''}`,`Bound to this host · ${value.fingerprint.slice(0,12)}${expires?' · Until '+expires:''}`):''
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
toggle.hidden=!value?.configured;toggle.disabled=busy;toggle.textContent=text(value?.enabled?'停用中转':'开启中转',value?.enabled?'Disable relay':'Enable relay')
|
|
70
71
|
refresh.textContent=text('刷新状态','Refresh');refresh.disabled=busy||loading
|
|
71
72
|
takeover.hidden=!value?.legacyAvailable;takeover.disabled=busy;takeover.textContent=text('接管已有试用连接','Take over existing trial')
|
|
72
|
-
hint.textContent=value?.quotaPending?text('
|
|
73
|
+
hint.textContent=value?.quotaPending?text('等待云端确认流量额度…','Waiting for cloud quota…'):text('手机使用此公网地址和原 Remote 访问令牌。停用会断开通过此入口的连接;授权到期或用满后,请通过本地地址管理。','Use this URL and your existing Remote access token. Disabling disconnects this route; use a local address after expiry or quota exhaustion.')
|
|
73
74
|
}
|
|
74
75
|
async function load(force=false) {
|
|
75
76
|
const ctx=syncIdentity()
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
let data
|
|
85
86
|
try{data=await response.json()}catch{throw Object.assign(Error('INVALID_RESPONSE'),{code:'INVALID_RESPONSE',status:response.status})}
|
|
86
87
|
if(!current(ctx))return
|
|
87
|
-
if(response.status===429&&data.daily){value={phase:'quota-exceeded',daily:data.daily,configured:false};notice.textContent=text('今日额度已用完。请用主机本地地址进入设置,或等待零点恢复。','Daily quota reached. Use the local host address or wait until reset.');return}
|
|
88
|
+
if(response.status===429&&data.daily){value={phase:'quota-exceeded',daily:data.daily,configured:false};notice.textContent=data.daily.period==='month'?text('本月额度已用完。请用主机本地地址管理;续期需在当前资格到期后重新申请。','Monthly quota reached. Manage through the local host; apply again after expiry.'):text('今日额度已用完。请用主机本地地址进入设置,或等待零点恢复。','Daily quota reached. Use the local host address or wait until reset.');return}
|
|
88
89
|
if(!response.ok)throw Object.assign(Error(data.error||'HTTP_'+response.status),{code:data.error,status:response.status})
|
|
89
90
|
if(data.supported!==true)throw Object.assign(Error('UNSUPPORTED_GATEWAY'),{code:'UNSUPPORTED_GATEWAY'})
|
|
90
91
|
value=data;notice.textContent='';readError=false;failures=0
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 蓝色大肥鱼:晴空海湾
|
|
2
|
+
|
|
3
|
+
保留原有鲸鱼娘立绘、表情与深海蓝主色,使用海浪留白、蓝白内容卡和表情导航,并补充爱心、星星、气泡与贴纸边框。角色图片沿用原文件,没有重新绘制五官。
|
|
4
|
+
|
|
5
|
+
## 视觉结构
|
|
6
|
+
|
|
7
|
+
- 晴空浅蓝纸面:根元素绘制柔和环境色,独立背景伪元素绘制海浪轮廓、淡表情底纹,以及 `sparkles.svg` 中的气泡、星星和爱心;装饰主要出现在留白处。
|
|
8
|
+
- 角色:品牌头像、标题左侧星星眼、标题右侧全身图、助手头像、侧栏与空状态。取消每条会话和每个分组反复叠加头像。
|
|
9
|
+
- 内容:会话列表和助手回复使用稳定白卡。诊断与工作区选择是中性入口,新会话使用实色深海蓝。
|
|
10
|
+
- 导航:会话、文件、更多分别使用默认脸、眨眼、星星眼;图片在原有图标位内,保留标签、未读徽标和点击区。
|
|
11
|
+
- 可爱点缀:立绘圆形贴纸框、选中导航的粉色小圆垫、新会话按钮的眨眼贴纸、第一张会话卡的小睡脸,以及桌面侧栏虚线贴纸框。它们不代表额外功能或状态。
|
|
12
|
+
- 动态:不持续上下摆动,不用动画争夺阅读注意力。
|
|
13
|
+
|
|
14
|
+
## 维护约定
|
|
15
|
+
|
|
16
|
+
`public/theme-vars.css` 仍负责语义配色;本目录的 `skin.css` 只匹配 `fish`,声明局部 `--fish-*` 表面与图片参数。不要修改其他角色的变量或选择器。
|
|
17
|
+
|
|
18
|
+
标题立绘挂在标题的伪元素上,标题预留右侧空间,不能再放回整个 `.workflow-start` 上压住连接条。手机 320/390px 和 English 标题需要分别检查。
|
|
19
|
+
|
|
20
|
+
导航、顶栏、输入区的定位由共用布局负责。不要覆盖它们的 position/top/bottom/transform,不对全页加 transform/filter。背景和装饰均不能拦截点击。
|
|
21
|
+
|
|
22
|
+
滑动归档消费既有 `--swipe-x` 与 `.revealed`;卡片有 1px 边框,收起位移包含 1px 补偿。检查关闭 0px、半滑、完整展开和确认框;不得只验静态预览。
|
|
23
|
+
|
|
24
|
+
`preview.html` 是不连接主机的静态组件样板,复用实际样式。改动后执行 `npm run sync-plugin`、主题专项与仓库检查,并以实际 WebUI 验收。
|