dsh-remote-plugin 0.8.3 → 0.8.4

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.
Files changed (48) hide show
  1. package/apk/dsh-remote.apk +0 -0
  2. package/approval-summary.mjs +115 -0
  3. package/gateway.cjs +642 -16
  4. package/index.mjs +12 -0
  5. package/insights.mjs +1 -1
  6. package/package.json +2 -1
  7. package/plugin-center.mjs +88 -17
  8. package/plugin-transaction.mjs +19 -3
  9. package/public/admin.html +30 -28
  10. package/public/admin.js +1 -1
  11. package/public/announcements.json +31 -0
  12. package/public/app.js +40 -47
  13. package/public/approval-summary.js +78 -0
  14. package/public/build.json +2 -2
  15. package/public/cache-upgrade.js +51 -0
  16. package/public/chat-copy.js +34 -21
  17. package/public/desktop/desktop.css +18 -39
  18. package/public/desktop/desktop.html +70 -96
  19. package/public/desktop/desktop.js +15 -42
  20. package/public/e2ee-transport.js +147 -0
  21. package/public/extensions.js +6 -6
  22. package/public/history.js +48 -1
  23. package/public/index.html +74 -93
  24. package/public/md.js +36 -18
  25. package/public/motion.js +1 -1
  26. package/public/plugin-center.css +1 -0
  27. package/public/plugin-center.js +92 -11
  28. package/public/plugin.html +25 -24
  29. package/public/relay-devices.js +74 -0
  30. package/public/relay-settings.css +7 -0
  31. package/public/relay-settings.js +11 -4
  32. package/public/session-deck.css +7 -1
  33. package/public/session-deck.js +1 -1
  34. package/public/skins/blue-fish/preview.html +3 -2
  35. package/public/skins/bocchi/preview.html +5 -4
  36. package/public/skins/kita/preview.html +6 -5
  37. package/public/skins/nijika/preview.html +6 -5
  38. package/public/skins/penguin/preview.html +3 -2
  39. package/public/skins/ryo/preview.html +6 -5
  40. package/public/sponsor-entry.js +20 -21
  41. package/public/styles.css +24 -24
  42. package/public/teams.js +2 -2
  43. package/public/update.json +8 -8
  44. package/public/version.json +1 -1
  45. package/public/workflow.js +3 -4
  46. package/skills/dsh-remote-doctor/references/wiki/plugins.md +1 -1
  47. package/task-board.mjs +2 -2
  48. package/teams.mjs +7 -2
@@ -1,22 +1,23 @@
1
1
  <!doctype html>
2
2
  <html lang="zh-CN">
3
3
  <head>
4
+ <meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
4
5
  <meta charset="utf-8">
5
6
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
6
7
  <title>DSH Remote</title>
7
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='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
8
- <link rel="stylesheet" href="theme-vars.css">
9
- <link rel="stylesheet" href="setup.css">
10
- <link rel="stylesheet" href="insights.css">
11
- <link rel="stylesheet" href="remote-ui.css">
12
- <link rel="stylesheet" href="doctor.css">
13
- <link rel="stylesheet" href="skins/blue-fish/skin.css">
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">
9
+ <link rel="stylesheet" href="theme-vars.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
10
+ <link rel="stylesheet" href="setup.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
11
+ <link rel="stylesheet" href="insights.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
12
+ <link rel="stylesheet" href="remote-ui.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
13
+ <link rel="stylesheet" href="doctor.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
14
+ <link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
15
+ <link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
16
+ <link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
17
+ <link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
18
+ <link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
19
+ <link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
20
+ <link rel="stylesheet" href="skins/kita/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
20
21
  <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>
21
22
  </head>
22
23
  <body class="remote-panel-body">
@@ -51,17 +52,17 @@
51
52
  </section>
52
53
  <footer class="plugin-foot"><span id="plugin-version">—</span><a id="plugin-about" href="/remote/admin/#remote/settings" target="_blank" rel="noopener">关于与支持</a></footer>
53
54
  </main>
54
- <script src="i18n.js"></script>
55
- <script src="vendor/gsap/gsap.min.js"></script>
56
- <script src="motion.js"></script>
57
- <script type="module" src="morphicons-init.js"></script>
58
- <script src="qrcode.min.js"></script>
59
- <script src="remote-state.js"></script>
60
- <script src="remote-ui.js"></script>
61
- <script src="setup.js"></script>
62
- <script src="insights.js"></script>
63
- <script src="plugin.js"></script>
64
- <script src="doctor.js"></script>
65
- <script src="doctor-entry.js"></script>
55
+ <script src="i18n.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
56
+ <script src="vendor/gsap/gsap.min.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
57
+ <script src="motion.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
58
+ <script type="module" src="morphicons-init.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
59
+ <script src="qrcode.min.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
60
+ <script src="remote-state.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
61
+ <script src="remote-ui.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
62
+ <script src="setup.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
63
+ <script src="insights.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
64
+ <script src="plugin.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
65
+ <script src="doctor.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
66
+ <script src="doctor-entry.js?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></script>
66
67
  </body>
67
68
  </html>
