dsh-remote-plugin 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apk/dsh-remote.apk +0 -0
- package/gateway.cjs +58 -8
- package/package.json +1 -1
- package/public/activity.js +45 -7
- package/public/admin.html +31 -31
- package/public/announcements.json +36 -0
- package/public/app.js +370 -62
- package/public/build.json +2 -2
- package/public/desktop/desktop.html +82 -80
- package/public/desktop/desktop.js +95 -6
- package/public/e2ee-config.js +5 -0
- package/public/e2ee-transport.js +23 -4
- package/public/history.js +114 -17
- package/public/index.html +88 -86
- package/public/plan-review.js +23 -2
- package/public/plugin.html +27 -27
- package/public/relay-autopair.js +5 -0
- package/public/relay-devices.js +7 -3
- package/public/relay-settings.js +32 -12
- package/public/session-cache.js +85 -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/preview.html +5 -5
- 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/update.json +8 -8
- package/public/version.json +1 -1
- package/public/workflow.css +3 -3
package/public/build.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
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="bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
7
|
<title>DSH Remote · 桌面</title>
|
|
8
8
|
<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>
|
|
9
|
-
<link rel="stylesheet" href="../theme-vars.css?dsr-build=
|
|
10
|
-
<link rel="stylesheet" href="desktop.css?dsr-build=
|
|
11
|
-
<link rel="stylesheet" href="../slash-suggestions.css?dsr-build=
|
|
12
|
-
<link rel="stylesheet" href="../plugin-center.css?dsr-build=
|
|
13
|
-
<link rel="stylesheet" href="../skills.css?dsr-build=
|
|
14
|
-
<link rel="stylesheet" href="../doctor.css?dsr-build=
|
|
15
|
-
<link rel="stylesheet" href="../extensions.css?dsr-build=
|
|
16
|
-
<link rel="stylesheet" href="../insights.css?dsr-build=
|
|
17
|
-
<link rel="stylesheet" href="../workflow.css?dsr-build=
|
|
18
|
-
<link rel="stylesheet" href="../relay-settings.css?dsr-build=
|
|
19
|
-
<link rel="stylesheet" href="../subagents.css?dsr-build=
|
|
20
|
-
<link rel="stylesheet" href="../skins/blue-fish/skin.css?dsr-build=
|
|
21
|
-
<link rel="stylesheet" href="../skins/penguin/skin.css?dsr-build=
|
|
22
|
-
<link rel="stylesheet" href="../skins/bocchi/skin.css?dsr-build=
|
|
23
|
-
<link rel="stylesheet" href="../skins/kessoku/skin.css?dsr-build=
|
|
24
|
-
<link rel="stylesheet" href="../skins/nijika/skin.css?dsr-build=
|
|
25
|
-
<link rel="stylesheet" href="../skins/ryo/skin.css?dsr-build=
|
|
26
|
-
<link rel="stylesheet" href="../skins/kita/skin.css?dsr-build=
|
|
27
|
-
<link rel="stylesheet" href="../skins/penguin-logistics/skin.css?dsr-build=
|
|
28
|
-
<link rel="stylesheet" href="../skins/miku/skin.css?dsr-build=
|
|
29
|
-
<link rel="stylesheet" href="../theme-picker.css?dsr-build=
|
|
30
|
-
<link rel="stylesheet" href="../host-state.css?dsr-build=
|
|
9
|
+
<link rel="stylesheet" href="../theme-vars.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
10
|
+
<link rel="stylesheet" href="desktop.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
11
|
+
<link rel="stylesheet" href="../slash-suggestions.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
12
|
+
<link rel="stylesheet" href="../plugin-center.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
13
|
+
<link rel="stylesheet" href="../skills.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
14
|
+
<link rel="stylesheet" href="../doctor.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
15
|
+
<link rel="stylesheet" href="../extensions.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
16
|
+
<link rel="stylesheet" href="../insights.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
17
|
+
<link rel="stylesheet" href="../workflow.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
18
|
+
<link rel="stylesheet" href="../relay-settings.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
19
|
+
<link rel="stylesheet" href="../subagents.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
20
|
+
<link rel="stylesheet" href="../skins/blue-fish/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
21
|
+
<link rel="stylesheet" href="../skins/penguin/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
22
|
+
<link rel="stylesheet" href="../skins/bocchi/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
23
|
+
<link rel="stylesheet" href="../skins/kessoku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
24
|
+
<link rel="stylesheet" href="../skins/nijika/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
25
|
+
<link rel="stylesheet" href="../skins/ryo/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
26
|
+
<link rel="stylesheet" href="../skins/kita/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
27
|
+
<link rel="stylesheet" href="../skins/penguin-logistics/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
28
|
+
<link rel="stylesheet" href="../skins/miku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
29
|
+
<link rel="stylesheet" href="../theme-picker.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
30
|
+
<link rel="stylesheet" href="../host-state.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
31
31
|
</head>
|
|
32
32
|
<body>
|
|
33
33
|
<div class="ds-app" id="ds-app">
|
|
@@ -838,62 +838,64 @@
|
|
|
838
838
|
</div>
|
|
839
839
|
<div class="image-lightbox-hint" data-image-lightbox-hint>双击放大 · 点空白处关闭</div>
|
|
840
840
|
</div>
|
|
841
|
-
<script src="i18n.js?dsr-build=
|
|
842
|
-
<link rel="stylesheet" href="../genui.css?dsr-build=
|
|
843
|
-
<script src="../genui.js?dsr-build=
|
|
844
|
-
<script src="../chat-files.js?dsr-build=
|
|
845
|
-
<script src="../md.js?dsr-build=
|
|
846
|
-
<script src="../vendor/gsap/gsap.min.js?dsr-build=
|
|
847
|
-
<script src="../motion.js?dsr-build=
|
|
848
|
-
<script type="module" src="../morphicons-init.js?dsr-build=
|
|
849
|
-
<script src="../plugin-center.js?dsr-build=
|
|
850
|
-
<script src="../skills.js?dsr-build=
|
|
851
|
-
<script src="../insights.js?dsr-build=
|
|
852
|
-
<script src="../teams.js?dsr-build=
|
|
853
|
-
<script src="../task-board.js?dsr-build=
|
|
854
|
-
<script src="../extensions.js?dsr-build=
|
|
855
|
-
<script src="../sha256.js?dsr-build=
|
|
856
|
-
<script src="../diagnostics.js?dsr-build=
|
|
857
|
-
<script src="../doctor.js?dsr-build=
|
|
858
|
-
<script src="../history.js?dsr-build=
|
|
859
|
-
<script src="../
|
|
860
|
-
<script src="../
|
|
861
|
-
<script src="../
|
|
862
|
-
<script src="../
|
|
863
|
-
<script src="../
|
|
864
|
-
<script src="../
|
|
865
|
-
<script src="../
|
|
866
|
-
<script src="../
|
|
867
|
-
<script src="../
|
|
868
|
-
<script src="../host-
|
|
869
|
-
<script src="../
|
|
870
|
-
<script src="../
|
|
871
|
-
<script src="../
|
|
872
|
-
<script src="../
|
|
873
|
-
<script src="../
|
|
874
|
-
<script src="../
|
|
875
|
-
<script src="../
|
|
876
|
-
<script src="../
|
|
877
|
-
<script src="../
|
|
878
|
-
<script src="../
|
|
879
|
-
<
|
|
880
|
-
<script src="../
|
|
881
|
-
<link rel="stylesheet" href="../
|
|
882
|
-
<script src="../
|
|
883
|
-
<link rel="stylesheet" href="../
|
|
884
|
-
<
|
|
885
|
-
<link rel="stylesheet" href="../
|
|
886
|
-
<link rel="stylesheet" href="../
|
|
887
|
-
<link rel="stylesheet" href="../
|
|
888
|
-
<link rel="stylesheet" href="../
|
|
889
|
-
<
|
|
890
|
-
<
|
|
891
|
-
<script src="../
|
|
892
|
-
<script src="../
|
|
893
|
-
<script src="../
|
|
894
|
-
<script src="../
|
|
895
|
-
<script src="../
|
|
896
|
-
<script src="../
|
|
897
|
-
<script src="
|
|
841
|
+
<script src="i18n.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
842
|
+
<link rel="stylesheet" href="../genui.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
843
|
+
<script src="../genui.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
844
|
+
<script src="../chat-files.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
845
|
+
<script src="../md.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
846
|
+
<script src="../vendor/gsap/gsap.min.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
847
|
+
<script src="../motion.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
848
|
+
<script type="module" src="../morphicons-init.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
849
|
+
<script src="../plugin-center.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
850
|
+
<script src="../skills.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
851
|
+
<script src="../insights.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
852
|
+
<script src="../teams.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
853
|
+
<script src="../task-board.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
854
|
+
<script src="../extensions.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
855
|
+
<script src="../sha256.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
856
|
+
<script src="../diagnostics.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
857
|
+
<script src="../doctor.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
858
|
+
<script src="../history.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
859
|
+
<script src="../session-cache.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
860
|
+
<script src="../activity.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
861
|
+
<script src="../turn-results.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
862
|
+
<script src="../image-cache.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
863
|
+
<script src="../chat-copy.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
864
|
+
<script src="../image-preview.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
865
|
+
<script src="../link-check.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
866
|
+
<script src="../network.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
867
|
+
<script src="../operations.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
868
|
+
<script src="../host-queue.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
869
|
+
<script src="../host-schedule.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
870
|
+
<script src="../workflow.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
871
|
+
<script src="../sponsor-entry.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
872
|
+
<script src="../e2ee-config.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
873
|
+
<script src="../relay-devices.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
874
|
+
<script src="../relay-settings.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
875
|
+
<script src="../subagents.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
876
|
+
<script src="../session-presets.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
877
|
+
<script src="../permission-presets.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
878
|
+
<script src="../approval-records.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
879
|
+
<script src="../approval-summary.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
880
|
+
<script src="../doctor-entry.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
881
|
+
<link rel="stylesheet" href="../file-inbox.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
882
|
+
<script src="../file-inbox.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
883
|
+
<link rel="stylesheet" href="../session-deck.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
884
|
+
<script src="../session-deck.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
885
|
+
<link rel="stylesheet" href="../composer-tools.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
886
|
+
<link rel="stylesheet" href="../session-search.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
887
|
+
<link rel="stylesheet" href="../session-management.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
888
|
+
<link rel="stylesheet" href="../plan-review.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
889
|
+
<link rel="stylesheet" href="../turn-diff.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
890
|
+
<link rel="stylesheet" href="../bc-integration.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
891
|
+
<script src="../composer-tools.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
892
|
+
<script src="../session-search.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
893
|
+
<script src="../session-management.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
894
|
+
<script src="../plan-review.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
895
|
+
<script src="../turn-diff.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
896
|
+
<script src="../theme.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
897
|
+
<script src="../cache-upgrade.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
898
|
+
<script src="../slash-suggestions.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
899
|
+
<script src="desktop.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
898
900
|
</body>
|
|
899
901
|
</html>
|
|
@@ -885,6 +885,23 @@ function serverIdentity(url, token) {
|
|
|
885
885
|
}
|
|
886
886
|
function serverKey(server) { return serverIdentity(server?.url ?? server, server?.token) }
|
|
887
887
|
function serverToken(server) { return normalizedServerToken(server?.token) }
|
|
888
|
+
function groupToken(group = state.activeGroup) {
|
|
889
|
+
const tokens = [...new Set(groupServers(group).map(serverToken).filter(Boolean))]
|
|
890
|
+
return tokens.length === 1 ? tokens[0] : ''
|
|
891
|
+
}
|
|
892
|
+
function syncGroupToken(group, token) {
|
|
893
|
+
const value = normalizedServerToken(token)
|
|
894
|
+
if (!group || !value) return 0
|
|
895
|
+
let changed = 0
|
|
896
|
+
for (const server of groupServers(group)) {
|
|
897
|
+
if (serverToken(server) === value) continue
|
|
898
|
+
server.token = value
|
|
899
|
+
delete server.cacheRelayPin
|
|
900
|
+
delete server.cacheRelayOrigin
|
|
901
|
+
changed++
|
|
902
|
+
}
|
|
903
|
+
return changed
|
|
904
|
+
}
|
|
888
905
|
function currentServerEntry() {
|
|
889
906
|
return state.servers.find(s => s.url === state.server && serverToken(s) === state.token)
|
|
890
907
|
|| state.servers.find(s => s.url === state.server)
|
|
@@ -894,7 +911,7 @@ function setCurrentAccessToken(value) {
|
|
|
894
911
|
const token = normalizedServerToken(value)
|
|
895
912
|
if (!token) return false
|
|
896
913
|
const current = currentServerEntry()
|
|
897
|
-
|
|
914
|
+
syncGroupToken(current?.group || state.activeGroup, token)
|
|
898
915
|
state.token = token
|
|
899
916
|
LS.set('token', token)
|
|
900
917
|
saveServers()
|
|
@@ -1135,9 +1152,12 @@ function renderServers() {
|
|
|
1135
1152
|
const list = groupServers(g)
|
|
1136
1153
|
const auto = state.autoSelect[g] !== false
|
|
1137
1154
|
const activeManual = state.groupActive[g] || ''
|
|
1155
|
+
const tokens = new Set(list.map(serverToken).filter(Boolean))
|
|
1156
|
+
const mixedToken = tokens.size > 1
|
|
1138
1157
|
return `<div class="ds-srv-group" data-group="${esc(g)}">
|
|
1139
1158
|
<div class="ds-srv-head">
|
|
1140
1159
|
<button class="ds-srv-name" data-group-name="${esc(g)}" title="${t('ds.groupsSwitchHint')}"><span class="ds-srv-label">${g === state.activeGroup ? '▾' : '▸'} ${esc(g)}</span><span class="ds-srv-count">${list.length}</span></button>
|
|
1160
|
+
${mixedToken ? `<button class="ds-mini" data-sync-group="${esc(g)}" title="${I18N.lang === 'en' ? 'This group has mixed tokens; use the current connection token for all addresses' : '本组地址令牌不一致,点击用当前连接令牌统一'}">${I18N.lang === 'en' ? 'Sync token' : '统一令牌'}</button>` : ''}
|
|
1141
1161
|
<button class="ds-mini" data-speed-group="${esc(g)}" title="${t('ds.speedTest')}">⚡</button>
|
|
1142
1162
|
<label class="ds-switch" title="${t('ds.groupsAutoSelect')}"><input type="checkbox" data-auto-group="${esc(g)}" ${auto ? 'checked' : ''}><span class="ds-slider"></span></label>
|
|
1143
1163
|
${g !== '默认' ? `<button class="ds-mini" data-del-group="${esc(g)}" title="${t('ds.groupsDelete')}">✕</button>` : ''}
|
|
@@ -1167,6 +1187,20 @@ function renderServers() {
|
|
|
1167
1187
|
b.addEventListener('dblclick', () => renameGroup(b.dataset.groupName))
|
|
1168
1188
|
})
|
|
1169
1189
|
box.querySelectorAll('[data-speed-group]').forEach(b => b.addEventListener('click', () => { state.activeGroup = b.dataset.speedGroup; saveServers(); selectFastestServer({ silent: false }) }))
|
|
1190
|
+
box.querySelectorAll('[data-sync-group]').forEach(b => b.addEventListener('click', () => {
|
|
1191
|
+
const group = b.dataset.syncGroup
|
|
1192
|
+
const token = normalizedServerToken(state.token)
|
|
1193
|
+
if (!token) return toast(I18N.lang === 'en' ? 'No current token to sync.' : '当前没有可用的令牌。', 'err')
|
|
1194
|
+
const count = groupServers(group).length
|
|
1195
|
+
const message = I18N.lang === 'en'
|
|
1196
|
+
? `Use the current connection token for all ${count} addresses in group "${group}"?`
|
|
1197
|
+
: `用当前连接令牌统一组「${group}」的 ${count} 个地址?`
|
|
1198
|
+
if (!window.confirm(message)) return
|
|
1199
|
+
const changed = syncGroupToken(group, token)
|
|
1200
|
+
saveServers(); renderServers()
|
|
1201
|
+
toast(I18N.lang === 'en' ? `Token synced for ${changed} address(es).` : `已同步 ${changed} 个地址的令牌。`, 'ok')
|
|
1202
|
+
if (state.token) selectFastestServer({ silent: true })
|
|
1203
|
+
}))
|
|
1170
1204
|
box.querySelectorAll('[data-auto-group]').forEach(chk => chk.addEventListener('change', (e) => {
|
|
1171
1205
|
const g = e.target.dataset.autoGroup
|
|
1172
1206
|
state.autoSelect[g] = e.target.checked
|
|
@@ -1208,10 +1242,17 @@ async function addServer() {
|
|
|
1208
1242
|
if (!raw) return toast(t('ds.serversNeedAddress'), 'err')
|
|
1209
1243
|
try { const u = new URL(raw); if (u.protocol !== 'http:' && u.protocol !== 'https:') throw new Error('bad') }
|
|
1210
1244
|
catch { return toast(t('ds.serversBadProtocol'), 'err') }
|
|
1211
|
-
const
|
|
1245
|
+
const group = state.activeGroup
|
|
1246
|
+
const tokens = new Set(groupServers(group).map(serverToken).filter(Boolean))
|
|
1247
|
+
if (tokens.size > 1) {
|
|
1248
|
+
return toast(I18N.lang === 'en'
|
|
1249
|
+
? 'This group has mixed tokens. Unify them before adding another address.'
|
|
1250
|
+
: '本组地址令牌不一致,请先点击「统一令牌」再添加地址。', 'err')
|
|
1251
|
+
}
|
|
1252
|
+
const token = tokens.size === 1 ? [...tokens][0] : normalizedServerToken(state.token)
|
|
1212
1253
|
if (state.servers.some(s => serverIdentity(s.url, serverToken(s)) === serverIdentity(raw, token))) return toast(t('ds.serversDuplicate'), 'err')
|
|
1213
1254
|
const note = (prompt(t('ds.serversPromptNote')) || '').trim()
|
|
1214
|
-
state.servers.push({ id: newServerId(), url: raw, note, group
|
|
1255
|
+
state.servers.push({ id: newServerId(), url: raw, note, group, token })
|
|
1215
1256
|
saveServers()
|
|
1216
1257
|
if (input) input.value = ''
|
|
1217
1258
|
renderServers()
|
|
@@ -1235,7 +1276,9 @@ function editServer(id) {
|
|
|
1235
1276
|
if (group === null) return
|
|
1236
1277
|
const wasActive = state.server === s.url && state.token === serverToken(s)
|
|
1237
1278
|
const changedActiveUrl = wasActive && state.server !== raw
|
|
1279
|
+
const previousToken = serverToken(s)
|
|
1238
1280
|
s.url = raw; s.note = note.trim(); s.group = ensureGroup(group.trim() || '默认'); s.token = token
|
|
1281
|
+
if (previousToken !== token) syncGroupToken(s.group, token)
|
|
1239
1282
|
if (wasActive) {
|
|
1240
1283
|
if (changedActiveUrl) resetFsForServerDesktop()
|
|
1241
1284
|
state.server = raw
|
|
@@ -1250,6 +1293,7 @@ function removeServer(id) {
|
|
|
1250
1293
|
if (!s) return
|
|
1251
1294
|
void window.DshImageCache?.clear(historyCacheScope(s.url,serverToken(s)))
|
|
1252
1295
|
void window.DshHistory.cacheClear(historyCacheScope(s.url,serverToken(s)))
|
|
1296
|
+
clearSessionCache(historyCacheScope(s.url,serverToken(s)))
|
|
1253
1297
|
state.servers = state.servers.filter(x => x.id !== id)
|
|
1254
1298
|
const wasActive = state.server === s.url && state.token === serverToken(s)
|
|
1255
1299
|
for (const g of state.groups) if (state.groupActive[g] === id) state.groupActive[g] = ''
|
|
@@ -2026,7 +2070,7 @@ async function refreshSessions() {
|
|
|
2026
2070
|
state.subagentSessions[id] = merged
|
|
2027
2071
|
}
|
|
2028
2072
|
applyPendingProjections()
|
|
2029
|
-
|
|
2073
|
+
writeSessionCache(state.sessions)
|
|
2030
2074
|
if(typeof window!=='undefined')window.DshDoctorEntry?.consumeSessionLink(openSession,state.byId)
|
|
2031
2075
|
renderSessions()
|
|
2032
2076
|
scheduleWorkbenchRefresh()
|
|
@@ -2239,9 +2283,49 @@ async function closeSession() {
|
|
|
2239
2283
|
if(cleanup)await archiveEmptySessionOnLeave(sessionId,true)
|
|
2240
2284
|
}
|
|
2241
2285
|
|
|
2286
|
+
function readSessionCache() {
|
|
2287
|
+
const scope = historyCacheScope()
|
|
2288
|
+
if (globalThis.DshSessionCache?.read) return globalThis.DshSessionCache.read(scope)
|
|
2289
|
+
try { const items = JSON.parse(LS.get(scope + ':sessions', '')); return Array.isArray(items) ? items : null } catch { return null }
|
|
2290
|
+
}
|
|
2291
|
+
function writeSessionCache(list) {
|
|
2292
|
+
const scope = historyCacheScope()
|
|
2293
|
+
const value = Array.isArray(list) ? list.slice(0, 80) : []
|
|
2294
|
+
if (globalThis.DshSessionCache?.write) return globalThis.DshSessionCache.write(scope, value)
|
|
2295
|
+
const canonical = scope.replace(/^historyCacheV2:/, 'sessionsCacheV2:')
|
|
2296
|
+
try {
|
|
2297
|
+
LS.set(canonical, JSON.stringify(value))
|
|
2298
|
+
if (LS.get(scope + ':sessions', null) !== null) LS.set(scope + ':sessions', JSON.stringify(value))
|
|
2299
|
+
return true
|
|
2300
|
+
} catch { return false }
|
|
2301
|
+
}
|
|
2302
|
+
function clearSessionCache(scope = historyCacheScope()) {
|
|
2303
|
+
if (globalThis.DshSessionCache?.clear) return globalThis.DshSessionCache.clear(scope)
|
|
2304
|
+
try { LS.del(scope.replace(/^historyCacheV2:/, 'sessionsCacheV2:')) } catch {}
|
|
2305
|
+
try { LS.del(scope + ':sessions') } catch {}
|
|
2306
|
+
}
|
|
2307
|
+
function clearAllSessionCaches() {
|
|
2308
|
+
if (globalThis.DshSessionCache?.clearAll) return globalThis.DshSessionCache.clearAll()
|
|
2309
|
+
try {
|
|
2310
|
+
const storage = globalThis.localStorage
|
|
2311
|
+
if (!storage) return false
|
|
2312
|
+
for (const key of Object.keys(storage)) {
|
|
2313
|
+
if (key.startsWith('sessionsCacheV2:') || (key.startsWith('historyCacheV2:') && key.endsWith(':sessions'))) storage.removeItem(key)
|
|
2314
|
+
}
|
|
2315
|
+
return true
|
|
2316
|
+
} catch { return false }
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2242
2319
|
function restoreCachedSessionList() {
|
|
2243
2320
|
if(state.sessions.length)return
|
|
2244
|
-
try
|
|
2321
|
+
try {
|
|
2322
|
+
const items = readSessionCache()
|
|
2323
|
+
state.sessions = Array.isArray(items) ? items.filter(item => typeof item?.sessionId === 'string').slice(0, 80) : []
|
|
2324
|
+
state.byId = new Map(state.sessions.map(item => [item.sessionId, item]))
|
|
2325
|
+
// Render even when no cache exists: an identity switch must clear the old
|
|
2326
|
+
// connection's list instead of leaving its DOM behind.
|
|
2327
|
+
renderSessions()
|
|
2328
|
+
} catch {}
|
|
2245
2329
|
}
|
|
2246
2330
|
|
|
2247
2331
|
let conversationView = null
|
|
@@ -2273,7 +2357,7 @@ function scheduleHistoryCacheSave() {
|
|
|
2273
2357
|
}
|
|
2274
2358
|
async function saveHistoryCache(scope=historyCacheScope(),id=state.current,history=state.history) {
|
|
2275
2359
|
if(!id||!history.visible.length||history.tailEvicted)return
|
|
2276
|
-
const saved=await window.DshHistory.cacheSave(scope,id,{title:titleOf(state.byId.get(id)),events:history.visible
|
|
2360
|
+
const saved=await window.DshHistory.cacheSave(scope,id,{title:titleOf(state.byId.get(id)),events:history.visible,minSeq:history.minSeq,hasMore:history.hasMore,partialReasoning:[...history.partialReasoning.values()]},250)
|
|
2277
2361
|
if(!saved&&state.current===id&&state.history===history&&scope===historyCacheScope())historySource('saveFailed')
|
|
2278
2362
|
if(saved&&state.current===id&&state.history===history&&scope===historyCacheScope()&&['synced','saveFailed'].includes(history.source))historySource('saved')
|
|
2279
2363
|
}
|
|
@@ -5028,6 +5112,9 @@ async function start() {
|
|
|
5028
5112
|
if (!state.token) { showView('view-settings'); $('desktop-token-input').focus() }
|
|
5029
5113
|
renderWorkbench()
|
|
5030
5114
|
updateConn()
|
|
5115
|
+
// Restore the startup connection's list before any network wait; the state
|
|
5116
|
+
// setter's queued restore is not enough to clear an old host's DOM on switch.
|
|
5117
|
+
if (state.token) restoreCachedSessionList()
|
|
5031
5118
|
checkNotesOnStart()
|
|
5032
5119
|
if (state.token) {
|
|
5033
5120
|
if (!doctorSessionHandoff) await selectFastestServer({ silent: true, reconnect: false })
|
|
@@ -5080,6 +5167,7 @@ function mountWorkflowDesktop() {
|
|
|
5080
5167
|
const connection=captureConnection(),scope=historyCacheScope()
|
|
5081
5168
|
cancelHistoryLoad()
|
|
5082
5169
|
await window.DshImageCache.clear(scope);await window.DshHistory.cacheClear(scope)
|
|
5170
|
+
clearSessionCache(scope)
|
|
5083
5171
|
if(!connection.valid())return
|
|
5084
5172
|
const current=currentServerEntry();if(current)state.servers=state.servers.filter(s=>s.id!==current.id)
|
|
5085
5173
|
state.groupActive[state.activeGroup]='';state.token='';state.server='';LS.del('token');LS.del('server');saveServers()
|
|
@@ -5088,6 +5176,7 @@ function mountWorkflowDesktop() {
|
|
|
5088
5176
|
const results=[]
|
|
5089
5177
|
if(kind!=='images')cancelHistoryLoad()
|
|
5090
5178
|
if(kind!=='images')results.push(await window.DshHistory.cacheClear())
|
|
5179
|
+
if(kind!=='images')results.push(clearAllSessionCaches())
|
|
5091
5180
|
if(kind!=='history')results.push(await window.DshImageCache.clear())
|
|
5092
5181
|
if(kind==='all'){window.DshWorkflow.clearStorage();location.reload()}
|
|
5093
5182
|
else if(results.includes(false))toast(en?'Some caches could not be cleared. Retry shortly.':'部分缓存未能清除,请稍后重试。','err')
|
package/public/e2ee-transport.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* Packaged Android WebUI: paired public origins always use the native TLS proxy. */
|
|
2
2
|
;(function(root) {
|
|
3
3
|
'use strict'
|
|
4
|
+
if (root.DSH_REMOTE_E2EE_DISABLED === true) {
|
|
5
|
+
root.DshE2eeTransport = { resolve: input => input, mount() {} }
|
|
6
|
+
return
|
|
7
|
+
}
|
|
4
8
|
const bridge = root.NativeE2ee
|
|
5
9
|
if (!bridge?.resolve) return
|
|
6
10
|
const active = new Set()
|
|
@@ -265,8 +269,8 @@
|
|
|
265
269
|
} })
|
|
266
270
|
})
|
|
267
271
|
const modeLabel = document.createElement('label'), modeSwitch = document.createElement('input'), modeText = document.createElement('span'), modeStatus = document.createElement('p')
|
|
268
|
-
modeLabel.className = 'relay-encryption-switch'; modeSwitch.type = 'checkbox'; modeSwitch.checked =
|
|
269
|
-
modeText.textContent = text('
|
|
272
|
+
modeLabel.className = 'relay-encryption-switch'; modeSwitch.type = 'checkbox'; modeSwitch.checked = false; modeSwitch.dataset.e2eeToggle = 'true'
|
|
273
|
+
modeText.textContent = text('端到端加密(默认关闭)', 'End-to-end encryption (off by default)'); modeLabel.append(modeSwitch, modeText)
|
|
270
274
|
modeStatus.setAttribute('role', 'status'); modeStatus.className = 'relay-encryption-status'
|
|
271
275
|
title.textContent = text('手机公网配对', 'Pair this phone for public access')
|
|
272
276
|
explanation.textContent = text('电脑开通中转后,用这台手机扫描电脑管理页的连接码。已连上电脑局域网时,也可在这里直接配对。', 'After enabling relay on your computer, scan its connection code with this phone. You can also pair here over an existing LAN connection.')
|
|
@@ -281,7 +285,21 @@
|
|
|
281
285
|
guide.append(title, explanation, progress, scan, autoPair, status)
|
|
282
286
|
advanced.append(advancedTitle, modeLabel, modeStatus, button, file, logBox)
|
|
283
287
|
target.append(guide, advanced)
|
|
288
|
+
guide.hidden = true; advanced.hidden = true
|
|
284
289
|
let selectedOrigin = '', identity = ''
|
|
290
|
+
async function loadPlanPolicy() {
|
|
291
|
+
try {
|
|
292
|
+
const ctx = connection()
|
|
293
|
+
const response = await root.fetch(ctx.url('/relay'), { headers: ctx.headers, cache: 'no-store', signal: root.AbortSignal?.timeout?.(8000) })
|
|
294
|
+
const value = response.ok ? await response.json() : null
|
|
295
|
+
const allowed = value?.e2ee?.allowed !== false && value?.e2ee?.enabled === true
|
|
296
|
+
if (!allowed) { try { bridge.clear?.() } catch {} }
|
|
297
|
+
guide.hidden = !allowed
|
|
298
|
+
advanced.hidden = !allowed
|
|
299
|
+
if (allowed) renderMode()
|
|
300
|
+
} catch { /* keep the encryption UI hidden until the host proves eligibility */ }
|
|
301
|
+
}
|
|
302
|
+
void loadPlanPolicy()
|
|
285
303
|
function modeContext() {
|
|
286
304
|
const ctx = connection(), key = JSON.stringify([ctx.url('/relay'),ctx.headers?.authorization||''])
|
|
287
305
|
if (key !== identity) { identity = key; selectedOrigin = new URL(ctx.url('/relay'),root.location.href).origin }
|
|
@@ -289,6 +307,7 @@
|
|
|
289
307
|
return ctx
|
|
290
308
|
}
|
|
291
309
|
function renderMode() {
|
|
310
|
+
if (guide.hidden) return
|
|
292
311
|
try {
|
|
293
312
|
const ctx = modeContext(), pairing = root.DshRelayAutoPair?.progress?.(ctx)
|
|
294
313
|
const local = root.DshRelayAutoPair?.localUrl(ctx.url('/relay')) && /^Bearer \S+$/.test(ctx.headers?.authorization || '')
|
|
@@ -302,11 +321,11 @@
|
|
|
302
321
|
autoPair.disabled = !local || pairing?.phase === 'working'
|
|
303
322
|
scan.disabled = pairing?.phase === 'working'
|
|
304
323
|
const state = JSON.parse(bridge.info(selectedOrigin))
|
|
305
|
-
modeSwitch.checked = state.encrypted !== false
|
|
324
|
+
modeSwitch.checked = !!state.configured && state.encrypted !== false
|
|
306
325
|
modeSwitch.disabled = !!state.error || !state.configured || typeof bridge.setEncryption !== 'function'
|
|
307
326
|
modeStatus.dataset.security = !state.configured || state.error ? 'pending' : modeSwitch.checked ? 'encrypted' : 'legacy'
|
|
308
327
|
modeStatus.textContent = selectedOrigin + ' · ' + (state.error ? text('无法读取安全状态,请重试;不会自动降级。','Security status unavailable. No automatic fallback.') : !state.configured
|
|
309
|
-
? text('
|
|
328
|
+
? text('默认关闭,待本地配对;当前连接尚不能标记为已加密。','Off by default; local pairing required. This connection is not yet verified as encrypted.')
|
|
310
329
|
: modeSwitch.checked ? text('端到端加密已启用;每次连接仍需通过主机证书校验。','End-to-end encryption enabled; each connection must verify the host certificate.')
|
|
311
330
|
: text('警告:端到端加密已关闭。仅有 HTTPS,中转方在技术上可读取内容和访问令牌。','Warning: end-to-end encryption is OFF. HTTPS remains, but the relay can technically read content and access tokens.'))
|
|
312
331
|
} catch { modeSwitch.disabled = true; modeStatus.textContent = text('无法读取安全状态。','Security status unavailable.') }
|