@linxin666/dsh-remote-web-ui 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +6 -0
- package/README.md +12 -1
- package/README.zh.md +171 -0
- package/lib/client.js +169 -98
- package/lib/client.js.map +1 -1
- package/lib/index.js +224 -4
- package/lib/mobile.js +109 -33
- package/lib/mobile.js.map +1 -1
- package/lib/types/client/PluginSettingsCard.d.ts.map +1 -1
- package/lib/types/client/PluginSettingsCard.js +3 -2
- package/lib/types/client/RemoteSettingsCard.d.ts +4 -0
- package/lib/types/client/RemoteSettingsCard.d.ts.map +1 -1
- package/lib/types/client/RemoteSettingsCard.js +3 -1
- package/lib/types/client/UpdateEntry.d.ts.map +1 -1
- package/lib/types/client/UpdateEntry.js +10 -2
- package/lib/types/client/deep-link.js +10 -5
- package/lib/types/client/locales.d.ts +8 -0
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/client/locales.js +8 -0
- package/lib/types/client/update-api.d.ts +10 -0
- package/lib/types/client/update-api.d.ts.map +1 -1
- package/lib/types/client/update-api.js +22 -2
- package/lib/types/index.d.ts +7 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +7 -1
- package/lib/types/mobile/api.d.ts +9 -2
- package/lib/types/mobile/api.d.ts.map +1 -1
- package/lib/types/mobile/api.js +7 -3
- package/lib/types/mobile/mobile-styles.d.ts +1 -1
- package/lib/types/mobile/mobile-styles.d.ts.map +1 -1
- package/lib/types/mobile/mobile-styles.js +3 -0
- package/lib/types/mobile/views/App.d.ts +3 -1
- package/lib/types/mobile/views/App.d.ts.map +1 -1
- package/lib/types/mobile/views/App.js +18 -3
- package/lib/types/mobile/views/ChatView.d.ts +6 -0
- package/lib/types/mobile/views/ChatView.d.ts.map +1 -1
- package/lib/types/mobile/views/ChatView.js +95 -7
- package/lib/types/mobile/views/ChatView.test.js +161 -3
- package/lib/types/mobile/views/WorkspaceView.d.ts +3 -1
- package/lib/types/mobile/views/WorkspaceView.d.ts.map +1 -1
- package/lib/types/mobile/views/WorkspaceView.js +9 -2
- package/lib/types/mobile/views/WorkspaceView.test.d.ts +2 -0
- package/lib/types/mobile/views/WorkspaceView.test.d.ts.map +1 -0
- package/lib/types/mobile/views/WorkspaceView.test.js +56 -0
- package/lib/types/mobile-api.d.ts +2 -0
- package/lib/types/mobile-api.d.ts.map +1 -1
- package/lib/types/mobile-api.js +17 -2
- package/package.json +1 -11
- package/src/client/PluginSettingsCard.tsx +30 -5
- package/src/client/RemoteSettingsCard.tsx +18 -0
- package/src/client/UpdateEntry.tsx +10 -2
- package/src/client/deep-link.ts +10 -4
- package/src/client/locales.ts +8 -0
- package/src/client/settings-card.module.css +139 -144
- package/src/client/update-api.ts +22 -2
- package/src/index.ts +14 -1
- package/src/mobile/api.ts +14 -2
- package/src/mobile/mobile-styles.ts +3 -0
- package/src/mobile/views/App.tsx +22 -3
- package/src/mobile/views/ChatView.test.tsx +185 -3
- package/src/mobile/views/ChatView.tsx +102 -8
- package/src/mobile/views/WorkspaceView.test.tsx +66 -0
- package/src/mobile/views/WorkspaceView.tsx +11 -2
- package/src/mobile-api.ts +20 -2
package/lib/client.js
CHANGED
|
@@ -1342,8 +1342,8 @@ window.__ModuleLoader__.load({
|
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
//#endregion
|
|
1345
|
-
//#region \0dsh-css
|
|
1346
|
-
const css$1 = ".
|
|
1345
|
+
//#region \0dsh-css:packages/dsh-remote-web-ui/src/client/remote.module.css.mjs
|
|
1346
|
+
const css$1 = ".fThDlq_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.fThDlq_mask{background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute;inset:0}.fThDlq_trigger{width:36px;height:36px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;transition:background-color .12s,color .12s,box-shadow .12s;display:inline-flex}.fThDlq_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.fThDlq_trigger:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}.fThDlq_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.fThDlq_trigger:disabled{opacity:.5;cursor:default}.fThDlq_panel{z-index:1;box-sizing:border-box;background:var(--dsw-alias-bg-layer-2);width:560px;max-width:calc(100vw - 48px);max-height:calc(100vh - 48px);box-shadow:var(--dsw-shadow-lv3);color:var(--dsw-alias-label-primary);border-radius:24px;flex-direction:column;gap:14px;padding:24px;font-size:14px;line-height:22px;display:flex;position:relative;overflow:auto}.fThDlq_header{align-items:flex-start;gap:12px;display:flex}.fThDlq_heading{flex:1;min-width:0}.fThDlq_title{margin:0;font-size:18px;font-weight:600;line-height:26px}.fThDlq_subtitle{color:var(--dsw-alias-label-secondary);margin:4px 0 0;font-size:13px}.fThDlq_close{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:50%;flex:none;justify-content:center;align-items:center;padding:0;transition:background-color .12s,color .12s,box-shadow .12s;display:inline-flex}.fThDlq_close:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.fThDlq_close:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}.fThDlq_close:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.fThDlq_close:disabled{opacity:.5;cursor:default}.fThDlq_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:16px;flex-direction:column;align-items:center;gap:12px;padding:16px;display:flex}.fThDlq_cardHeader{justify-content:space-between;align-items:center;gap:12px;width:100%;display:flex}.fThDlq_cardTitle{font-weight:500}.fThDlq_badge{white-space:nowrap;border-radius:999px;flex:none;align-items:center;gap:6px;min-width:0;padding:2px 10px;font-size:12px;line-height:18px;display:inline-flex}.fThDlq_badge:before{content:\"\";background:currentColor;border-radius:50%;width:8px;height:8px}.fThDlq_badge-waiting{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-interactive-bg-hover)}.fThDlq_badge-connected{color:var(--dsw-alias-state-success-primary);background:var(--dsw-alias-interactive-bg-hover)}.fThDlq_badge-disconnected{color:var(--dsw-alias-state-warn-primary);background:var(--dsw-alias-interactive-bg-hover)}.fThDlq_badge-stopped{color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-interactive-bg-hover)}.fThDlq_badgePublic{color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-hover)}.fThDlq_badges{flex:none;align-items:center;gap:6px;display:inline-flex}.fThDlq_qrWrap{background:var(--dsw-alias-bg-base);border-radius:12px;justify-content:center;align-items:center;padding:12px;display:flex}.fThDlq_qr{display:block}.fThDlq_expired{color:var(--dsw-alias-state-error-primary);margin:0;font-size:13px}.fThDlq_expiry{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.fThDlq_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.fThDlq_link{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-caption);font-family:var(--dsw-font-mono,ui-monospace, monospace);margin:0;font-size:12px;overflow:hidden}.fThDlq_stoppedHint{color:var(--dsw-alias-state-error-primary);margin:0;font-size:13px}.fThDlq_tunnelNote{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.fThDlq_tunnelFailed{color:var(--dsw-alias-state-error-primary);margin:0;font-size:13px}.fThDlq_actions{gap:8px;display:flex}.fThDlq_action{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-button-elevated-fill);height:34px;color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;border-radius:10px;justify-content:center;align-items:center;gap:6px;padding:0 14px;font-size:13px;transition:background-color .12s,border-color .12s,box-shadow .12s;display:inline-flex}.fThDlq_action:hover:not(:disabled){background:var(--dsw-alias-button-floating-hover)}.fThDlq_action:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}.fThDlq_action:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);outline:none}.fThDlq_action:disabled{opacity:.5;cursor:default}.fThDlq_banner{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:16px;padding:16px}.fThDlq_bannerTitle{color:var(--dsw-alias-state-warn-primary);margin:0;font-weight:500}.fThDlq_bannerHint{color:var(--dsw-alias-label-secondary);margin:6px 0 0;font-size:13px}.fThDlq_notice{z-index:2000;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);max-width:min(420px,100vw - 32px);box-shadow:var(--dsw-shadow-lv3);border-radius:12px;padding:12px 16px;position:fixed;top:16px;left:50%;transform:translate(-50%)}.fThDlq_noticeTitle{color:var(--dsw-alias-state-error-primary);margin:0;font-weight:500}.fThDlq_noticeDetail{color:var(--dsw-alias-label-secondary);margin:4px 0 0;font-size:13px}.fThDlq_addresses{border:none;margin:12px 0 0;padding:0}.fThDlq_addresses legend{color:var(--dsw-alias-label-secondary);padding:0;font-size:13px}.fThDlq_address{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;cursor:pointer;border-radius:6px;align-items:center;gap:8px;margin-top:6px;padding:4px 6px;font-size:13px;transition:background-color .12s;display:flex}.fThDlq_address:hover{background:var(--dsw-alias-interactive-bg-hover)}.fThDlq_address input:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-bg-layer-2), 0 0 0 4px var(--dsw-alias-brand-primary);border-radius:50%;outline:none}.fThDlq_addressValue{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-secondary);flex:1;font-size:12px;overflow:hidden}.fThDlq_addressHint{color:var(--dsw-alias-label-tertiary);margin:6px 0 0;font-size:12px}@media (prefers-reduced-motion:reduce){.fThDlq_trigger,.fThDlq_close,.fThDlq_action,.fThDlq_address{transition:none}}.fThDlq_entryRow{flex:none;align-items:center;gap:6px;display:flex}.fThDlq_entryRow[data-rail=rail]{flex-direction:column-reverse;gap:4px}.fThDlq_updateStatus{margin:0;font-weight:600}.fThDlq_updateDetail{color:var(--dsw-alias-label-secondary);margin:6px 0 0;font-size:13px}.fThDlq_updateError{color:var(--dsw-alias-text-danger,var(--dsw-alias-label-primary));margin:0;font-weight:600}.fThDlq_updateOutput{background:var(--dsw-alias-bg-layer-1);max-height:180px;color:var(--dsw-alias-label-secondary);white-space:pre-wrap;word-break:break-all;border-radius:10px;margin:10px 0 0;padding:10px 12px;font-size:12px;line-height:18px;overflow:auto}.fThDlq_updateList{flex-direction:column;gap:6px;margin:12px 0 0;padding:0;list-style:none;display:flex}.fThDlq_updateListItem{justify-content:space-between;align-items:baseline;gap:12px;font-size:13px;display:flex}.fThDlq_updateListName{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-primary);overflow:hidden}.fThDlq_updateListVersions{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none}.fThDlq_updateActions{justify-content:flex-end;margin-top:16px;display:flex}.fThDlq_updateRetry{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary);cursor:pointer;border:none;border-radius:10px;align-items:center;gap:6px;padding:8px 14px;font-size:13px;transition:background-color .12s,color .12s;display:inline-flex}.fThDlq_updateRetry:hover{background:var(--dsw-alias-interactive-bg-active)}@media (prefers-reduced-motion:reduce){.fThDlq_updateRetry{transition:none}}";
|
|
1347
1347
|
const tagId$1 = "@linxin666/dsh-remote-web-ui/remote.module.css";
|
|
1348
1348
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
1349
1349
|
const tag = document.createElement("style");
|
|
@@ -1353,57 +1353,57 @@ window.__ModuleLoader__.load({
|
|
|
1353
1353
|
document.head.appendChild(tag);
|
|
1354
1354
|
}
|
|
1355
1355
|
var remote_module_css_default = {
|
|
1356
|
-
"action": "
|
|
1357
|
-
"actions": "
|
|
1358
|
-
"address": "
|
|
1359
|
-
"addressHint": "
|
|
1360
|
-
"addressValue": "
|
|
1361
|
-
"addresses": "
|
|
1362
|
-
"badge": "
|
|
1363
|
-
"badge-connected": "
|
|
1364
|
-
"badge-disconnected": "
|
|
1365
|
-
"badge-stopped": "
|
|
1366
|
-
"badge-waiting": "
|
|
1367
|
-
"badgePublic": "
|
|
1368
|
-
"badges": "
|
|
1369
|
-
"banner": "
|
|
1370
|
-
"bannerHint": "
|
|
1371
|
-
"bannerTitle": "
|
|
1372
|
-
"card": "
|
|
1373
|
-
"cardHeader": "
|
|
1374
|
-
"cardTitle": "
|
|
1375
|
-
"close": "
|
|
1376
|
-
"entryRow": "
|
|
1377
|
-
"expired": "
|
|
1378
|
-
"expiry": "
|
|
1379
|
-
"header": "
|
|
1380
|
-
"heading": "
|
|
1381
|
-
"hint": "
|
|
1382
|
-
"link": "
|
|
1383
|
-
"mask": "
|
|
1384
|
-
"notice": "
|
|
1385
|
-
"noticeDetail": "
|
|
1386
|
-
"noticeTitle": "
|
|
1387
|
-
"overlay": "
|
|
1388
|
-
"panel": "
|
|
1389
|
-
"qr": "
|
|
1390
|
-
"qrWrap": "
|
|
1391
|
-
"stoppedHint": "
|
|
1392
|
-
"subtitle": "
|
|
1393
|
-
"title": "
|
|
1394
|
-
"trigger": "
|
|
1395
|
-
"tunnelFailed": "
|
|
1396
|
-
"tunnelNote": "
|
|
1397
|
-
"updateActions": "
|
|
1398
|
-
"updateDetail": "
|
|
1399
|
-
"updateError": "
|
|
1400
|
-
"updateList": "
|
|
1401
|
-
"updateListItem": "
|
|
1402
|
-
"updateListName": "
|
|
1403
|
-
"updateListVersions": "
|
|
1404
|
-
"updateOutput": "
|
|
1405
|
-
"updateRetry": "
|
|
1406
|
-
"updateStatus": "
|
|
1356
|
+
"action": "fThDlq_action",
|
|
1357
|
+
"actions": "fThDlq_actions",
|
|
1358
|
+
"address": "fThDlq_address",
|
|
1359
|
+
"addressHint": "fThDlq_addressHint",
|
|
1360
|
+
"addressValue": "fThDlq_addressValue",
|
|
1361
|
+
"addresses": "fThDlq_addresses",
|
|
1362
|
+
"badge": "fThDlq_badge",
|
|
1363
|
+
"badge-connected": "fThDlq_badge-connected",
|
|
1364
|
+
"badge-disconnected": "fThDlq_badge-disconnected",
|
|
1365
|
+
"badge-stopped": "fThDlq_badge-stopped",
|
|
1366
|
+
"badge-waiting": "fThDlq_badge-waiting",
|
|
1367
|
+
"badgePublic": "fThDlq_badgePublic",
|
|
1368
|
+
"badges": "fThDlq_badges",
|
|
1369
|
+
"banner": "fThDlq_banner",
|
|
1370
|
+
"bannerHint": "fThDlq_bannerHint",
|
|
1371
|
+
"bannerTitle": "fThDlq_bannerTitle",
|
|
1372
|
+
"card": "fThDlq_card",
|
|
1373
|
+
"cardHeader": "fThDlq_cardHeader",
|
|
1374
|
+
"cardTitle": "fThDlq_cardTitle",
|
|
1375
|
+
"close": "fThDlq_close",
|
|
1376
|
+
"entryRow": "fThDlq_entryRow",
|
|
1377
|
+
"expired": "fThDlq_expired",
|
|
1378
|
+
"expiry": "fThDlq_expiry",
|
|
1379
|
+
"header": "fThDlq_header",
|
|
1380
|
+
"heading": "fThDlq_heading",
|
|
1381
|
+
"hint": "fThDlq_hint",
|
|
1382
|
+
"link": "fThDlq_link",
|
|
1383
|
+
"mask": "fThDlq_mask",
|
|
1384
|
+
"notice": "fThDlq_notice",
|
|
1385
|
+
"noticeDetail": "fThDlq_noticeDetail",
|
|
1386
|
+
"noticeTitle": "fThDlq_noticeTitle",
|
|
1387
|
+
"overlay": "fThDlq_overlay",
|
|
1388
|
+
"panel": "fThDlq_panel",
|
|
1389
|
+
"qr": "fThDlq_qr",
|
|
1390
|
+
"qrWrap": "fThDlq_qrWrap",
|
|
1391
|
+
"stoppedHint": "fThDlq_stoppedHint",
|
|
1392
|
+
"subtitle": "fThDlq_subtitle",
|
|
1393
|
+
"title": "fThDlq_title",
|
|
1394
|
+
"trigger": "fThDlq_trigger",
|
|
1395
|
+
"tunnelFailed": "fThDlq_tunnelFailed",
|
|
1396
|
+
"tunnelNote": "fThDlq_tunnelNote",
|
|
1397
|
+
"updateActions": "fThDlq_updateActions",
|
|
1398
|
+
"updateDetail": "fThDlq_updateDetail",
|
|
1399
|
+
"updateError": "fThDlq_updateError",
|
|
1400
|
+
"updateList": "fThDlq_updateList",
|
|
1401
|
+
"updateListItem": "fThDlq_updateListItem",
|
|
1402
|
+
"updateListName": "fThDlq_updateListName",
|
|
1403
|
+
"updateListVersions": "fThDlq_updateListVersions",
|
|
1404
|
+
"updateOutput": "fThDlq_updateOutput",
|
|
1405
|
+
"updateRetry": "fThDlq_updateRetry",
|
|
1406
|
+
"updateStatus": "fThDlq_updateStatus"
|
|
1407
1407
|
};
|
|
1408
1408
|
//#endregion
|
|
1409
1409
|
//#region src/client/RemotePanel.tsx
|
|
@@ -1651,13 +1651,31 @@ window.__ModuleLoader__.load({
|
|
|
1651
1651
|
//#endregion
|
|
1652
1652
|
//#region src/client/update-api.ts
|
|
1653
1653
|
/**
|
|
1654
|
+
* Error thrown when the update status probe fails: carries the HTTP status
|
|
1655
|
+
* so the panel can tell "the update route is not mounted" (404 — the host
|
|
1656
|
+
* process runs an older plugin build) apart from real network failures.
|
|
1657
|
+
*/
|
|
1658
|
+
var UpdateStatusError = class extends Error {
|
|
1659
|
+
/** HTTP status of the failed response (0 when the fetch never returned). */
|
|
1660
|
+
status;
|
|
1661
|
+
constructor(status) {
|
|
1662
|
+
super("update status unavailable (HTTP " + String(status) + ")");
|
|
1663
|
+
this.status = status;
|
|
1664
|
+
}
|
|
1665
|
+
};
|
|
1666
|
+
/**
|
|
1654
1667
|
* Probe the update status: install mode, owning profile, and the
|
|
1655
1668
|
* current-vs-latest comparison for every family package.
|
|
1656
1669
|
* @returns the status snapshot.
|
|
1657
1670
|
*/
|
|
1658
1671
|
async function fetchUpdateStatus() {
|
|
1659
|
-
|
|
1660
|
-
|
|
1672
|
+
let response;
|
|
1673
|
+
try {
|
|
1674
|
+
response = await fetch("/api/update/status");
|
|
1675
|
+
} catch {
|
|
1676
|
+
throw new UpdateStatusError(0);
|
|
1677
|
+
}
|
|
1678
|
+
if (!response.ok) throw new UpdateStatusError(response.status);
|
|
1661
1679
|
return await response.json();
|
|
1662
1680
|
}
|
|
1663
1681
|
/**
|
|
@@ -1885,7 +1903,15 @@ window.__ModuleLoader__.load({
|
|
|
1885
1903
|
let status;
|
|
1886
1904
|
try {
|
|
1887
1905
|
status = await fetchUpdateStatus();
|
|
1888
|
-
} catch {
|
|
1906
|
+
} catch (error) {
|
|
1907
|
+
if (error instanceof UpdateStatusError && error.status === 404) {
|
|
1908
|
+
setView({
|
|
1909
|
+
kind: "error",
|
|
1910
|
+
message: t("update.unmounted"),
|
|
1911
|
+
detail: t("update.unmountedDetail")
|
|
1912
|
+
});
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1889
1915
|
setView({
|
|
1890
1916
|
kind: "error",
|
|
1891
1917
|
message: t("update.offline"),
|
|
@@ -2190,8 +2216,8 @@ window.__ModuleLoader__.load({
|
|
|
2190
2216
|
});
|
|
2191
2217
|
}
|
|
2192
2218
|
//#endregion
|
|
2193
|
-
//#region \0dsh-css
|
|
2194
|
-
const css = ".
|
|
2219
|
+
//#region \0dsh-css:packages/dsh-remote-web-ui/src/client/settings-card.module.css.mjs
|
|
2220
|
+
const css = ".Kwoi6G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.Kwoi6G_card:hover{border-color:var(--dsw-alias-label-dimmed)}.Kwoi6G_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}.Kwoi6G_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.Kwoi6G_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.Kwoi6G_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Kwoi6G_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.Kwoi6G_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}.Kwoi6G_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Kwoi6G_chevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}.Kwoi6G_chevronOpen{transform:rotate(180deg)}.Kwoi6G_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.Kwoi6G_readOnly{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}.Kwoi6G_notExposed{color:var(--dsw-alias-state-warn-primary);margin:12px 0 0;font-size:12px;line-height:1.5}.Kwoi6G_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.Kwoi6G_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}.Kwoi6G_discard,.Kwoi6G_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}.Kwoi6G_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.Kwoi6G_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Kwoi6G_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}.Kwoi6G_discard:disabled,.Kwoi6G_save:disabled{opacity:.4;cursor:default}.Kwoi6G_discard:focus-visible,.Kwoi6G_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Kwoi6G_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.Kwoi6G_field+.Kwoi6G_field{border-top:1px solid var(--dsw-alias-border-l2)}.Kwoi6G_head{align-items:center;gap:8px;display:flex}.Kwoi6G_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.Kwoi6G_badges{align-items:center;gap:8px;display:inline-flex}.Kwoi6G_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.Kwoi6G_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.Kwoi6G_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.Kwoi6G_reset:disabled{cursor:default}.Kwoi6G_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.Kwoi6G_input,.Kwoi6G_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Kwoi6G_input:focus-visible,.Kwoi6G_select:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}.Kwoi6G_input:disabled,.Kwoi6G_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.Kwoi6G_inputInvalid{border:1px solid var(--dsw-alias-label-error);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.Kwoi6G_inputInvalid:focus-visible{outline:2px solid var(--dsw-alias-label-error);outline-offset:1px;border-color:var(--dsw-alias-label-error)}.Kwoi6G_invalid{color:var(--dsw-alias-label-error);margin:0;font-size:12px;line-height:1.5}.Kwoi6G_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}@media (prefers-reduced-motion:reduce){.Kwoi6G_card,.Kwoi6G_header,.Kwoi6G_chevron,.Kwoi6G_chevronOpen,.Kwoi6G_discard,.Kwoi6G_save{transition:none}}";
|
|
2195
2221
|
const tagId = "@linxin666/dsh-remote-web-ui/settings-card.module.css";
|
|
2196
2222
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
2197
2223
|
const tag = document.createElement("style");
|
|
@@ -2201,33 +2227,33 @@ window.__ModuleLoader__.load({
|
|
|
2201
2227
|
document.head.appendChild(tag);
|
|
2202
2228
|
}
|
|
2203
2229
|
var settings_card_module_css_default = {
|
|
2204
|
-
"badge": "
|
|
2205
|
-
"badges": "
|
|
2206
|
-
"body": "
|
|
2207
|
-
"card": "
|
|
2208
|
-
"cardOpen": "
|
|
2209
|
-
"chevron": "
|
|
2210
|
-
"chevronOpen": "
|
|
2211
|
-
"description": "
|
|
2212
|
-
"discard": "
|
|
2213
|
-
"failed": "
|
|
2214
|
-
"field": "
|
|
2215
|
-
"footer": "
|
|
2216
|
-
"head": "
|
|
2217
|
-
"headText": "
|
|
2218
|
-
"header": "
|
|
2219
|
-
"hint": "
|
|
2220
|
-
"input": "
|
|
2221
|
-
"inputInvalid": "
|
|
2222
|
-
"invalid": "
|
|
2223
|
-
"label": "
|
|
2224
|
-
"name": "
|
|
2225
|
-
"notExposed": "
|
|
2226
|
-
"pending": "
|
|
2227
|
-
"readOnly": "
|
|
2228
|
-
"reset": "
|
|
2229
|
-
"save": "
|
|
2230
|
-
"select": "
|
|
2230
|
+
"badge": "Kwoi6G_badge",
|
|
2231
|
+
"badges": "Kwoi6G_badges",
|
|
2232
|
+
"body": "Kwoi6G_body",
|
|
2233
|
+
"card": "Kwoi6G_card",
|
|
2234
|
+
"cardOpen": "Kwoi6G_cardOpen",
|
|
2235
|
+
"chevron": "Kwoi6G_chevron",
|
|
2236
|
+
"chevronOpen": "Kwoi6G_chevronOpen",
|
|
2237
|
+
"description": "Kwoi6G_description",
|
|
2238
|
+
"discard": "Kwoi6G_discard",
|
|
2239
|
+
"failed": "Kwoi6G_failed",
|
|
2240
|
+
"field": "Kwoi6G_field",
|
|
2241
|
+
"footer": "Kwoi6G_footer",
|
|
2242
|
+
"head": "Kwoi6G_head",
|
|
2243
|
+
"headText": "Kwoi6G_headText",
|
|
2244
|
+
"header": "Kwoi6G_header",
|
|
2245
|
+
"hint": "Kwoi6G_hint",
|
|
2246
|
+
"input": "Kwoi6G_input",
|
|
2247
|
+
"inputInvalid": "Kwoi6G_inputInvalid",
|
|
2248
|
+
"invalid": "Kwoi6G_invalid",
|
|
2249
|
+
"label": "Kwoi6G_label",
|
|
2250
|
+
"name": "Kwoi6G_name",
|
|
2251
|
+
"notExposed": "Kwoi6G_notExposed",
|
|
2252
|
+
"pending": "Kwoi6G_pending",
|
|
2253
|
+
"readOnly": "Kwoi6G_readOnly",
|
|
2254
|
+
"reset": "Kwoi6G_reset",
|
|
2255
|
+
"save": "Kwoi6G_save",
|
|
2256
|
+
"select": "Kwoi6G_select"
|
|
2231
2257
|
};
|
|
2232
2258
|
//#endregion
|
|
2233
2259
|
//#region src/client/PluginSettingsCard.tsx
|
|
@@ -2250,8 +2276,9 @@ window.__ModuleLoader__.load({
|
|
|
2250
2276
|
if (!state.available) return null;
|
|
2251
2277
|
const title = props.t(props.titleKey);
|
|
2252
2278
|
const blocked = !state.dirty || state.invalid || state.saving;
|
|
2279
|
+
const cardClass = open ? `${settings_card_module_css_default.cardOpen} ${settings_card_module_css_default.card}` : settings_card_module_css_default.card;
|
|
2253
2280
|
if (!state.exposed) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2254
|
-
className:
|
|
2281
|
+
className: cardClass,
|
|
2255
2282
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2256
2283
|
type: "button",
|
|
2257
2284
|
className: settings_card_module_css_default.header,
|
|
@@ -2269,9 +2296,17 @@ window.__ModuleLoader__.load({
|
|
|
2269
2296
|
className: settings_card_module_css_default.description,
|
|
2270
2297
|
children: props.t(props.descriptionKey)
|
|
2271
2298
|
})]
|
|
2272
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
2273
|
-
|
|
2274
|
-
|
|
2299
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
2300
|
+
width: "14",
|
|
2301
|
+
height: "14",
|
|
2302
|
+
viewBox: "0 0 14 14",
|
|
2303
|
+
fill: "none",
|
|
2304
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2305
|
+
className: open ? `${settings_card_module_css_default.chevron} ${settings_card_module_css_default.chevronOpen}` : settings_card_module_css_default.chevron,
|
|
2306
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2307
|
+
d: "M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z",
|
|
2308
|
+
fill: "currentColor"
|
|
2309
|
+
})
|
|
2275
2310
|
})]
|
|
2276
2311
|
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2277
2312
|
className: settings_card_module_css_default.body,
|
|
@@ -2283,7 +2318,7 @@ window.__ModuleLoader__.load({
|
|
|
2283
2318
|
}) : null]
|
|
2284
2319
|
});
|
|
2285
2320
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2286
|
-
className:
|
|
2321
|
+
className: cardClass,
|
|
2287
2322
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2288
2323
|
type: "button",
|
|
2289
2324
|
className: settings_card_module_css_default.header,
|
|
@@ -2307,9 +2342,17 @@ window.__ModuleLoader__.load({
|
|
|
2307
2342
|
className: settings_card_module_css_default.pending,
|
|
2308
2343
|
children: props.t("settings.unsaved")
|
|
2309
2344
|
}) : null,
|
|
2310
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
2311
|
-
|
|
2312
|
-
|
|
2345
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
2346
|
+
width: "14",
|
|
2347
|
+
height: "14",
|
|
2348
|
+
viewBox: "0 0 14 14",
|
|
2349
|
+
fill: "none",
|
|
2350
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2351
|
+
className: open ? `${settings_card_module_css_default.chevron} ${settings_card_module_css_default.chevronOpen}` : settings_card_module_css_default.chevron,
|
|
2352
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2353
|
+
d: "M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z",
|
|
2354
|
+
fill: "currentColor"
|
|
2355
|
+
})
|
|
2313
2356
|
})
|
|
2314
2357
|
]
|
|
2315
2358
|
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -2692,7 +2735,8 @@ window.__ModuleLoader__.load({
|
|
|
2692
2735
|
textField("cookieName"),
|
|
2693
2736
|
booleanField("requirePairingForLan"),
|
|
2694
2737
|
textField("publicBaseUrl"),
|
|
2695
|
-
booleanField("autoTunnel")
|
|
2738
|
+
booleanField("autoTunnel"),
|
|
2739
|
+
booleanField("mobileEnterToSend")
|
|
2696
2740
|
]);
|
|
2697
2741
|
this.store = this.form.bind(() => this.projection());
|
|
2698
2742
|
}
|
|
@@ -2706,7 +2750,8 @@ window.__ModuleLoader__.load({
|
|
|
2706
2750
|
cookieName: this.form.field("cookieName"),
|
|
2707
2751
|
requirePairingForLan: this.form.field("requirePairingForLan"),
|
|
2708
2752
|
publicBaseUrl: this.form.field("publicBaseUrl"),
|
|
2709
|
-
autoTunnel: this.form.field("autoTunnel")
|
|
2753
|
+
autoTunnel: this.form.field("autoTunnel"),
|
|
2754
|
+
mobileEnterToSend: this.form.field("mobileEnterToSend")
|
|
2710
2755
|
};
|
|
2711
2756
|
}
|
|
2712
2757
|
/**
|
|
@@ -2859,6 +2904,22 @@ window.__ModuleLoader__.load({
|
|
|
2859
2904
|
onReset: () => {
|
|
2860
2905
|
props.resetField("autoTunnel");
|
|
2861
2906
|
}
|
|
2907
|
+
}),
|
|
2908
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(BooleanField, {
|
|
2909
|
+
id: "settings-remote-mobile-enter",
|
|
2910
|
+
label: t("settings.mobileEnterToSend"),
|
|
2911
|
+
hint: t("settings.mobileEnterToSendHint"),
|
|
2912
|
+
inheritLabel: t("settings.inherit"),
|
|
2913
|
+
onLabel: t("settings.on"),
|
|
2914
|
+
offLabel: t("settings.off"),
|
|
2915
|
+
...fieldProps,
|
|
2916
|
+
...state.mobileEnterToSend,
|
|
2917
|
+
onEdit: (text) => {
|
|
2918
|
+
props.edit("mobileEnterToSend", text);
|
|
2919
|
+
},
|
|
2920
|
+
onReset: () => {
|
|
2921
|
+
props.resetField("mobileEnterToSend");
|
|
2922
|
+
}
|
|
2862
2923
|
})
|
|
2863
2924
|
]
|
|
2864
2925
|
});
|
|
@@ -2920,6 +2981,8 @@ window.__ModuleLoader__.load({
|
|
|
2920
2981
|
"settings.publicBaseUrlHint": "内网穿透的公网地址,如 Cloudflare Tunnel:https://xxx.trycloudflare.com。填写后二维码将生成公网链接,手机不在同一网络也能配对;留空则仅局域网可用。",
|
|
2921
2982
|
"settings.autoTunnel": "自动公网隧道",
|
|
2922
2983
|
"settings.autoTunnelHint": "开启后插件自动启动 Cloudflare quick tunnel(无需安装任何工具),并自动更新公网地址与信任配置,手机随时可用公网配对;关闭时使用上方手动填写的公网地址。",
|
|
2984
|
+
"settings.mobileEnterToSend": "移动端回车发送",
|
|
2985
|
+
"settings.mobileEnterToSendHint": "开启:移动端输入框按 Enter 直接发送,Shift+Enter 换行;关闭:Enter 换行,仅点发送按钮发送。",
|
|
2923
2986
|
"settings.inherit": "继承",
|
|
2924
2987
|
"settings.on": "开",
|
|
2925
2988
|
"settings.off": "关",
|
|
@@ -2953,6 +3016,8 @@ window.__ModuleLoader__.load({
|
|
|
2953
3016
|
"update.missingDetail": "无法定位已安装的 dsh-web-ui 聚合包。请先运行 dsh plugin --profile <profile> add @linxin666/dsh-web-ui-all。",
|
|
2954
3017
|
"update.offline": "无法连接更新源",
|
|
2955
3018
|
"update.offlineDetail": "网络不可用或更新服务异常,请稍后重试。",
|
|
3019
|
+
"update.unmounted": "更新服务未加载",
|
|
3020
|
+
"update.unmountedDetail": "当前 dsh web 进程运行的插件版本不含更新服务,请重启 dsh web(Ctrl+C 后重新运行)后再试。",
|
|
2956
3021
|
"update.error": "更新失败",
|
|
2957
3022
|
"update.packages": "组件版本",
|
|
2958
3023
|
"update.retry": "重新检查",
|
|
@@ -3018,6 +3083,8 @@ window.__ModuleLoader__.load({
|
|
|
3018
3083
|
"settings.publicBaseUrlHint": "The public URL of a tunnel in front of this server, e.g. a Cloudflare Tunnel: https://xxx.trycloudflare.com. When set, the QR link is built from it so a phone anywhere can pair; leave blank for LAN-only usage.",
|
|
3019
3084
|
"settings.autoTunnel": "Auto public tunnel",
|
|
3020
3085
|
"settings.autoTunnelHint": "When on, the plugin runs its own Cloudflare quick tunnel (no tool installation needed) and keeps the public address and trust config in sync automatically, so a phone anywhere can pair at any time; when off, the manually entered public address above applies.",
|
|
3086
|
+
"settings.mobileEnterToSend": "Enter to send on mobile",
|
|
3087
|
+
"settings.mobileEnterToSendHint": "On: Enter in the mobile composer sends immediately and Shift+Enter inserts a newline. Off: Enter inserts a newline and only the send button sends.",
|
|
3021
3088
|
"settings.inherit": "Inherit",
|
|
3022
3089
|
"settings.on": "On",
|
|
3023
3090
|
"settings.off": "Off",
|
|
@@ -3051,6 +3118,8 @@ window.__ModuleLoader__.load({
|
|
|
3051
3118
|
"update.missingDetail": "Could not locate the installed dsh-web-ui aggregate package. Install it with: dsh plugin --profile <profile> add @linxin666/dsh-web-ui-all",
|
|
3052
3119
|
"update.offline": "Cannot reach the update source",
|
|
3053
3120
|
"update.offlineDetail": "The network is unavailable or the update service is failing; try again later.",
|
|
3121
|
+
"update.unmounted": "The update service is not loaded",
|
|
3122
|
+
"update.unmountedDetail": "The running dsh web process loads a plugin build without the update service; restart dsh web (Ctrl+C, then run dsh web again) and retry.",
|
|
3054
3123
|
"update.error": "Update failed",
|
|
3055
3124
|
"update.packages": "Component versions",
|
|
3056
3125
|
"update.retry": "Check again",
|
|
@@ -3102,7 +3171,7 @@ window.__ModuleLoader__.load({
|
|
|
3102
3171
|
}
|
|
3103
3172
|
if (params.workspace !== void 0) runDeepLink(ctx, params.workspace, page);
|
|
3104
3173
|
}
|
|
3105
|
-
/** Accept the token, then
|
|
3174
|
+
/** Accept the token, then enter the matching desktop/mobile surface. */
|
|
3106
3175
|
async function runAccept(token, page) {
|
|
3107
3176
|
let ok = false;
|
|
3108
3177
|
try {
|
|
@@ -3114,8 +3183,10 @@ window.__ModuleLoader__.load({
|
|
|
3114
3183
|
const url = new URL(page.href);
|
|
3115
3184
|
url.searchParams.delete("pair");
|
|
3116
3185
|
page.replaceState(`${url.pathname}${url.search}${url.hash}`);
|
|
3117
|
-
if (ok) if (isMobileSurface())
|
|
3118
|
-
|
|
3186
|
+
if (ok) if (isMobileSurface()) {
|
|
3187
|
+
url.pathname = "/m";
|
|
3188
|
+
page.navigate(`${url.pathname}${url.search}${url.hash}`);
|
|
3189
|
+
} else page.reload();
|
|
3119
3190
|
}
|
|
3120
3191
|
/**
|
|
3121
3192
|
* Connect the deep-linked workspace and open its session. Waits for the
|