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/history.js
CHANGED
|
@@ -33,7 +33,11 @@
|
|
|
33
33
|
this.live=document.createElement('div'); this.live.className='history-live'
|
|
34
34
|
box.addEventListener('toggle',event=>{
|
|
35
35
|
const detail=event.target
|
|
36
|
-
if(detail?.dataset?.activityKey)
|
|
36
|
+
if(detail?.dataset?.activityKey){
|
|
37
|
+
this.rememberDisclosure(detail)
|
|
38
|
+
// The document capture listener has already hydrated the opened body.
|
|
39
|
+
if(detail.open)this.restoreDisclosures(detail)
|
|
40
|
+
}
|
|
37
41
|
if(detail?.dataset?.activitySummary!=null)this.updateActivityRows()
|
|
38
42
|
},true)
|
|
39
43
|
const intent=()=>{this.intentUntil=Date.now()+1200}
|
|
@@ -51,8 +55,21 @@
|
|
|
51
55
|
},{passive:true})
|
|
52
56
|
}
|
|
53
57
|
anchor() {
|
|
54
|
-
const
|
|
55
|
-
for(const node of
|
|
58
|
+
const box=this.box, bounds=box.getBoundingClientRect()
|
|
59
|
+
for(const node of box.querySelectorAll('.history-entry')){
|
|
60
|
+
if(node.hidden)continue
|
|
61
|
+
const row=node.getBoundingClientRect()
|
|
62
|
+
if(row.bottom<bounds.top+1)continue
|
|
63
|
+
const anchor={seq:Number(node.dataset.historySeq),top:row.top,scrollTop:box.scrollTop}
|
|
64
|
+
// Within a tall group, use the visible tool/reasoning heading as the anchor.
|
|
65
|
+
for(const summary of node.querySelectorAll('details[data-activity-key] > summary')){
|
|
66
|
+
const rect=summary.getBoundingClientRect()
|
|
67
|
+
if(rect.bottom<=bounds.top||rect.top>=bounds.bottom||rect.height===0)continue
|
|
68
|
+
anchor.activity={key:summary.parentNode.dataset.activityKey,top:rect.top}
|
|
69
|
+
break
|
|
70
|
+
}
|
|
71
|
+
return anchor
|
|
72
|
+
}
|
|
56
73
|
return null
|
|
57
74
|
}
|
|
58
75
|
get unread() {return Math.max(0,this.entries.length-this.end)}
|
|
@@ -70,10 +87,23 @@
|
|
|
70
87
|
if(this.reading&&!reset)live=this.liveHtml||''
|
|
71
88
|
if(!reset&&!this.renderErrors&&entries.length===this.entries.length&&entries.every((entry,i)=>entry===this.entries[i])&&hasMore===this.hasMore&&loading===this.loading&&(this.end===entries.length?live:'')===this.liveHtml){this.more.disabled=loading;this.more.textContent=loading?this.options.loadingLabel():this.options.olderLabel();this.domChanged=false;this.options.changed?.(this);return}
|
|
72
89
|
const oldWidth=this.end-this.start
|
|
90
|
+
// Real position wins over the intent flag: never snap a reader back to the tail just
|
|
91
|
+
// because a layout scroll cleared `reading` while new content arrived.
|
|
92
|
+
const wasAtBottom=this.atBottom
|
|
73
93
|
const anchor=this.anchor(), oldStart=this.entries[this.start]?.seq, oldEnd=this.entries[Math.max(this.start,this.end-1)]?.seq
|
|
74
94
|
this.entries=entries.slice(); this.hasMore=hasMore; this.loading=loading
|
|
75
95
|
if(reset || !this.end){this.end=entries.length;this.start=Math.max(0,this.end-WINDOW_SIZE);this.reading=false}
|
|
76
|
-
else if(!this.reading && this.end>=this.previousLength){
|
|
96
|
+
else if(!this.reading && this.end>=this.previousLength){
|
|
97
|
+
this.end=entries.length;this.start=Math.max(0,this.end-WINDOW_SIZE)
|
|
98
|
+
// Appending to a full window must not evict its visible anchor.
|
|
99
|
+
if(!wasAtBottom&&anchor){
|
|
100
|
+
const position=entries.findIndex(entry=>entry.seq===anchor.seq)
|
|
101
|
+
if(position>=0&&position<this.start){
|
|
102
|
+
this.start=Math.max(0,entries.findIndex(entry=>entry.seq===oldStart))
|
|
103
|
+
this.reading=true
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
77
107
|
else {
|
|
78
108
|
let start=entries.findIndex(e=>e.seq===oldStart),end=entries.findIndex(e=>e.seq===oldEnd)
|
|
79
109
|
if(start<0)start=anchor?entries.findIndex(e=>e.seq===anchor.seq):0
|
|
@@ -83,7 +113,7 @@
|
|
|
83
113
|
this.emptyLabel=emptyLabel
|
|
84
114
|
this.more.textContent=loading?this.options.loadingLabel():this.options.olderLabel();this.more.disabled=loading;this.more.hidden=this.start===0&&!hasMore
|
|
85
115
|
this.liveHtml=this.reading&&!reset ? this.liveHtml||'' : this.end===entries.length?live:''
|
|
86
|
-
this.render(anchor,reset || (!this.reading && this.end===entries.length))
|
|
116
|
+
this.render(anchor,reset || (!this.reading && wasAtBottom && this.end===entries.length))
|
|
87
117
|
}
|
|
88
118
|
rememberDisclosure(detail) {
|
|
89
119
|
const key=detail.dataset.activityKey;if(!key)return
|
|
@@ -91,10 +121,25 @@
|
|
|
91
121
|
if(this.disclosures.size>512)this.disclosures.delete(this.disclosures.keys().next().value)
|
|
92
122
|
}
|
|
93
123
|
captureDisclosures(node) {for(const detail of node.querySelectorAll('details[data-activity-key]'))this.rememberDisclosure(detail)}
|
|
94
|
-
restoreDisclosures(node) {
|
|
124
|
+
restoreDisclosures(node) {
|
|
125
|
+
for(const detail of node.querySelectorAll('details[data-activity-key]')){
|
|
126
|
+
const key=detail.dataset.activityKey
|
|
127
|
+
if(this.disclosures.has(key))detail.open=this.disclosures.get(key)
|
|
128
|
+
if(detail.open){
|
|
129
|
+
// Hydrating a group creates disclosures absent from the original NodeList.
|
|
130
|
+
for(const body of globalThis.DshActivity?.hydrate?.(detail)||[])this.restoreDisclosures(body)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
95
134
|
updateActivityRows() {
|
|
96
135
|
const rendered = new Map([...this.box.querySelectorAll('[data-activity-summary]')].map(el=>[el.dataset.activitySummary,el]))
|
|
97
|
-
|
|
136
|
+
const groups=this.box.querySelectorAll('[data-activity-turn]')
|
|
137
|
+
for(const detail of groups){
|
|
138
|
+
const controller=rendered.get(detail.dataset.activityTurn)
|
|
139
|
+
// Completing a turn can add its summary around a group the user is reading.
|
|
140
|
+
if(detail.open&&controller&&!this.disclosures.has(controller.dataset.activityKey))controller.open=true
|
|
141
|
+
}
|
|
142
|
+
for(const detail of groups){
|
|
98
143
|
const id=detail.dataset.activityTurn, controller=rendered.get(id), row=detail.parentNode
|
|
99
144
|
// If the summary has scrolled out of the rendered page, keep this group reachable.
|
|
100
145
|
row.hidden=!!controller&&!controller.open
|
|
@@ -110,10 +155,12 @@
|
|
|
110
155
|
this.renderErrors=0
|
|
111
156
|
for(const entry of slice) {
|
|
112
157
|
// Hidden events render an empty string; keeping their node would leave dead gaps.
|
|
113
|
-
let html,
|
|
114
|
-
try{
|
|
158
|
+
let key=null,cached=this.nodes.get(entry.seq),html,failed=false
|
|
159
|
+
try{key=signature(entry)}catch{key=null}
|
|
160
|
+
// Unchanged rows keep their DOM and skip markdown/JSON rendering entirely.
|
|
161
|
+
if(key!=null&&cached?.key===key){desired.push(cached.node);continue}
|
|
162
|
+
try{html=this.options.html(entry);if(key==null)key=signature(entry)}catch(error){failed=true;this.renderErrors++;key='render-error';globalThis.DshDiagnostics?.record('history.row',{phase:'failed',...globalThis.DshDiagnostics.errorFacts(error),category:'render'})}
|
|
115
163
|
if(!html&&!failed){if(this.nodes.delete(entry.seq))changed=true;continue}
|
|
116
|
-
let cached=this.nodes.get(entry.seq)
|
|
117
164
|
if(!cached || cached.key!==key){changed=true;const node=document.createElement('div');node.className='history-entry';node.dataset.historySeq=String(entry.seq);if(failed)node.textContent=this.options.errorLabel?.()||'This message could not be displayed. Retry loading history.';else{node.innerHTML=html;this.restoreDisclosures(node)}cached={key,node};this.nodes.set(entry.seq,cached)}
|
|
118
165
|
desired.push(cached.node)
|
|
119
166
|
}
|
|
@@ -132,7 +179,20 @@
|
|
|
132
179
|
if(this.live.innerHTML!==this.liveHtml){this.live.innerHTML=this.liveHtml;this.restoreDisclosures(this.live)}
|
|
133
180
|
if(this.live.parentNode!==box)box.append(this.live)
|
|
134
181
|
if(bottom)box.scrollTop=box.scrollHeight
|
|
135
|
-
else if(anchor){
|
|
182
|
+
else if(anchor){
|
|
183
|
+
const current=this.nodes.get(anchor.seq)?.node
|
|
184
|
+
let summary
|
|
185
|
+
if(anchor.activity){
|
|
186
|
+
for(const heading of (current||box).querySelectorAll('details[data-activity-key] > summary')){
|
|
187
|
+
if(heading.parentNode.dataset.activityKey!==anchor.activity.key||!heading.getClientRects().length)continue
|
|
188
|
+
summary=heading
|
|
189
|
+
break
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if(summary)box.scrollTop+=summary.getBoundingClientRect().top-anchor.activity.top
|
|
193
|
+
else if(current?.parentNode===box&&!current.hidden)box.scrollTop+=current.getBoundingClientRect().top-anchor.top
|
|
194
|
+
else box.scrollTop=anchor.scrollTop
|
|
195
|
+
}
|
|
136
196
|
const active=new Set(slice.map(entry=>entry.seq));for(const seq of this.nodes.keys())if(!active.has(seq))this.nodes.delete(seq)
|
|
137
197
|
cancelAnimationFrame(this.releaseFrame);this.releaseFrame=requestAnimationFrame(()=>{this.suppress=false})
|
|
138
198
|
this.lastScrollTop=box.scrollTop
|
|
@@ -196,6 +256,41 @@
|
|
|
196
256
|
try{return Promise.resolve(JSON.parse(raw)[id]||null)}catch{return Promise.resolve(null)}
|
|
197
257
|
}
|
|
198
258
|
const cacheKey=(scope,id)=>scope+':session:'+encodeURIComponent(id)
|
|
259
|
+
const TRACE_BLOCKS = new Set(['thinking', 'reasoning', 'tool-call', 'tool-result'])
|
|
260
|
+
function compactCacheEvents(events) {
|
|
261
|
+
let starts = 0, prompts = 0, turnStart = -1, promptStart = -1
|
|
262
|
+
for (let i = events.length - 1; i >= 0; i--) {
|
|
263
|
+
const event = events[i]?.event
|
|
264
|
+
if (event?.type === 'turn/start' && ++starts === 2) { turnStart = i; break }
|
|
265
|
+
const source = event?.data?.source ?? event?.data?.message?.source
|
|
266
|
+
if (event?.type === 'user/message' && (!source || source.kind === 'user') && ++prompts === 2) promptStart = i
|
|
267
|
+
}
|
|
268
|
+
const keepTracesFrom = turnStart >= 0 ? turnStart : Math.max(0, promptStart)
|
|
269
|
+
const kept = []
|
|
270
|
+
for (let i = 0; i < events.length; i++) {
|
|
271
|
+
const entry = events[i], event = entry?.event
|
|
272
|
+
if (i >= keepTracesFrom || !event) { kept.push(entry); continue }
|
|
273
|
+
const { type, data } = event
|
|
274
|
+
if (typeof type === 'string' && type.startsWith('tool/')) continue
|
|
275
|
+
if (type === 'assistant/attempt' && data?.stream) {
|
|
276
|
+
kept.push({ ...entry, event: { ...event, data: { ...data, stream: [] } } })
|
|
277
|
+
} else if (type === 'assistant/message') {
|
|
278
|
+
const message = data?.message, content = message?.content ?? data?.content
|
|
279
|
+
if (!Array.isArray(content) || !content.some(block => TRACE_BLOCKS.has(block?.type))) {
|
|
280
|
+
kept.push(entry)
|
|
281
|
+
} else {
|
|
282
|
+
const blocks = content.filter(block => !TRACE_BLOCKS.has(block?.type))
|
|
283
|
+
if (blocks.length) kept.push({ ...entry, event: { ...event, data: message?.content
|
|
284
|
+
? { ...data, message: { ...message, content: blocks } } : { ...data, content: blocks } } })
|
|
285
|
+
}
|
|
286
|
+
} else kept.push(entry)
|
|
287
|
+
}
|
|
288
|
+
return kept
|
|
289
|
+
}
|
|
290
|
+
function compactCachedValue(value) {
|
|
291
|
+
if (!Array.isArray(value?.events) || value.traceTurns === 2) return value
|
|
292
|
+
return { ...value, events: compactCacheEvents(value.events), traceTurns: 2 }
|
|
293
|
+
}
|
|
199
294
|
async function cacheLoad(scope,id,legacy) {
|
|
200
295
|
const key=cacheKey(scope,id),db=await openDatabase()
|
|
201
296
|
if(db){const value=await new Promise(resolve=>{
|
|
@@ -203,16 +298,18 @@
|
|
|
203
298
|
const done=value=>{if(settled)return;settled=true;clearTimeout(timer);resolve(value)}
|
|
204
299
|
const timer=setTimeout(()=>{globalThis.DshDiagnostics?.storageFailure(scope,{name:'TimeoutError'},'indexeddb');done(null);try{tx?.abort()}catch{}},1500)
|
|
205
300
|
try{tx=db.transaction('history');const request=tx.objectStore('history').get(key);request.onsuccess=()=>done(request.result);request.onerror=tx.onabort=tx.onerror=()=>done(null)}catch{done(null)}
|
|
206
|
-
});if(value)return value}
|
|
207
|
-
try{const value=JSON.parse(localStorage.getItem(key)||'null');if(value)return value}catch{}
|
|
301
|
+
});if(value)return compactCachedValue(value)}
|
|
302
|
+
try{const value=JSON.parse(localStorage.getItem(key)||'null');if(value)return compactCachedValue(value)}catch{}
|
|
208
303
|
// One-time compatibility with the old per-connection JSON cache.
|
|
209
|
-
try{const value=await legacy?.(id);if(value){void cacheSave(scope,id,value);return value}return null}catch{return null}
|
|
304
|
+
try{const value=await legacy?.(id);if(value){void cacheSave(scope,id,value);return compactCachedValue(value)}return null}catch{return null}
|
|
210
305
|
}
|
|
211
|
-
async function cacheSave(scope,id,value) {
|
|
306
|
+
async function cacheSave(scope,id,value,maxEvents=Infinity) {
|
|
212
307
|
const epoch=cacheEpoch,key=cacheKey(scope,id),kept=[];let size=0
|
|
213
|
-
|
|
308
|
+
const events=compactCacheEvents(value.events||[])
|
|
309
|
+
for(let i=events.length-1;i>=0&&kept.length<maxEvents;i--){const entry=events[i],length=signature(entry).length;if(size+length>750000)break;kept.push(entry);size+=length}
|
|
214
310
|
if(!kept.length)return false
|
|
215
|
-
|
|
311
|
+
kept.reverse()
|
|
312
|
+
const data={...value,events:kept,traceTurns:2,minSeq:kept.length<events.length?kept[0].seq:value.minSeq??kept[0].seq,hasMore:value.hasMore||kept.length<events.length,key,scope,id,updatedAt:Date.now()},db=await openDatabase()
|
|
216
313
|
if(epoch!==cacheEpoch)return false
|
|
217
314
|
if(db)try{const saved=await new Promise(resolve=>{
|
|
218
315
|
const tx=db.transaction('history','readwrite'),store=tx.objectStore('history');store.put(data)
|
package/public/index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, viewport-fit=cover">
|
|
7
7
|
<meta name="theme-color" content="#0D1117">
|
|
@@ -12,29 +12,29 @@
|
|
|
12
12
|
<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>
|
|
13
13
|
<link rel="manifest" href="manifest.webmanifest">
|
|
14
14
|
<link rel="icon" href="icon.svg" type="image/svg+xml">
|
|
15
|
-
<link rel="stylesheet" href="styles.css?dsr-build=
|
|
16
|
-
<link rel="stylesheet" href="slash-suggestions.css?dsr-build=
|
|
17
|
-
<link rel="stylesheet" href="genui.css?dsr-build=
|
|
18
|
-
<link rel="stylesheet" href="plugin-center.css?dsr-build=
|
|
19
|
-
<link rel="stylesheet" href="skills.css?dsr-build=
|
|
20
|
-
<link rel="stylesheet" href="doctor.css?dsr-build=
|
|
21
|
-
<link rel="stylesheet" href="onboarding.css?dsr-build=
|
|
22
|
-
<link rel="stylesheet" href="extensions.css?dsr-build=
|
|
23
|
-
<link rel="stylesheet" href="insights.css?dsr-build=
|
|
24
|
-
<link rel="stylesheet" href="workflow.css?dsr-build=
|
|
25
|
-
<link rel="stylesheet" href="relay-settings.css?dsr-build=
|
|
26
|
-
<link rel="stylesheet" href="subagents.css?dsr-build=
|
|
27
|
-
<link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=
|
|
28
|
-
<link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=
|
|
29
|
-
<link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=
|
|
30
|
-
<link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=
|
|
31
|
-
<link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=
|
|
32
|
-
<link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=
|
|
33
|
-
<link rel="stylesheet" href="skins/kita/skin.css?dsr-build=
|
|
34
|
-
<link rel="stylesheet" href="skins/penguin-logistics/skin.css?dsr-build=
|
|
35
|
-
<link rel="stylesheet" href="skins/miku/skin.css?dsr-build=
|
|
36
|
-
<link rel="stylesheet" href="theme-picker.css?dsr-build=
|
|
37
|
-
<link rel="stylesheet" href="host-state.css?dsr-build=
|
|
15
|
+
<link rel="stylesheet" href="styles.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
16
|
+
<link rel="stylesheet" href="slash-suggestions.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
17
|
+
<link rel="stylesheet" href="genui.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
18
|
+
<link rel="stylesheet" href="plugin-center.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
19
|
+
<link rel="stylesheet" href="skills.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
20
|
+
<link rel="stylesheet" href="doctor.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
21
|
+
<link rel="stylesheet" href="onboarding.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
22
|
+
<link rel="stylesheet" href="extensions.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
23
|
+
<link rel="stylesheet" href="insights.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
24
|
+
<link rel="stylesheet" href="workflow.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
25
|
+
<link rel="stylesheet" href="relay-settings.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
26
|
+
<link rel="stylesheet" href="subagents.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
27
|
+
<link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
28
|
+
<link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
29
|
+
<link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
30
|
+
<link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
31
|
+
<link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
32
|
+
<link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
33
|
+
<link rel="stylesheet" href="skins/kita/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
34
|
+
<link rel="stylesheet" href="skins/penguin-logistics/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
35
|
+
<link rel="stylesheet" href="skins/miku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
36
|
+
<link rel="stylesheet" href="theme-picker.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
37
|
+
<link rel="stylesheet" href="host-state.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
38
38
|
</head>
|
|
39
39
|
<body class="mobile-ui">
|
|
40
40
|
<header class="topbar">
|
|
@@ -1671,67 +1671,69 @@
|
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
1673
|
</script>
|
|
1674
|
-
<script src="
|
|
1675
|
-
<script src="
|
|
1676
|
-
<script src="
|
|
1677
|
-
<script src="
|
|
1678
|
-
<script src="
|
|
1679
|
-
<script src="
|
|
1680
|
-
<script src="
|
|
1681
|
-
<script src="
|
|
1682
|
-
<script src="
|
|
1683
|
-
<script src="
|
|
1684
|
-
<script src="
|
|
1685
|
-
<script
|
|
1686
|
-
<script src="
|
|
1687
|
-
<script src="
|
|
1688
|
-
<script src="
|
|
1689
|
-
<script src="
|
|
1690
|
-
<script src="
|
|
1691
|
-
<script src="
|
|
1692
|
-
<script src="
|
|
1693
|
-
<script src="
|
|
1694
|
-
<script src="
|
|
1695
|
-
<script src="
|
|
1696
|
-
<script src="
|
|
1697
|
-
<script src="
|
|
1698
|
-
<script src="
|
|
1699
|
-
<script src="
|
|
1700
|
-
<script src="image-
|
|
1701
|
-
<script src="
|
|
1702
|
-
<script src="
|
|
1703
|
-
<script src="
|
|
1704
|
-
<script src="
|
|
1705
|
-
<script src="
|
|
1706
|
-
<script src="
|
|
1707
|
-
<script src="
|
|
1708
|
-
<script src="
|
|
1709
|
-
<script src="
|
|
1710
|
-
<script src="
|
|
1711
|
-
<script src="
|
|
1712
|
-
<script src="
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
<
|
|
1716
|
-
<script src="
|
|
1717
|
-
<link rel="stylesheet" href="
|
|
1718
|
-
<script src="
|
|
1719
|
-
<link rel="stylesheet" href="
|
|
1720
|
-
<
|
|
1721
|
-
<link rel="stylesheet" href="
|
|
1722
|
-
<link rel="stylesheet" href="
|
|
1723
|
-
<link rel="stylesheet" href="
|
|
1724
|
-
<link rel="stylesheet" href="
|
|
1725
|
-
<
|
|
1726
|
-
<
|
|
1727
|
-
<script src="
|
|
1728
|
-
<script src="
|
|
1729
|
-
<script src="
|
|
1730
|
-
<script src="
|
|
1731
|
-
<script src="
|
|
1732
|
-
<script src="
|
|
1733
|
-
<script src="
|
|
1734
|
-
<script src="
|
|
1735
|
-
<script src="
|
|
1674
|
+
<script src="e2ee-config.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1675
|
+
<script src="relay-autopair.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1676
|
+
<script src="e2ee-transport.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1677
|
+
<script src="sha256.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1678
|
+
<script src="jsqr.min.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1679
|
+
<script src="i18n.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1680
|
+
<script src="theme.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1681
|
+
<script src="genui.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1682
|
+
<script src="chat-files.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1683
|
+
<script src="md.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1684
|
+
<script src="vendor/gsap/gsap.min.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1685
|
+
<script src="motion.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1686
|
+
<script type="module" src="morphicons-init.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1687
|
+
<script src="plugin-center.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1688
|
+
<script src="skills.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1689
|
+
<script src="insights.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1690
|
+
<script src="teams.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1691
|
+
<script src="task-board.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1692
|
+
<script src="extensions.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1693
|
+
<script src="diagnostics.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1694
|
+
<script src="doctor.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1695
|
+
<script src="history.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1696
|
+
<script src="session-cache.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1697
|
+
<script src="announcement-forms.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1698
|
+
<script src="activity.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1699
|
+
<script src="turn-results.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1700
|
+
<script src="image-cache.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1701
|
+
<script src="chat-copy.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1702
|
+
<script src="image-preview.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1703
|
+
<script src="link-check.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1704
|
+
<script src="network.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1705
|
+
<script src="operations.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1706
|
+
<script src="workflow.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1707
|
+
<script src="sponsor-entry.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1708
|
+
<script src="relay-devices.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1709
|
+
<script src="relay-settings.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1710
|
+
<script src="subagents.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1711
|
+
<script src="session-presets.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1712
|
+
<script src="permission-presets.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1713
|
+
<script src="approval-records.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1714
|
+
<script src="approval-summary.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1715
|
+
<script src="doctor-entry.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1716
|
+
<script src="onboarding.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1717
|
+
<link rel="stylesheet" href="file-inbox.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1718
|
+
<script src="file-inbox.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1719
|
+
<link rel="stylesheet" href="session-deck.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1720
|
+
<script src="session-deck.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1721
|
+
<link rel="stylesheet" href="composer-tools.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1722
|
+
<link rel="stylesheet" href="session-search.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1723
|
+
<link rel="stylesheet" href="session-management.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1724
|
+
<link rel="stylesheet" href="plan-review.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1725
|
+
<link rel="stylesheet" href="turn-diff.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1726
|
+
<link rel="stylesheet" href="bc-integration.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
1727
|
+
<script src="lan-discovery.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1728
|
+
<script src="cache-upgrade.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1729
|
+
<script src="slash-suggestions.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1730
|
+
<script src="host-queue.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1731
|
+
<script src="host-schedule.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1732
|
+
<script src="composer-tools.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1733
|
+
<script src="session-search.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1734
|
+
<script src="session-management.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1735
|
+
<script src="plan-review.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1736
|
+
<script src="turn-diff.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1737
|
+
<script src="app.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
1736
1738
|
</body>
|
|
1737
1739
|
</html>
|
package/public/plan-review.js
CHANGED
|
@@ -105,8 +105,11 @@
|
|
|
105
105
|
const connected = snap.connected !== false
|
|
106
106
|
const readOnly = snap.readOnly === true
|
|
107
107
|
const supported = capability === true || (capability !== false && plan.supported)
|
|
108
|
+
// A plan is only "known" when the Host says it is active or a switch/review is pending.
|
|
109
|
+
// Disconnected sessions must not surface a stale Plan card when neither is true.
|
|
110
|
+
const exists = plan.supported && (plan.active || plan.pending)
|
|
108
111
|
const state = {
|
|
109
|
-
supported, connected, readOnly,
|
|
112
|
+
supported, connected, readOnly, exists,
|
|
110
113
|
active: plan.active, pending: plan.pending, target: plan.target,
|
|
111
114
|
status: 'unsupported', label: '', hint: '', action: null,
|
|
112
115
|
}
|
|
@@ -260,6 +263,8 @@
|
|
|
260
263
|
|
|
261
264
|
function statusHtml(view) {
|
|
262
265
|
const state = view.plan
|
|
266
|
+
// There is nothing to show while disconnected and no plan was ever active or pending.
|
|
267
|
+
if (state.status === 'disconnected' && !state.exists) return ''
|
|
263
268
|
const reviewClass = view.review ? ' dr-plan-status--review' : ''
|
|
264
269
|
const action = state.action
|
|
265
270
|
const button = action
|
|
@@ -337,6 +342,22 @@
|
|
|
337
342
|
return `<div class="dr-plan" data-dr-plan-root>${statusHtml(view)}${noticeHtml(view)}${reviewHtml(view)}${historyHtml(view.plans)}</div>`
|
|
338
343
|
}
|
|
339
344
|
|
|
345
|
+
/**
|
|
346
|
+
* Whether the plan section has anything meaningful to show. Kept outside the
|
|
347
|
+
* DOM so the app can hide the whole section when a disconnected session has
|
|
348
|
+
* no plan and no review/history to display.
|
|
349
|
+
*/
|
|
350
|
+
function hasContent(view) {
|
|
351
|
+
if (!view || typeof view !== 'object') return false
|
|
352
|
+
if (view.review) return true
|
|
353
|
+
if (Array.isArray(view.plans) && view.plans.length) return true
|
|
354
|
+
const plan = view.plan
|
|
355
|
+
if (!plan || typeof plan !== 'object') return false
|
|
356
|
+
if (!plan.supported) return plan.status === 'unsupported'
|
|
357
|
+
if (plan.status === 'disconnected') return plan.exists === true
|
|
358
|
+
return true
|
|
359
|
+
}
|
|
360
|
+
|
|
340
361
|
/* --------------------------------------------------------------- controller */
|
|
341
362
|
|
|
342
363
|
function create(adapter) {
|
|
@@ -612,7 +633,7 @@
|
|
|
612
633
|
|
|
613
634
|
const api = {
|
|
614
635
|
MAX_HISTORY,
|
|
615
|
-
normalizePlan, describePlan, planReviewOf, reviewFromFrame, historyPlans,
|
|
636
|
+
normalizePlan, describePlan, planReviewOf, reviewFromFrame, historyPlans, hasContent,
|
|
616
637
|
statusHtml, reviewHtml, historyHtml, noticeHtml, viewHtml,
|
|
617
638
|
create, init: create, bind, esc, firstHeading,
|
|
618
639
|
}
|
package/public/plugin.html
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
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, viewport-fit=cover">
|
|
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="setup.css?dsr-build=
|
|
11
|
-
<link rel="stylesheet" href="insights.css?dsr-build=
|
|
12
|
-
<link rel="stylesheet" href="remote-ui.css?dsr-build=
|
|
13
|
-
<link rel="stylesheet" href="doctor.css?dsr-build=
|
|
14
|
-
<link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=
|
|
15
|
-
<link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=
|
|
16
|
-
<link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=
|
|
17
|
-
<link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=
|
|
18
|
-
<link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=
|
|
19
|
-
<link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=
|
|
20
|
-
<link rel="stylesheet" href="skins/kita/skin.css?dsr-build=
|
|
21
|
-
<link rel="stylesheet" href="skins/penguin-logistics/skin.css?dsr-build=
|
|
22
|
-
<link rel="stylesheet" href="skins/miku/skin.css?dsr-build=
|
|
9
|
+
<link rel="stylesheet" href="theme-vars.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
10
|
+
<link rel="stylesheet" href="setup.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
11
|
+
<link rel="stylesheet" href="insights.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
12
|
+
<link rel="stylesheet" href="remote-ui.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
13
|
+
<link rel="stylesheet" href="doctor.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
14
|
+
<link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
15
|
+
<link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
16
|
+
<link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
17
|
+
<link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
18
|
+
<link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
19
|
+
<link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
20
|
+
<link rel="stylesheet" href="skins/kita/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
21
|
+
<link rel="stylesheet" href="skins/penguin-logistics/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
22
|
+
<link rel="stylesheet" href="skins/miku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
23
23
|
<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"],html[data-theme="miku"]{color-scheme:light}</style>
|
|
24
24
|
</head>
|
|
25
25
|
<body class="remote-panel-body">
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
</section>
|
|
55
55
|
<footer class="plugin-foot"><span id="plugin-version">—</span><a id="plugin-about" href="/remote/admin/#remote/settings" target="_blank" rel="noopener">关于与支持</a></footer>
|
|
56
56
|
</main>
|
|
57
|
-
<script src="i18n.js?dsr-build=
|
|
58
|
-
<script src="vendor/gsap/gsap.min.js?dsr-build=
|
|
59
|
-
<script src="motion.js?dsr-build=
|
|
60
|
-
<script type="module" src="morphicons-init.js?dsr-build=
|
|
61
|
-
<script src="qrcode.min.js?dsr-build=
|
|
62
|
-
<script src="remote-state.js?dsr-build=
|
|
63
|
-
<script src="remote-ui.js?dsr-build=
|
|
64
|
-
<script src="setup.js?dsr-build=
|
|
65
|
-
<script src="insights.js?dsr-build=
|
|
66
|
-
<script src="plugin.js?dsr-build=
|
|
67
|
-
<script src="doctor.js?dsr-build=
|
|
68
|
-
<script src="doctor-entry.js?dsr-build=
|
|
57
|
+
<script src="i18n.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
58
|
+
<script src="vendor/gsap/gsap.min.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
59
|
+
<script src="motion.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
60
|
+
<script type="module" src="morphicons-init.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
61
|
+
<script src="qrcode.min.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
62
|
+
<script src="remote-state.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
63
|
+
<script src="remote-ui.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
64
|
+
<script src="setup.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
65
|
+
<script src="insights.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
66
|
+
<script src="plugin.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
67
|
+
<script src="doctor.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
68
|
+
<script src="doctor-entry.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
69
69
|
</body>
|
|
70
70
|
</html>
|
package/public/relay-autopair.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/* Bootstrap a device pairing through an authenticated, user-confirmed LAN host. */
|
|
2
2
|
;(function(root) {
|
|
3
3
|
'use strict'
|
|
4
|
+
if (root.DSH_REMOTE_E2EE_DISABLED === true) {
|
|
5
|
+
const disabled = async () => ({ ok: false, code: 'E2EE_DISABLED' })
|
|
6
|
+
root.DshRelayAutoPair = { offer: disabled, localUrl: () => '', logText: () => '', clearLog() {}, progress: () => undefined, pairedOrigin: () => '' }
|
|
7
|
+
return
|
|
8
|
+
}
|
|
4
9
|
const bridge = root.NativeE2ee, attempts = new Set(), pairedOrigins = new Map(), progress = new Map()
|
|
5
10
|
let busy = false
|
|
6
11
|
const text = (zh, en) => root.I18N?.lang === 'en' ? en : zh
|
package/public/relay-devices.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* Host-local device administration. Pairing secrets live only in this page's memory. */
|
|
2
2
|
;(function(root) {
|
|
3
3
|
'use strict'
|
|
4
|
+
if (root.DSH_REMOTE_E2EE_DISABLED === true) {
|
|
5
|
+
root.DshRelayDevices = { mount: () => null }
|
|
6
|
+
return
|
|
7
|
+
}
|
|
4
8
|
const text=(zh,en)=>root.I18N?.lang==='en'?en:zh
|
|
5
9
|
const make=(tag,value)=>{const e=document.createElement(tag);if(value)e.textContent=value;return e}
|
|
6
10
|
root.DshRelayDevices={mount(target,{connection,path,credentials}){
|
|
@@ -29,8 +33,8 @@
|
|
|
29
33
|
}
|
|
30
34
|
function valid(c){return !disposed&&c.valid()&&identity===JSON.stringify([c.endpoint,c.headers?.authorization||''])}
|
|
31
35
|
function render(){
|
|
32
|
-
panel.hidden=host?.canManageDevices!==true
|
|
33
|
-
enable.hidden=host?.e2ee?.enabled===true;manual.hidden
|
|
36
|
+
panel.hidden=host?.canManageDevices!==true||host?.e2ee?.allowed===false
|
|
37
|
+
enable.hidden=host?.e2ee?.allowed===false||host?.e2ee?.enabled===true;manual.hidden=host?.e2ee?.allowed===false||host?.e2ee?.enabled!==true;rotate.hidden=host?.e2ee?.allowed===false||!host?.configured
|
|
34
38
|
for(const b of [enable,refresh,rotate,create,label,days])b.disabled=busy
|
|
35
39
|
download.hidden=!pairing;list.replaceChildren()
|
|
36
40
|
for(const d of data?.devices||[]){
|
|
@@ -57,7 +61,7 @@
|
|
|
57
61
|
data=result;host={...host,...result};pairing=result.pairing||null
|
|
58
62
|
if(pairing)notice.textContent=text('配对已创建。请立即保存文件并安全传到对应设备;文件包含访问凭据,不能公开。创建或撤销会短暂断开其他中转连接。','Pairing created. Save it now and transfer it securely to the intended device. It contains access credentials. Creating or revoking a device briefly disconnects other relay clients.')
|
|
59
63
|
else if(value)notice.textContent=text('已保存。中转连接会重新建立;已受理任务继续运行。','Saved. Relay connections will reconnect; accepted tasks continue.')
|
|
60
|
-
}catch(error){if(valid(c))notice.textContent=error.message==='E2EE_DISABLED_BY_POLICY'?text('主机环境已明确关闭加密,请先在主机取消 DSH_REMOTE_RELAY_E2EE=0 并重启网关。','The host environment disables encryption. Remove DSH_REMOTE_RELAY_E2EE=0 and restart the gateway first.'):text('未能确认结果,请刷新设备列表后再决定是否重试。错误:','Result unconfirmed. Refresh the device list before deciding whether to retry. Error: ')+error.message}
|
|
64
|
+
}catch(error){if(valid(c))notice.textContent=error.message==='E2EE_DISABLED_BY_POLICY'?text('主机环境已明确关闭加密,请先在主机取消 DSH_REMOTE_RELAY_E2EE=0 并重启网关。','The host environment disables encryption. Remove DSH_REMOTE_RELAY_E2EE=0 and restart the gateway first.'):error.message==='E2EE_PLAN_REQUIRED'?text('当前套餐不含端到端加密;请开通或续费时选择流量包。','The current plan does not include end-to-end encryption. Choose a data pack when opening or renewing.'):text('未能确认结果,请刷新设备列表后再决定是否重试。错误:','Result unconfirmed. Refresh the device list before deciding whether to retry. Error: ')+error.message}
|
|
61
65
|
finally{clearTimeout(timer);if(valid(c)){busy=false;render()}}
|
|
62
66
|
}
|
|
63
67
|
form.addEventListener('submit',e=>{e.preventDefault();if(!label.value.trim())return;void run({action:'create-device',label:label.value.trim(),days:Number(days.value)})})
|