@@ -0,0 +1,74 @@
1
+ /* Host-local device administration. Pairing secrets live only in this page's memory. */
2
+ ;(function(root) {
3
+ 'use strict'
4
+ const text=(zh,en)=>root.I18N?.lang==='en'?en:zh
5
+ const make=(tag,value)=>{const e=document.createElement(tag);if(value)e.textContent=value;return e}
6
+ root.DshRelayDevices={mount(target,{connection,path,credentials}){
7
+ const title=make('h3',text('中转设备与配对','Relay devices and pairing'))
8
+ const hint=make('p',text('设备管理请在主机本地地址打开。每台设备独立配对,最长有效 30 天;到期后重新创建并导入。浏览器暂不支持此加密入口。','Open a local host address to manage devices. Each device has a separate pairing valid for up to 30 days. Create and import a new pairing after expiry. This encrypted entry does not support browsers yet.'))
9
+ const panel=make('div'),enable=make('button',text('启用主机加密入口','Enable encrypted host entry')),refresh=make('button',text('刷新设备','Refresh devices'))
10
+ const form=make('form'),label=make('input'),days=make('select'),create=make('button',text('创建设备配对','Create device pairing'))
11
+ form.className='relay-device-form'
12
+ label.placeholder=text('设备名称,例如:我的手机','Device name, e.g. My phone');label.maxLength=80;label.required=true;label.setAttribute('aria-label',label.placeholder)
13
+ days.setAttribute('aria-label',text('配对有效期','Pairing validity'))
14
+ for(const n of [7,14,30]){const option=make('option',text(n+' 天',n+' days'));option.value=String(n);days.append(option)}
15
+ days.value='30';create.type='submit';form.append(label,days,create)
16
+ const list=make('div'),rotate=make('button',text('更换主机证书并清除全部配对','Rotate host certificate and clear all pairings'))
17
+ const notice=make('p'),download=make('button',text('保存配对文件(仅本次可用)','Save pairing file (available this time only)'))
18
+ notice.setAttribute('role','status');download.hidden=true
19
+ for(const b of [enable,refresh,rotate,download])b.type='button'
20
+ panel.append(enable,form,refresh,list,rotate,download);target.append(title,hint,panel,notice)
21
+ let host=null,data=null,identity='',busy=false,abort=null,pairing=null,disposed=false
22
+ function ctx(){
23
+ const c=connection(),endpoint=new URL(c.url(path.replace(/\/e2ee$/,'')),root.location?.href||'http://localhost/')
24
+ // Workflow adapters may return a fixed relay endpoint regardless of route.
25
+ endpoint.pathname=endpoint.pathname.replace(/\/$/,'')+'/e2ee'
26
+ return {...c,endpoint:endpoint.href}
27
+ }
28
+ function valid(c){return !disposed&&c.valid()&&identity===JSON.stringify([c.endpoint,c.headers?.authorization||''])}
29
+ function render(){
30
+ panel.hidden=host?.canManageDevices!==true
31
+ enable.hidden=host?.e2ee?.enabled===true;form.hidden=!host?.e2ee?.enabled;rotate.hidden=!host?.configured
32
+ for(const b of [enable,refresh,rotate,create,label,days])b.disabled=busy
33
+ download.hidden=!pairing;list.replaceChildren()
34
+ for(const d of data?.devices||[]){
35
+ const row=make('div');row.className='relay-device-row'
36
+ const name=make('span',d.label+' · '+(d.active?text('有效至 ','Valid until ')+new Date(d.expiresAt).toLocaleString():d.revokedAt?text('已撤销','Revoked'):text('已到期','Expired')))
37
+ const revoke=make('button',text('撤销','Revoke'));revoke.type='button';revoke.disabled=busy||!d.active
38
+ revoke.addEventListener('click',()=>{if(root.confirm(text('撤销此设备?连接会立即断开,需要新配对才能再次访问。\n','Revoke this device? Its connections will close and a new pairing will be required.\n')+d.label))void run({action:'revoke-device',id:d.id})})
39
+ row.append(name,revoke);list.append(row)
40
+ }
41
+ if(data&&!data.devices?.length)list.append(make('p',text('尚无设备,请创建配对后在 Android App 导入。','No devices. Create a pairing and import it in the Android app.')))
42
+ }
43
+ async function run(value){
44
+ const c=ctx();if(busy||host?.canManageDevices!==true)return
45
+ busy=true;abort?.abort();abort=new AbortController();const own=abort,timer=setTimeout(()=>own.abort(),20000)
46
+ pairing=null;notice.textContent='';render()
47
+ try{
48
+ const response=await root.fetch(c.endpoint,{method:value?'POST':'GET',headers:{...c.headers,...(value?{'content-type':'application/json'}:{})},credentials,cache:'no-store',signal:own.signal,...(value?{body:JSON.stringify(value)}:{})})
49
+ const result=await response.json();if(!valid(c))return
50
+ if(!response.ok)throw Error(result.error||'E2EE_OPERATION_FAILED')
51
+ data=result;host={...host,...result};pairing=result.pairing||null
52
+ 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.')
53
+ else if(value)notice.textContent=text('已保存。中转连接会重新建立;已受理任务继续运行。','Saved. Relay connections will reconnect; accepted tasks continue.')
54
+ }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}
55
+ finally{clearTimeout(timer);if(valid(c)){busy=false;render()}}
56
+ }
57
+ form.addEventListener('submit',e=>{e.preventDefault();if(!label.value.trim())return;void run({action:'create-device',label:label.value.trim(),days:Number(days.value)})})
58
+ refresh.addEventListener('click',()=>void run())
59
+ enable.addEventListener('click',()=>{if(root.confirm(text('启用后旧公网入口将停止使用,需要先为 Android 创建并导入配对。当前中转连接会断开,请保留本地管理页面。','Enabling disables the legacy public entry. Create and import an Android pairing. Relay clients will disconnect; keep this local management page open.')))void run({action:'enable-encryption'})})
60
+ rotate.addEventListener('click',()=>{if(root.confirm(text('确认更换主机证书?全部现有配对立即失效,所有设备需要重新配对。此操作无法撤销。','Rotate the host certificate? All existing pairings become invalid and every device must pair again. This cannot be undone.')))void run({action:'rotate-identity',confirm:'REPAIR_ALL_DEVICES'})})
61
+ download.addEventListener('click',()=>{
62
+ if(!pairing)return
63
+ const url=URL.createObjectURL(new Blob([JSON.stringify(pairing,null,2)+'\n'],{type:'application/json'})),a=make('a')
64
+ a.href=url;a.download='dsh-remote-device-'+pairing.deviceId+'.json';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000)
65
+ })
66
+ return {update(value){
67
+ const c=ctx(),next=JSON.stringify([c.endpoint,c.headers?.authorization||''])
68
+ if(next!==identity){abort?.abort();identity=next;host=null;data=null;pairing=null;busy=false;label.value='';notice.textContent=''}
69
+ const first=value?.canManageDevices===true&&host?.canManageDevices!==true
70
+ // Keep fresh device-operation state until the next host status read.
71
+ host=value;render();if(first)void run()
72
+ },destroy(){disposed=true;abort?.abort();pairing=null;data=null;label.value='';list.replaceChildren()}}
73
+ }}
74
+ })(typeof window!=='undefined'?window:globalThis)
@@ -1,2 +1,9 @@
1
1
  .relay-settings{margin:18px 0;padding:20px;border:1px solid var(--dsr-line,var(--border,#ffffff20));border-radius:16px;background:var(--dsr-panel,var(--bg-card,transparent));color:inherit;min-width:0}
2
+ .relay-encryption-switch{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14px}.relay-encryption-switch input{width:20px;height:20px;accent-color:var(--dsr-accent,var(--accent,#527dab))}.relay-encryption-status{font-size:13px;line-height:1.65;overflow-wrap:anywhere}.relay-encryption-status[data-security=legacy]{padding:12px;border:1px solid var(--warning,#d98758);border-radius:9px;color:var(--warning,#d98758)}
3
+ .relay-sponsor{margin:14px 0;padding:14px;border:1px solid var(--dsr-accent-line,var(--border,#ffffff25));border-radius:10px;background:var(--dsr-accent-soft,#527dab18);font-size:13px;line-height:1.7}.relay-sponsor .sponsor-entry{margin:0}.sponsor-entry a{color:var(--dsr-accent-strong,var(--accent,#6ea9e8));font-weight:600}.sponsor-entry span{display:block;font-size:12px;opacity:.75;margin-top:5px}
2
4
  .relay-settings [hidden]{display:none!important}.relay-heading,.relay-address,.relay-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.relay-heading{justify-content:space-between}.relay-heading h3{font-size:16px;line-height:1.4;margin:0}.relay-badge{font-size:12px;padding:5px 9px;border-radius:20px;background:#77889920}.relay-badge[data-phase=online]{background:#36b48522;color:var(--success,#35b58a)}.relay-badge[data-phase=quota-exceeded],.relay-badge[data-phase=error]{background:#da704522;color:var(--warning,#d98758)}.relay-muted{font-size:12px;line-height:1.65;opacity:.7;margin:10px 0}.relay-status,.relay-notice,.relay-quota p{font-size:13px;line-height:1.6}.relay-address{padding:12px 0}.relay-address a{color:var(--dsr-accent,var(--accent,#6ea9e8));overflow-wrap:anywhere;flex:1;min-width:120px}.relay-form{display:grid;gap:12px;padding:12px 0}.relay-form label{display:grid;gap:7px;font-size:13px}.relay-form input{width:100%;box-sizing:border-box;min-height:44px;border:1px solid var(--dsr-line,var(--border,#ffffff25));background:transparent;color:inherit;border-radius:9px;padding:10px 12px;font:inherit}.relay-settings button{min-height:44px;border:1px solid var(--dsr-line,var(--border,#ffffff25));border-radius:9px;padding:9px 14px;font:inherit;font-size:13px;cursor:pointer;background:transparent;color:inherit}.relay-settings .relay-primary{background:var(--dsr-accent,var(--accent,#527dab));color:var(--dsr-bg,#fff);justify-self:start;border-color:transparent}.relay-settings button:disabled{opacity:.5;cursor:default}.relay-settings :focus-visible{outline:2px solid var(--dsr-accent,var(--accent,#6ea9e8));outline-offset:3px}.relay-quota progress{display:block;width:100%;height:7px;accent-color:var(--dsr-accent,var(--accent,#6ea9e8))}.relay-notice:empty{display:none}.relay-notice{padding:10px 12px;border-radius:9px;background:#71839c16}.relay-actions{margin-top:6px}@media(max-width:480px){.relay-settings{padding:16px}.relay-heading{align-items:flex-start}.relay-address{align-items:flex-start}.relay-form .relay-primary{width:100%;justify-self:stretch}}
5
+ .relay-device-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0;overflow-wrap:anywhere}
6
+ .relay-device-row>span{min-width:0}
7
+ .relay-device-form{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
8
+ .relay-device-form input{min-width:0;flex:1 1 180px}
9
+ .relay-device-form input,.relay-device-form select{min-height:44px;background:var(--dsr-panel,var(--bg-card,transparent));color:inherit;border:1px solid var(--dsr-line,var(--border,#77889950));border-radius:9px;padding:8px;box-sizing:border-box}
@@ -20,16 +20,19 @@
20
20
  const heading=el('div','relay-heading'),title=el('h3'),badge=el('span','relay-badge')
21
21
  heading.append(title,badge)
22
22
  const intro=el('p','relay-muted'),status=el('p','relay-status');status.setAttribute('aria-live','polite')
23
+ const sponsor=el('div','relay-sponsor');root.DshSponsor?.mount(sponsor)
23
24
  const address=el('div','relay-address'),link=el('a'),copy=el('button');copy.type='button';link.target='_blank';link.rel='noopener noreferrer';address.append(link,copy)
24
25
  const quota=el('div','relay-quota'),meter=el('progress'),usage=el('p'),reset=el('p','relay-muted');meter.max=100;quota.append(usage,meter,reset)
25
- const binding=el('p','relay-muted'),form=el('form','relay-form'),keyLabel=el('label'),keyInput=el('input')
26
+ const plan=el('p','relay-muted'),binding=el('p','relay-muted'),form=el('form','relay-form'),keyLabel=el('label'),keyInput=el('input')
26
27
  keyInput.type='password';keyInput.autocomplete='off';keyInput.spellcheck=false;keyInput.maxLength=128;keyInput.name='relay-key'
27
28
  keyLabel.append(el('span'),keyInput)
28
29
  const adminLabel=el('label'),adminInput=el('input');adminInput.type='password';adminInput.autocomplete='off';adminInput.name='relay-admin';adminLabel.append(el('span'),adminInput)
29
30
  const submit=el('button','relay-primary');submit.type='submit';form.append(keyLabel,adminLabel,submit)
30
31
  const actions=el('div','relay-actions'),toggle=el('button'),refresh=el('button'),takeover=el('button');toggle.type=refresh.type=takeover.type='button';actions.append(takeover,toggle,refresh)
31
32
  const hint=el('p','relay-muted'),notice=el('p','relay-notice');notice.setAttribute('role','status')
32
- target.append(heading,intro,status,address,quota,binding,form,actions,hint,notice)
33
+ target.append(heading,intro,sponsor,status,address,plan,quota,binding,form,actions,hint,notice)
34
+ const deviceTarget=el('div');target.append(deviceTarget)
35
+ const devices=root.DshRelayDevices?.mount(deviceTarget,{connection,path:path+'/e2ee',credentials})
33
36
  let identity='',value=null,lastRead=0,busy=false,loading=false,controller=null,destroyed=false,readError=false,failures=0
34
37
  function context() { const ctx=connection();return { ...ctx, endpoint:ctx.url(path) } }
35
38
  function current(ctx) { return !destroyed && ctx.valid() && identity===JSON.stringify([ctx.endpoint,ctx.headers?.authorization||'']) }
@@ -39,6 +42,8 @@
39
42
  return ctx
40
43
  }
41
44
  function render() {
45
+ devices?.update(value)
46
+ root.DshSponsor?.mount(sponsor)
42
47
  title.textContent=text('云服务器中转','Cloud relay')
43
48
  intro.textContent=text('让手机通过公网连接这台主机。每位用户使用自己的中转密钥,首次开通会绑定此主机。','Connect to this host over the internet. Your personal relay key binds to this host when activated.')
44
49
  const phase=value?.phase||(readError?'unavailable':loading?'loading':'unconfigured')
@@ -49,6 +54,8 @@
49
54
  try { const url=new URL(value?.publicUrl);if(url.protocol==='https:'&&!url.username&&!url.password)safeUrl=url.origin } catch {}
50
55
  address.hidden=!safeUrl;link.textContent=safeUrl;link.href=safeUrl||'#';copy.textContent=text('复制地址','Copy URL')
51
56
  const daily=value?.daily
57
+ plan.hidden=value?.quotaPeriod!=='month'&&daily?.period!=='month'
58
+ plan.textContent=plan.hidden?'':text('基础中转 · 一个服务月 5GB · 单网关绑定 · 支持对话图片,不含文件传输。','Basic relay · 5GB per service month · One gateway · Chat images supported; file transfer excluded.')
52
59
  quota.hidden=!daily
53
60
  if(daily?.unavailable){usage.textContent=text('无法确认流量额度,云端暂停传输。','Quota unavailable; cloud transfer is paused.');meter.hidden=true;reset.textContent=''}
54
61
  else if(daily){
@@ -70,7 +77,7 @@
70
77
  toggle.hidden=!value?.configured;toggle.disabled=busy;toggle.textContent=text(value?.enabled?'停用中转':'开启中转',value?.enabled?'Disable relay':'Enable relay')
71
78
  refresh.textContent=text('刷新状态','Refresh');refresh.disabled=busy||loading
72
79
  takeover.hidden=!value?.legacyAvailable;takeover.disabled=busy;takeover.textContent=text('接管已有试用连接','Take over existing trial')
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.')
80
+ hint.textContent=value?.quotaPending?text('等待云端确认流量额度…','Waiting for cloud quota…'):value?.e2ee?.configured?text('请先在 App 导入主机本地的配对文件。端到端加密默认开启;关闭前须确认风险,普通浏览器暂不支持此配对入口。','Import the host’s local pairing file in the app. End-to-end encryption is on by default; disabling requires confirmation. Ordinary browsers do not support this paired entry.'):text('手机使用此公网地址和原 Remote 访问令牌。停用会断开通过此入口的连接;授权到期或用满后,请通过本地地址管理。','Use this URL and your existing Remote access token. Disabling disconnects this route; use a local address after expiry or quota exhaustion.')
74
81
  }
75
82
  async function load(force=false) {
76
83
  const ctx=syncIdentity()
@@ -123,7 +130,7 @@
123
130
  })
124
131
  function tick(){if(destroyed)return;syncIdentity();render();void load()}
125
132
  const timer=setInterval(tick,1000);tick()
126
- return { refresh:()=>load(true),destroy:()=>{destroyed=true;clearInterval(timer);controller?.abort();keyInput.value='';adminInput.value=''} }
133
+ return { refresh:()=>load(true),destroy:()=>{destroyed=true;clearInterval(timer);controller?.abort();devices?.destroy();keyInput.value='';adminInput.value=''} }
127
134
  }
128
135
  root.DshRelaySettings={mount}
129
136
  })(typeof window!=='undefined'?window:globalThis)
@@ -54,7 +54,7 @@
54
54
  .deck-argument-preview { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--dsr-muted); font-size:11px; line-height:1.5; }
55
55
  .deck-review-footer { display:flex; flex-wrap:wrap; align-items:flex-start; gap:6px; margin-top:7px; }
56
56
  .deck-review-footer > .deck-more { margin-left:auto; }
57
- .deck-decision { min-height:36px; padding:5px 11px; border:1px solid var(--dsr-line); border-radius:9px; background:var(--dsr-panel); color:var(--dsr-text); font:inherit; font-size:12px; cursor:pointer; }
57
+ .deck-decision { min-height:44px; padding:8px 12px; border:1px solid var(--dsr-line); border-radius:9px; background:var(--dsr-panel); color:var(--dsr-text); font:inherit; font-size:12px; cursor:pointer; }
58
58
  .deck-decision.primary { color:var(--dsr-accent-strong); background:var(--dsr-accent-soft); border-color:var(--dsr-accent-line); }
59
59
  .deck-decision:focus-visible,.deck-more > summary:focus-visible { outline:2px solid var(--dsr-accent); outline-offset:2px; }
60
60
  .session-deck .question-summary,.session-deck .ds-question-summary { -webkit-line-clamp:2; }
@@ -70,4 +70,10 @@
70
70
  .ds-view .session-deck [data-deck-kind="todos"] > .deck-more { grid-column:2; grid-row:1 / 3; align-self:center; }
71
71
  }
72
72
  .session-deck-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
73
+ .approval-ai { grid-column:1; min-width:0; margin:8px 0; padding:8px 0; border-top:1px solid var(--dsr-line); }
74
+ .approval-ai .deck-summary-button { min-height:44px; padding:8px 12px; border:1px solid var(--dsr-line); border-radius:8px; color:var(--dsr-muted); background:var(--dsr-panel); font:inherit; font-size:12px; cursor:pointer; }
75
+ .approval-ai .deck-summary-button:disabled { opacity:.65; cursor:default; }
76
+ .approval-ai .deck-summary-button:focus-visible { outline:2px solid var(--dsr-accent); outline-offset:2px; }
77
+ .approval-ai-copy { margin:6px 0 0; color:var(--dsr-muted); font-size:12px; line-height:1.65; overflow-wrap:anywhere; }
78
+ .session-deck[data-mounted] [data-session-approval][data-deck-active]:has(.approval-ai) { max-height:min(42dvh,320px); }
73
79
  @media(max-width:360px) { .session-deck-tab { padding:5px 7px; font-size:11px; } .session-deck-control { width:26px; } }
@@ -47,7 +47,7 @@
47
47
  if (args && typeof args === 'object') {
48
48
  for (const key of ['command', 'cmd', 'script', 'path', 'file_path', 'url']) if (typeof args[key] === 'string' && args[key]) { preview = (['command', 'cmd', 'script'].includes(key) ? text('命令', 'Command') : key === 'url' ? text('地址', 'URL') : text('路径', 'Path')) + ': ' + args[key]; break }
49
49
  } else if (typeof args === 'string') preview = args
50
- return `<div class="deck-review-head"><strong>${esc(item.toolName || text('工具调用', 'Tool call'))}</strong>${badge ? `<span class="deck-review-badge">${esc(badge)}</span>` : ''}</div><p class="deck-review-reason">${esc(reason || text('主机未提供申请原因', 'The host provided no reason'))}</p>${preview ? `<div class="deck-argument-preview" title="${esc(preview)}">${esc(preview)}</div>` : ''}<div class="deck-review-footer"><button type="button" class="deck-decision primary" data-session-approve="1">${text('允许一次', 'Allow once')}</button><button type="button" class="deck-decision" data-session-approve="0">${text('拒绝', 'Reject')}</button><details class="deck-more" data-deck-details="approval"><summary>${text('完整请求', 'Full request')}</summary><pre class="deck-full-content">${esc(text('工具:', 'Tool: ') + (item.toolName || '') + '\n' + fullDetail)}</pre></details></div>`
50
+ return `<div class="deck-review-head"><strong>${esc(item.toolName || text('工具调用', 'Tool call'))}</strong>${badge ? `<span class="deck-review-badge">${esc(badge)}</span>` : ''}</div><p class="deck-review-reason">${esc(reason || text('主机未提供申请原因', 'The host provided no reason'))}</p>${preview ? `<div class="deck-argument-preview" title="${esc(preview)}">${esc(preview)}</div>` : ''}${root.DshApprovalSummary?.html(item) || ''}<div class="deck-review-footer"><button type="button" class="deck-decision primary" data-session-approve="1">${text('允许一次', 'Allow once')}</button><button type="button" class="deck-decision" data-session-approve="0">${text('拒绝', 'Reject')}</button><details class="deck-more" data-deck-details="approval"><summary>${text('完整请求', 'Full request')}</summary><pre class="deck-full-content">${esc(text('工具:', 'Tool: ') + (item.toolName || '') + '\n' + fullDetail)}</pre></details></div>`
51
51
  }
52
52
  let instance
53
53
  function mount(config) {
@@ -1,4 +1,5 @@
1
- <!doctype html><html lang="zh-CN" data-theme="fish"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>蓝色大肥鱼 · 晴空海湾 · 组件预览</title><link rel="stylesheet" href="../../styles.css"><link rel="stylesheet" href="../../workflow.css"><link rel="stylesheet" href="skin.css"><style>body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-header{margin-bottom:26px}.preview-header h1{font-size:29px;line-height:1.3;margin:10px 0}.preview-header p{font-size:14px;max-width:680px;color:var(--dsr-muted)}.preview-layout{display:grid;grid-template-columns:390px minmax(0,1fr);gap:26px;align-items:start}iframe{display:block;width:100%;height:844px;border:1px solid var(--dsr-line);border-radius:18px;background:var(--dsr-bg)}.preview-card{padding:22px;margin:0 0 18px;background:var(--dsr-panel);border:1px solid var(--dsr-line);border-radius:12px}.preview-card h2{font-size:17px;margin:0 0 14px}.preview-card p,.preview-card li{font-size:13px;line-height:1.8;color:var(--dsr-muted)}.preview-icons{display:flex;align-items:center;gap:18px}.preview-icons img{width:58px;height:54px;object-fit:contain}.preview-links,.preview-switch{display:flex;gap:12px;flex-wrap:wrap;font-size:13px;margin:12px 0}.preview-links a{color:var(--dsr-accent-strong)}.preview-switch button{padding:8px 16px;border:1px solid var(--dsr-line);border-radius:8px;background:var(--dsr-panel);color:var(--dsr-text);font:inherit}.preview-switch button[aria-pressed=true]{background:var(--dsr-accent);color:var(--dsr-on-accent)}@media(max-width:760px){.preview-layout{grid-template-columns:minmax(0,390px);justify-content:center}.preview-header h1{font-size:25px}}</style></head><body><main class="preview-shell"><header class="preview-header"><h1>蓝色大肥鱼 · 晴空海湾</h1><p>气泡、爱心、星星与蓝白内容卡。表情导航保留文字,立绘增加柔和贴纸边框。</p><nav class="preview-links"><a href="DESIGN.md">皮肤维护说明</a><a href="../../index.html?layout=mobile">实际手机入口</a><a href="../../desktop/desktop.html">实际桌面入口</a></nav><div class="preview-switch" role="group" aria-label="预览配色"><button type="button" data-preview-theme="fish" aria-pressed="true">蓝色大肥鱼</button></div></header><section class="preview-layout"><iframe id="phone" title="手机组件预览"></iframe><aside><section class="preview-card"><h2>表情导航 · 文字保留</h2><div class="preview-icons"><img src="icon.png" alt="会话表情"><img src="icon-wink.png" alt="文件表情"><img src="icon-star.png" alt="更多表情"></div><p>表情在原有图标位内展示,不向列表上方额外挂一排头像。文字、未读徽标与原有点击区保留。</p></section><section class="preview-card"><h2>角色与阅读层级</h2><p>原有角色图片全部保留,加入眨眼贴纸、粉色导航小圆垫和虚线贴纸框。气泡与星星留在阅读留白处。</p></section><section class="preview-card"><h2>实际界面验收</h2><ol><li>320/390px 手机与桌面布局。</li><li>立绘不压住标题和连接入口。</li><li>导航、输入区保持既有固定定位。</li><li>归档关闭、半滑、展开与确认框。</li></ol><p>此页是无主机连接的静态组件样板;完整交互以实际 WebUI 验收为准。</p></section></aside></section></main><template id="phone-components">
1
+ <!doctype html><html lang="zh-CN" data-theme="fish"><head><meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
2
+ <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>蓝色大肥鱼 · 晴空海湾 · 组件预览</title><link rel="stylesheet" href="../../styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="../../workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><style>body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-header{margin-bottom:26px}.preview-header h1{font-size:29px;line-height:1.3;margin:10px 0}.preview-header p{font-size:14px;max-width:680px;color:var(--dsr-muted)}.preview-layout{display:grid;grid-template-columns:390px minmax(0,1fr);gap:26px;align-items:start}iframe{display:block;width:100%;height:844px;border:1px solid var(--dsr-line);border-radius:18px;background:var(--dsr-bg)}.preview-card{padding:22px;margin:0 0 18px;background:var(--dsr-panel);border:1px solid var(--dsr-line);border-radius:12px}.preview-card h2{font-size:17px;margin:0 0 14px}.preview-card p,.preview-card li{font-size:13px;line-height:1.8;color:var(--dsr-muted)}.preview-icons{display:flex;align-items:center;gap:18px}.preview-icons img{width:58px;height:54px;object-fit:contain}.preview-links,.preview-switch{display:flex;gap:12px;flex-wrap:wrap;font-size:13px;margin:12px 0}.preview-links a{color:var(--dsr-accent-strong)}.preview-switch button{padding:8px 16px;border:1px solid var(--dsr-line);border-radius:8px;background:var(--dsr-panel);color:var(--dsr-text);font:inherit}.preview-switch button[aria-pressed=true]{background:var(--dsr-accent);color:var(--dsr-on-accent)}@media(max-width:760px){.preview-layout{grid-template-columns:minmax(0,390px);justify-content:center}.preview-header h1{font-size:25px}}</style></head><body><main class="preview-shell"><header class="preview-header"><h1>蓝色大肥鱼 · 晴空海湾</h1><p>气泡、爱心、星星与蓝白内容卡。表情导航保留文字,立绘增加柔和贴纸边框。</p><nav class="preview-links"><a href="DESIGN.md">皮肤维护说明</a><a href="../../index.html?layout=mobile">实际手机入口</a><a href="../../desktop/desktop.html">实际桌面入口</a></nav><div class="preview-switch" role="group" aria-label="预览配色"><button type="button" data-preview-theme="fish" aria-pressed="true">蓝色大肥鱼</button></div></header><section class="preview-layout"><iframe id="phone" title="手机组件预览"></iframe><aside><section class="preview-card"><h2>表情导航 · 文字保留</h2><div class="preview-icons"><img src="icon.png" alt="会话表情"><img src="icon-wink.png" alt="文件表情"><img src="icon-star.png" alt="更多表情"></div><p>表情在原有图标位内展示,不向列表上方额外挂一排头像。文字、未读徽标与原有点击区保留。</p></section><section class="preview-card"><h2>角色与阅读层级</h2><p>原有角色图片全部保留,加入眨眼贴纸、粉色导航小圆垫和虚线贴纸框。气泡与星星留在阅读留白处。</p></section><section class="preview-card"><h2>实际界面验收</h2><ol><li>320/390px 手机与桌面布局。</li><li>立绘不压住标题和连接入口。</li><li>导航、输入区保持既有固定定位。</li><li>归档关闭、半滑、展开与确认框。</li></ol><p>此页是无主机连接的静态组件样板;完整交互以实际 WebUI 验收为准。</p></section></aside></section></main><template id="phone-components">
2
3
  <header class="topbar"><div class="brand"><span class="brand-dot"></span><span>DSH Remote</span></div><span class="pill">未连接</span></header>
3
4
  <main class="main" id="main"><section class="view" id="view-home">
4
5
  <section class="workflow-start"><div class="workflow-page-head"><h1>工作空间</h1><button type="button" class="workflow-connection">工作电脑 · 连接详情</button><button type="button" class="home-doctor"><span>AI 排查问题</span><small>使用你的 DSH 和模型,只读诊断</small><b>›</b></button></div><div class="workspace-nav"><span>DSH Remote</span><button type="button" class="mini-btn">查看文件</button></div><button type="button" id="btn-new-session" class="mini-btn workflow-new-session">+ 新会话</button></section>
@@ -8,4 +9,4 @@
8
9
  <div class="session-swipe"><div class="session-card"><div class="sc-title">准备版本更新说明</div><div class="sc-meta">3 分钟前</div><div class="sc-workspace">⌂ dsh-remote</div></div></div>
9
10
  </section></main>
10
11
  <nav class="bottom-nav"><button type="button" class="nav-btn active" data-view="view-home"><span class="nav-ico">▦</span><span class="nav-label">会话</span></button><button type="button" class="nav-btn" data-view="view-files"><span class="nav-ico">↕</span><span class="nav-label">文件</span></button><button type="button" class="nav-btn" data-view="view-settings"><span class="nav-ico">⚙</span><span class="nav-label">更多</span></button></nav>
11
- </template><script>const base=new URL('../../',location.href).href;const frame=document.getElementById('phone');frame.srcdoc='<!doctype html><html lang="zh-CN" data-theme="fish"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="workflow.css"><link rel="stylesheet" href="skins/blue-fish/skin.css"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>';document.querySelectorAll('[data-preview-theme]').forEach(button=>button.addEventListener('click',()=>{document.documentElement.dataset.theme=button.dataset.previewTheme;if(frame.contentDocument?.documentElement)frame.contentDocument.documentElement.dataset.theme=button.dataset.previewTheme;document.querySelectorAll('[data-preview-theme]').forEach(b=>b.setAttribute('aria-pressed',String(b===button)))}));</script></body></html>
12
+ </template><script>const base=new URL('../../',location.href).href;const frame=document.getElementById('phone');frame.srcdoc='<!doctype html><html lang="zh-CN" data-theme="fish"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/blue-fish/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>';document.querySelectorAll('[data-preview-theme]').forEach(button=>button.addEventListener('click',()=>{document.documentElement.dataset.theme=button.dataset.previewTheme;if(frame.contentDocument?.documentElement)frame.contentDocument.documentElement.dataset.theme=button.dataset.previewTheme;document.querySelectorAll('[data-preview-theme]').forEach(b=>b.setAttribute('aria-pressed',String(b===button)))}));</script></body></html>
@@ -1,12 +1,13 @@
1
1
  <!doctype html>
2
2
  <html lang="zh-CN" data-theme="bocchi">
3
3
  <head>
4
+ <meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
4
5
  <meta charset="utf-8">
5
6
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
7
  <title>后藤一里 · 皮肤样板预览</title>
7
- <link rel="stylesheet" href="../../styles.css">
8
- <link rel="stylesheet" href="../../workflow.css">
9
- <link rel="stylesheet" href="skin.css">
8
+ <link rel="stylesheet" href="../../styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
9
+ <link rel="stylesheet" href="../../workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
10
+ <link rel="stylesheet" href="skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
10
11
  <style>
11
12
  /* 只负责展示页排版;画框内完全复用实际组件样式,不重画玻璃或背景。 */
12
13
  body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-label{font:11px ui-monospace,monospace;letter-spacing:.15em;color:var(--dsr-muted)}
@@ -48,7 +49,7 @@
48
49
  </template>
49
50
  <script>
50
51
  const base=new URL('../../',location.href).href
51
- document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="bocchi"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="workflow.css"><link rel="stylesheet" href="skins/bocchi/skin.css"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
52
+ document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="bocchi"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/bocchi/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
52
53
  </script>
53
54
  </body>
54
55
  </html>
@@ -1,13 +1,14 @@
1
1
  <!doctype html>
2
2
  <html lang="zh-CN" data-theme="kita">
3
3
  <head>
4
+ <meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
4
5
  <meta charset="utf-8">
5
6
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
7
  <title>喜多郁代 · 皮肤样板预览</title>
7
- <link rel="stylesheet" href="../../styles.css">
8
- <link rel="stylesheet" href="../../workflow.css">
9
- <link rel="stylesheet" href="../kessoku/skin.css">
10
- <link rel="stylesheet" href="skin.css">
8
+ <link rel="stylesheet" href="../../styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
9
+ <link rel="stylesheet" href="../../workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
10
+ <link rel="stylesheet" href="../kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
11
+ <link rel="stylesheet" href="skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
11
12
  <style>
12
13
  /* 只负责展示页排版;画框内完全复用实际组件样式,不重画玻璃或背景。 */
13
14
  body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-label{font:11px ui-monospace,monospace;letter-spacing:.15em;color:var(--dsr-muted)}
@@ -49,7 +50,7 @@
49
50
  </template>
50
51
  <script>
51
52
  const base=new URL('../../',location.href).href
52
- document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="kita"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="workflow.css"><link rel="stylesheet" href="skins/kessoku/skin.css"><link rel="stylesheet" href="skins/kita/skin.css"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
53
+ document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="kita"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/kita/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
53
54
  </script>
54
55
  </body>
55
56
  </html>
@@ -1,13 +1,14 @@
1
1
  <!doctype html>
2
2
  <html lang="zh-CN" data-theme="nijika">
3
3
  <head>
4
+ <meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
4
5
  <meta charset="utf-8">
5
6
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
7
  <title>伊地知虹夏 · 皮肤样板预览</title>
7
- <link rel="stylesheet" href="../../styles.css">
8
- <link rel="stylesheet" href="../../workflow.css">
9
- <link rel="stylesheet" href="../kessoku/skin.css">
10
- <link rel="stylesheet" href="skin.css">
8
+ <link rel="stylesheet" href="../../styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
9
+ <link rel="stylesheet" href="../../workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
10
+ <link rel="stylesheet" href="../kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
11
+ <link rel="stylesheet" href="skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
11
12
  <style>
12
13
  /* 只负责展示页排版;画框内完全复用实际组件样式,不重画玻璃或背景。 */
13
14
  body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-label{font:11px ui-monospace,monospace;letter-spacing:.15em;color:var(--dsr-muted)}
@@ -49,7 +50,7 @@
49
50
  </template>
50
51
  <script>
51
52
  const base=new URL('../../',location.href).href
52
- document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="nijika"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="workflow.css"><link rel="stylesheet" href="skins/kessoku/skin.css"><link rel="stylesheet" href="skins/nijika/skin.css"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
53
+ document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="nijika"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/nijika/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
53
54
  </script>
54
55
  </body>
55
56
  </html>
@@ -1,4 +1,5 @@
1
- <!doctype html><html lang="zh-CN" data-theme="penguin"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>企鹅女管 · 黑黄工业终端 · 组件预览</title><link rel="stylesheet" href="../../styles.css"><link rel="stylesheet" href="../../workflow.css"><link rel="stylesheet" href="skin.css"><style>body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-header{margin-bottom:26px}.preview-header h1{font-size:29px;line-height:1.3;margin:10px 0}.preview-header p{font-size:14px;max-width:680px;color:var(--dsr-muted)}.preview-layout{display:grid;grid-template-columns:390px minmax(0,1fr);gap:26px;align-items:start}iframe{display:block;width:100%;height:844px;border:1px solid var(--dsr-line);border-radius:18px;background:var(--dsr-bg)}.preview-card{padding:22px;margin:0 0 18px;background:var(--dsr-panel);border:1px solid var(--dsr-line);border-radius:12px}.preview-card h2{font-size:17px;margin:0 0 14px}.preview-card p,.preview-card li{font-size:13px;line-height:1.8;color:var(--dsr-muted)}.preview-icons{display:flex;align-items:center;gap:18px}.preview-icons img{width:58px;height:54px;object-fit:contain}.preview-links,.preview-switch{display:flex;gap:12px;flex-wrap:wrap;font-size:13px;margin:12px 0}.preview-links a{color:var(--dsr-accent-strong)}.preview-switch button{padding:8px 16px;border:1px solid var(--dsr-line);border-radius:8px;background:var(--dsr-panel);color:var(--dsr-text);font:inherit}.preview-switch button[aria-pressed=true]{background:var(--dsr-accent);color:var(--dsr-on-accent)}@media(max-width:760px){.preview-layout{grid-template-columns:minmax(0,390px);justify-content:center}.preview-header h1{font-size:25px}}</style></head><body><main class="preview-shell"><header class="preview-header"><h1>企鹅女管 · 黑黄工业终端</h1><p>新增官网三角阵列、终末地工业铭牌和帝江/集成工业主题线路图,保留黑黄终端界面。 </p><nav class="preview-links"><a href="DESIGN.md">皮肤维护说明</a><a href="../../index.html?layout=mobile">实际手机入口</a><a href="../../desktop/desktop.html">实际桌面入口</a></nav><div class="preview-switch" role="group" aria-label="预览配色"><button type="button" data-preview-theme="penguin" aria-pressed="true">白昼</button><button type="button" data-preview-theme="penguin-night" aria-pressed="false">极夜</button></div></header><section class="preview-layout"><iframe id="phone" title="手机组件预览"></iframe><aside><section class="preview-card"><h2>表情导航 · 文字保留</h2><div class="preview-icons"><img src="icon.png" alt="会话表情"><img src="icon-dizzy.png" alt="文件表情"><img src="icon-wink.png" alt="更多表情"></div><p>表情在原有图标位内展示,不向列表上方额外挂一排头像。文字、未读徽标与原有点击区保留。</p></section><section class="preview-card"><h2>角色与阅读层级</h2><p>白昼使用冷白与墨黑操作条,极夜使用炭黑与信号黄。三角标记、切角和工程网格在两套中保持一致;线路图为主题装饰示意。</p></section><section class="preview-card"><h2>实际界面验收</h2><ol><li>320/390px 手机与桌面布局。</li><li>立绘不压住标题和连接入口。</li><li>导航、输入区保持既有固定定位。</li><li>归档关闭、半滑、展开与确认框。</li></ol><p>此页是无主机连接的静态组件样板;完整交互以实际 WebUI 验收为准。</p></section></aside></section></main><template id="phone-components">
1
+ <!doctype html><html lang="zh-CN" data-theme="penguin"><head><meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
2
+ <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>企鹅女管 · 黑黄工业终端 · 组件预览</title><link rel="stylesheet" href="../../styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="../../workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><style>body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-header{margin-bottom:26px}.preview-header h1{font-size:29px;line-height:1.3;margin:10px 0}.preview-header p{font-size:14px;max-width:680px;color:var(--dsr-muted)}.preview-layout{display:grid;grid-template-columns:390px minmax(0,1fr);gap:26px;align-items:start}iframe{display:block;width:100%;height:844px;border:1px solid var(--dsr-line);border-radius:18px;background:var(--dsr-bg)}.preview-card{padding:22px;margin:0 0 18px;background:var(--dsr-panel);border:1px solid var(--dsr-line);border-radius:12px}.preview-card h2{font-size:17px;margin:0 0 14px}.preview-card p,.preview-card li{font-size:13px;line-height:1.8;color:var(--dsr-muted)}.preview-icons{display:flex;align-items:center;gap:18px}.preview-icons img{width:58px;height:54px;object-fit:contain}.preview-links,.preview-switch{display:flex;gap:12px;flex-wrap:wrap;font-size:13px;margin:12px 0}.preview-links a{color:var(--dsr-accent-strong)}.preview-switch button{padding:8px 16px;border:1px solid var(--dsr-line);border-radius:8px;background:var(--dsr-panel);color:var(--dsr-text);font:inherit}.preview-switch button[aria-pressed=true]{background:var(--dsr-accent);color:var(--dsr-on-accent)}@media(max-width:760px){.preview-layout{grid-template-columns:minmax(0,390px);justify-content:center}.preview-header h1{font-size:25px}}</style></head><body><main class="preview-shell"><header class="preview-header"><h1>企鹅女管 · 黑黄工业终端</h1><p>新增官网三角阵列、终末地工业铭牌和帝江/集成工业主题线路图,保留黑黄终端界面。 </p><nav class="preview-links"><a href="DESIGN.md">皮肤维护说明</a><a href="../../index.html?layout=mobile">实际手机入口</a><a href="../../desktop/desktop.html">实际桌面入口</a></nav><div class="preview-switch" role="group" aria-label="预览配色"><button type="button" data-preview-theme="penguin" aria-pressed="true">白昼</button><button type="button" data-preview-theme="penguin-night" aria-pressed="false">极夜</button></div></header><section class="preview-layout"><iframe id="phone" title="手机组件预览"></iframe><aside><section class="preview-card"><h2>表情导航 · 文字保留</h2><div class="preview-icons"><img src="icon.png" alt="会话表情"><img src="icon-dizzy.png" alt="文件表情"><img src="icon-wink.png" alt="更多表情"></div><p>表情在原有图标位内展示,不向列表上方额外挂一排头像。文字、未读徽标与原有点击区保留。</p></section><section class="preview-card"><h2>角色与阅读层级</h2><p>白昼使用冷白与墨黑操作条,极夜使用炭黑与信号黄。三角标记、切角和工程网格在两套中保持一致;线路图为主题装饰示意。</p></section><section class="preview-card"><h2>实际界面验收</h2><ol><li>320/390px 手机与桌面布局。</li><li>立绘不压住标题和连接入口。</li><li>导航、输入区保持既有固定定位。</li><li>归档关闭、半滑、展开与确认框。</li></ol><p>此页是无主机连接的静态组件样板;完整交互以实际 WebUI 验收为准。</p></section></aside></section></main><template id="phone-components">
2
3
  <header class="topbar"><div class="brand"><span class="brand-dot"></span><span>DSH Remote</span></div><span class="pill">未连接</span></header>
3
4
  <main class="main" id="main"><section class="view" id="view-home">
4
5
  <section class="workflow-start"><div class="workflow-page-head"><h1>工作空间</h1><button type="button" class="workflow-connection">工作电脑 · 连接详情</button><button type="button" class="home-doctor"><span>AI 排查问题</span><small>使用你的 DSH 和模型,只读诊断</small><b>›</b></button></div><div class="workspace-nav"><span>DSH Remote</span><button type="button" class="mini-btn">查看文件</button></div><button type="button" id="btn-new-session" class="mini-btn workflow-new-session">+ 新会话</button></section>
@@ -8,4 +9,4 @@
8
9
  <div class="session-swipe"><div class="session-card"><div class="sc-title">准备版本更新说明</div><div class="sc-meta">3 分钟前</div><div class="sc-workspace">⌂ dsh-remote</div></div></div>
9
10
  </section></main>
10
11
  <nav class="bottom-nav"><button type="button" class="nav-btn active" data-view="view-home"><span class="nav-ico">▦</span><span class="nav-label">会话</span></button><button type="button" class="nav-btn" data-view="view-files"><span class="nav-ico">↕</span><span class="nav-label">文件</span></button><button type="button" class="nav-btn" data-view="view-settings"><span class="nav-ico">⚙</span><span class="nav-label">更多</span></button></nav>
11
- </template><script>const base=new URL('../../',location.href).href;const frame=document.getElementById('phone');frame.srcdoc='<!doctype html><html lang="zh-CN" data-theme="penguin"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="workflow.css"><link rel="stylesheet" href="skins/penguin/skin.css"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>';document.querySelectorAll('[data-preview-theme]').forEach(button=>button.addEventListener('click',()=>{document.documentElement.dataset.theme=button.dataset.previewTheme;if(frame.contentDocument?.documentElement)frame.contentDocument.documentElement.dataset.theme=button.dataset.previewTheme;document.querySelectorAll('[data-preview-theme]').forEach(b=>b.setAttribute('aria-pressed',String(b===button)))}));</script></body></html>
12
+ </template><script>const base=new URL('../../',location.href).href;const frame=document.getElementById('phone');frame.srcdoc='<!doctype html><html lang="zh-CN" data-theme="penguin"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/penguin/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>';document.querySelectorAll('[data-preview-theme]').forEach(button=>button.addEventListener('click',()=>{document.documentElement.dataset.theme=button.dataset.previewTheme;if(frame.contentDocument?.documentElement)frame.contentDocument.documentElement.dataset.theme=button.dataset.previewTheme;document.querySelectorAll('[data-preview-theme]').forEach(b=>b.setAttribute('aria-pressed',String(b===button)))}));</script></body></html>
@@ -1,13 +1,14 @@
1
1
  <!doctype html>
2
2
  <html lang="zh-CN" data-theme="ryo">
3
3
  <head>
4
+ <meta name="dsh-remote-build" content="d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
4
5
  <meta charset="utf-8">
5
6
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
7
  <title>山田凉 · 皮肤样板预览</title>
7
- <link rel="stylesheet" href="../../styles.css">
8
- <link rel="stylesheet" href="../../workflow.css">
9
- <link rel="stylesheet" href="../kessoku/skin.css">
10
- <link rel="stylesheet" href="skin.css">
8
+ <link rel="stylesheet" href="../../styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
9
+ <link rel="stylesheet" href="../../workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
10
+ <link rel="stylesheet" href="../kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
11
+ <link rel="stylesheet" href="skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e">
11
12
  <style>
12
13
  /* 只负责展示页排版;画框内完全复用实际组件样式,不重画玻璃或背景。 */
13
14
  body{padding:28px 20px 40px}.preview-shell{max-width:980px;margin:auto}.preview-label{font:11px ui-monospace,monospace;letter-spacing:.15em;color:var(--dsr-muted)}
@@ -49,7 +50,7 @@
49
50
  </template>
50
51
  <script>
51
52
  const base=new URL('../../',location.href).href
52
- document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="ryo"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css"><link rel="stylesheet" href="workflow.css"><link rel="stylesheet" href="skins/kessoku/skin.css"><link rel="stylesheet" href="skins/ryo/skin.css"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
53
+ document.getElementById('phone').srcdoc='<!doctype html><html lang="zh-CN" data-theme="ryo"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="'+base+'"><link rel="stylesheet" href="styles.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="workflow.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/kessoku/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"><link rel="stylesheet" href="skins/ryo/skin.css?dsr-build=d269ebf822f3b66656a0f760a7c3063abdcc46fd700f90edb9e8e6fdb8efb83e"></head><body class="workflow-v8">'+document.getElementById('phone-components').innerHTML+'</body></html>'
53
54
  </script>
54
55
  </body>
55
56
  </html>
@@ -1,22 +1,21 @@
1
- /* Reveal the trial application entry only after the cloud operator enables it. */
2
- ;(function () {
1
+ /* Shared, visible sponsorship entry. The application page owns availability and review. */
2
+ ;(function(root) {
3
3
  'use strict'
4
- const origin = 'https://relay-pilot.blankalwaysgoeson.site'
5
- let busy = false, ready = false
6
- document.addEventListener('click', async event => {
7
- if (!event.target.closest?.('#btn-donate,#btn-donate-about,[data-donate-open]') || busy || ready) return
8
- busy = true
9
- try {
10
- const response = await fetch(origin + '/sponsor/api/config', { credentials: 'omit', cache: 'no-store', signal: AbortSignal.timeout(5000) })
11
- if (!response.ok || (await response.json()).enabled !== true) return
12
- for (const body of document.querySelectorAll('.donate-body')) {
13
- const line = document.createElement('p'), link = document.createElement('a')
14
- link.textContent = window.I18N?.lang === 'en' ? 'Basic relay trial · Sponsor ¥1 or more for one month' : '基础中转试运营申请 · 单次赞助 ¥1 及以上开通一个月'
15
- link.href = origin + '/sponsor/'; link.target = '_blank'; link.rel = 'noopener noreferrer'
16
- line.append(link); body.append(line)
17
- }
18
- ready = true
19
- } catch { /* Optional trial entry; ordinary sponsorship remains available. */ }
20
- finally { busy = false }
21
- })
22
- })()
4
+ const applicationUrl='https://relay-pilot.blankalwaysgoeson.site/sponsor/'
5
+ const entries=new WeakMap()
6
+ function mount(target) {
7
+ if(!target)return
8
+ let entry=entries.get(target)
9
+ if(!entry){
10
+ const line=document.createElement('p'),link=document.createElement('a'),note=document.createElement('span')
11
+ line.className='sponsor-entry';link.href=applicationUrl;link.target='_blank';link.rel='noopener noreferrer'
12
+ line.append(link,note);target.append(line);entry={line,link,note};entries.set(target,entry)
13
+ }
14
+ const en=root.I18N?.lang==='en'
15
+ entry.link.textContent=en?'Sponsor ¥1 or more · Apply for one month of basic relay':'赞助 ¥1 及以上 · 申请一个月基础中转'
16
+ entry.note.textContent=en?' · Manual payment verification; 5GB per service month, one gateway, no file transfer.':' · 人工核验到账后开通,服务月 5GB,单网关,不含文件传输。'
17
+ return entry.line
18
+ }
19
+ root.DshSponsor={applicationUrl,mount}
20
+ for(const body of document.querySelectorAll('.donate-body'))mount(body)
21
+ })(typeof window!=='undefined'?window:globalThis)