dsh-mobile 0.6.0 → 0.6.2

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/lib/client.js CHANGED
@@ -1150,6 +1150,8 @@ window.__ModuleLoader__.load({
1150
1150
  originCopyBackend: "Copy backend address",
1151
1151
  originBackendCopied: "HTTP backend address copied.",
1152
1152
  originPurge: "Clear proxy settings",
1153
+ originHttpsTitle: "HTTPS remote access",
1154
+ originHttpsMode: "HTTPS handling",
1153
1155
  caddyModeManaged: "Managed Caddy (plugin handles HTTPS and certificates)",
1154
1156
  caddyModeExternal: "I already run my own reverse proxy",
1155
1157
  caddySectionTitle: "Managed Caddy upstream",
@@ -1205,6 +1207,8 @@ window.__ModuleLoader__.load({
1205
1207
  originCopyBackend: "Copia indirizzo backend",
1206
1208
  originBackendCopied: "Indirizzo backend HTTP copiato.",
1207
1209
  originPurge: "Cancella impostazioni proxy",
1210
+ originHttpsTitle: "Accesso remoto HTTPS",
1211
+ originHttpsMode: "Gestione HTTPS",
1208
1212
  caddyModeManaged: "Caddy gestito (il plugin gestisce HTTPS e certificati)",
1209
1213
  caddyModeExternal: "Uso già il mio reverse proxy",
1210
1214
  caddySectionTitle: "Upstream Caddy gestito",
@@ -1260,6 +1264,8 @@ window.__ModuleLoader__.load({
1260
1264
  originCopyBackend: "复制后端地址",
1261
1265
  originBackendCopied: "已复制 HTTP 后端地址。",
1262
1266
  originPurge: "清除代理配置",
1267
+ originHttpsTitle: "HTTPS 远程接入",
1268
+ originHttpsMode: "HTTPS 接入方式",
1263
1269
  caddyModeManaged: "托管 Caddy(插件负责 HTTPS 与证书)",
1264
1270
  caddyModeExternal: "我已自行配置反向代理",
1265
1271
  caddySectionTitle: "托管 Caddy 上游",
@@ -5165,8 +5171,8 @@ window.__ModuleLoader__.load({
5165
5171
  function clientReleaseInfo(data) {
5166
5172
  const latestVersion = releaseVersion(data.latestVersion);
5167
5173
  const androidVersion = releaseVersion(data.androidVersion);
5168
- const expectedAndroidDownloadUrl = androidVersion === void 0 ? void 0 : `${GITHUB_RELEASES_URL}/download/v${androidVersion}/dsh-mobile-android-v${androidVersion}.apk`;
5169
- const androidDownloadUrl = expectedAndroidDownloadUrl !== void 0 && data.androidDownloadUrl === expectedAndroidDownloadUrl ? expectedAndroidDownloadUrl : GITHUB_RELEASES_URL;
5174
+ const expectedAndroidDownloadUrls = androidVersion === void 0 ? [] : ["v", "android-v"].map((prefix) => `${GITHUB_RELEASES_URL}/download/${prefix}${androidVersion}/dsh-mobile-android-v${androidVersion}.apk`);
5175
+ const androidDownloadUrl = typeof data.androidDownloadUrl === "string" && expectedAndroidDownloadUrls.includes(data.androidDownloadUrl) ? data.androidDownloadUrl : GITHUB_RELEASES_URL;
5170
5176
  return {
5171
5177
  updateAvailable: data.updateAvailable === true && latestVersion !== void 0,
5172
5178
  ...latestVersion === void 0 ? {} : { latestVersion },
@@ -6176,14 +6182,14 @@ window.__ModuleLoader__.load({
6176
6182
  const originSetup = element("section", "dsh-mobile-control__origin-setup");
6177
6183
  originSetup.hidden = true;
6178
6184
  const originSetupTitle = element("h3", "dsh-mobile-control__section-title");
6179
- originSetupTitle.textContent = t("prepareOrigin");
6185
+ originSetupTitle.textContent = t("originHttpsTitle");
6180
6186
  const originHelp = element("p", "dsh-mobile-control__component-note");
6181
6187
  originHelp.id = "dsh-mobile-origin-help";
6182
6188
  originHelp.textContent = t("originHelp");
6183
6189
  const originWarning = element("p", "dsh-mobile-control__origin-warning");
6184
6190
  originWarning.textContent = t("originWarning");
6185
6191
  const originFields = element("div", "dsh-mobile-control__origin-fields");
6186
- const originPublicLabel = element("label", "dsh-mobile-control__field");
6192
+ const originPublicLabel = element("label", "dsh-mobile-control__field dsh-mobile-control__field--full");
6187
6193
  originPublicLabel.textContent = t("originPublicOrigin");
6188
6194
  const originPublic = element("input");
6189
6195
  originPublic.type = "url";
@@ -6204,7 +6210,7 @@ window.__ModuleLoader__.load({
6204
6210
  originPort.max = "65535";
6205
6211
  originPort.step = "1";
6206
6212
  originPort.value = "3444";
6207
- const originCidrsLabel = element("label", "dsh-mobile-control__field");
6213
+ const originCidrsLabel = element("label", "dsh-mobile-control__field dsh-mobile-control__field--full");
6208
6214
  originCidrsLabel.textContent = t("originAllowedCidrs");
6209
6215
  const originCidrs = element("input");
6210
6216
  originCidrs.type = "text";
@@ -6248,14 +6254,15 @@ window.__ModuleLoader__.load({
6248
6254
  originCopyBackend.type = "button";
6249
6255
  originCopyBackend.textContent = t("originCopyBackend");
6250
6256
  originBackend.append(originBackendLabel, originBackendAddress, originCopyBackend);
6251
- originSetup.append(originSetupTitle, originHelp, originWarning, originFields, originFeedback, originFormActions, originBackend);
6252
- const caddyModeRow = element("div", "dsh-mobile-control__origin-fields");
6253
- const caddyModeManagedLabel = element("label", "dsh-mobile-control__field");
6257
+ const caddyModeRow = element("fieldset", "dsh-mobile-control__origin-modes");
6258
+ const caddyModeLegend = element("legend");
6259
+ caddyModeLegend.textContent = t("originHttpsMode");
6260
+ const caddyModeManagedLabel = element("label", "dsh-mobile-control__origin-mode");
6254
6261
  const caddyModeManaged = element("input");
6255
6262
  caddyModeManaged.type = "radio";
6256
6263
  caddyModeManaged.name = "caddy-mode";
6257
6264
  caddyModeManaged.value = "managed";
6258
- const caddyModeExternalLabel = element("label", "dsh-mobile-control__field");
6265
+ const caddyModeExternalLabel = element("label", "dsh-mobile-control__origin-mode");
6259
6266
  const caddyModeExternal = element("input");
6260
6267
  caddyModeExternal.type = "radio";
6261
6268
  caddyModeExternal.name = "caddy-mode";
@@ -6266,10 +6273,11 @@ window.__ModuleLoader__.load({
6266
6273
  caddyExternalText.textContent = t("caddyModeExternal");
6267
6274
  caddyModeManagedLabel.append(caddyModeManaged, caddyManagedText);
6268
6275
  caddyModeExternalLabel.append(caddyModeExternal, caddyExternalText);
6269
- caddyModeRow.append(caddyModeManagedLabel, caddyModeExternalLabel);
6270
- const caddyForm = element("div", "dsh-mobile-control__origin-fields");
6276
+ caddyModeRow.append(caddyModeLegend, caddyModeExternalLabel, caddyModeManagedLabel);
6277
+ const caddyForm = element("div", "dsh-mobile-control__caddy-form");
6271
6278
  caddyForm.hidden = true;
6272
- const caddyDomainLabel = element("label", "dsh-mobile-control__field");
6279
+ const caddyFields = element("div", "dsh-mobile-control__origin-fields");
6280
+ const caddyDomainLabel = element("label", "dsh-mobile-control__field dsh-mobile-control__field--full");
6273
6281
  caddyDomainLabel.textContent = t("caddyDomain");
6274
6282
  const caddyDomain = element("input");
6275
6283
  caddyDomain.type = "url";
@@ -6277,7 +6285,7 @@ window.__ModuleLoader__.load({
6277
6285
  caddyDomain.maxLength = 512;
6278
6286
  caddyDomain.autocomplete = "off";
6279
6287
  caddyDomain.spellcheck = false;
6280
- const caddyProviderLabel = element("label", "dsh-mobile-control__field");
6288
+ const caddyProviderLabel = element("label", "dsh-mobile-control__field dsh-mobile-control__field--full");
6281
6289
  caddyProviderLabel.textContent = t("caddyDnsProvider");
6282
6290
  const caddyProvider = element("select");
6283
6291
  const caddyProviderOption = document.createElement("option");
@@ -6296,7 +6304,7 @@ window.__ModuleLoader__.load({
6296
6304
  caddySecretKey.type = "password";
6297
6305
  caddySecretKey.autocomplete = "off";
6298
6306
  caddySecretKey.spellcheck = false;
6299
- const caddyPortLabel = element("label", "dsh-mobile-control__field");
6307
+ const caddyPortLabel = element("label", "dsh-mobile-control__field dsh-mobile-control__field--full");
6300
6308
  caddyPortLabel.textContent = t("caddyListenPort");
6301
6309
  const caddyPort = element("input");
6302
6310
  caddyPort.type = "number";
@@ -6310,7 +6318,7 @@ window.__ModuleLoader__.load({
6310
6318
  caddySecretIdLabel.append(caddySecretId);
6311
6319
  caddySecretKeyLabel.append(caddySecretKey);
6312
6320
  caddyPortLabel.append(caddyPort);
6313
- caddyForm.append(caddyDomainLabel, caddyProviderLabel, caddySecretIdLabel, caddySecretKeyLabel, caddyPortLabel);
6321
+ caddyFields.append(caddyDomainLabel, caddyProviderLabel, caddySecretIdLabel, caddySecretKeyLabel, caddyPortLabel);
6314
6322
  const caddyInstall = element("button", "dsh-mobile-control__primary");
6315
6323
  caddyInstall.type = "button";
6316
6324
  caddyInstall.textContent = t("caddyInstall");
@@ -6330,8 +6338,10 @@ window.__ModuleLoader__.load({
6330
6338
  caddyFeedback.setAttribute("role", "status");
6331
6339
  caddyFeedback.setAttribute("aria-live", "polite");
6332
6340
  caddyFeedback.hidden = true;
6333
- caddyForm.append(caddyInstallNote, caddyInstall, caddyStatus, caddySave, caddyPurgeButton, caddyFeedback);
6334
- originSetup.append(caddyModeRow, caddyForm);
6341
+ const caddyActions = element("div", "dsh-mobile-control__actions dsh-mobile-control__caddy-actions");
6342
+ caddyActions.append(caddyInstall, caddySave, caddyPurgeButton);
6343
+ caddyForm.append(caddyFields, caddyInstallNote, caddyStatus, caddyActions, caddyFeedback);
6344
+ originSetup.append(originSetupTitle, caddyModeRow, originHelp, originWarning, originFields, originFeedback, originFormActions, caddyForm, originBackend);
6335
6345
  const tailscaleInfo = element("details", "dsh-mobile-control__details");
6336
6346
  const tailscaleInfoSummary = element("summary");
6337
6347
  tailscaleInfoSummary.textContent = t("tailscaleHelp");
@@ -10036,7 +10046,11 @@ window.__ModuleLoader__.load({
10036
10046
  .dsh-mobile-control__manage-row{display:flex;justify-content:space-between;gap:8px;margin-top:10px}.dsh-mobile-control__manage{flex:1 1 0;min-width:0;min-height:36px;padding:6px 8px;border:1px solid var(--dsw-alias-border-l3,#cfd5dd);border-radius:10px;background:transparent;color:inherit;font:12px/1.3 system-ui;cursor:pointer}.dsh-mobile-control__devices{margin-top:10px;border:1px solid var(--dsw-alias-border-l2,#e1e5eb);border-radius:10px;padding:8px;max-height:220px;overflow-y:auto}.dsh-mobile-control__device-empty{color:var(--dsw-alias-label-secondary,#606873);font-size:12px;margin:0}.dsh-mobile-control__device{display:flex;align-items:center;gap:8px;padding:6px 2px}.dsh-mobile-control__device + .dsh-mobile-control__device{border-top:1px solid var(--dsw-alias-border-l2,#e1e5eb)}.dsh-mobile-control__device-label{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.dsh-mobile-control__device-meta{flex:none;color:var(--dsw-alias-label-secondary,#606873);font-size:11px;white-space:nowrap}.dsh-mobile-control__device-revoke{flex:none;min-height:36px;padding:4px 8px;border:1px solid var(--dsw-alias-state-error-primary,#dc2626);border-radius:8px;background:transparent;color:var(--dsw-alias-label-primary,#dc2626);font:12px/1.2 system-ui;cursor:pointer}.dsh-mobile-control__ws-paths{margin:10px 0 0;padding:12px;border:1px solid var(--dsw-alias-border-l2,#dbe1e8);border-radius:13px;background:var(--dsw-alias-bg-layer-2,#fff)}.dsh-mobile-control__ws-paths-list{margin:0 0 8px;padding:0;list-style:none}.dsh-mobile-control__ws-paths-empty{color:var(--dsw-alias-label-secondary,#606873);font-size:12px}.dsh-mobile-control__ws-paths-item{display:flex;align-items:center;gap:8px;padding:6px 0}.dsh-mobile-control__ws-paths-item + .dsh-mobile-control__ws-paths-item{border-top:1px solid var(--dsw-alias-border-l2,#e1e5eb)}.dsh-mobile-control__ws-paths-item code{flex:1 1 0;min-width:0;overflow:hidden;font:11px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}.dsh-mobile-control__ws-paths-remove{flex:none;min-height:36px;padding:4px 8px;border:1px solid var(--dsw-alias-border-l3,#cfd5dd);border-radius:8px;background:transparent;color:inherit;font:12px/1.2 system-ui;cursor:pointer}.dsh-mobile-control__trigger,.dsh-mobile-control__diagnostic-entry{position:relative}.dsh-mobile-control__ws-dot{position:absolute;top:2px;right:2px;z-index:1;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--dsw-alias-state-error-primary,#dc2626);color:#fff;font:650 11px/16px system-ui;text-align:center;cursor:pointer}.dsh-mobile-control__ws-dot::after{content:'';position:absolute;inset:-5px}.dsh-mobile-control__ws-sr-status{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.dsh-mobile-control__ws-paths-row{display:flex;gap:8px}.dsh-mobile-control__ws-paths-row .dsh-mobile-control__primary{width:auto;flex:none;padding:9px 14px;border-radius:10px}.dsh-mobile-control__ws-paths-group{padding:6px 0}.dsh-mobile-control__ws-paths-group + .dsh-mobile-control__ws-paths-group{border-top:1px solid var(--dsw-alias-border-l2,#e1e5eb)}.dsh-mobile-control__ws-paths-group-head{display:flex;align-items:center;gap:8px}.dsh-mobile-control__ws-count{flex:none;padding:1px 7px;border-radius:999px;background:var(--dsw-alias-state-business-tertiary,#e8f0ff);color:var(--dsw-alias-label-primary,#1d4ed8);font:650 11px/1.6 system-ui}.dsh-mobile-control__ws-paths-item.is-child{padding-left:12px}.dsh-mobile-control__ws-paths-group-head .dsh-mobile-control__primary,.dsh-mobile-control__ws-paths-item .dsh-mobile-control__primary{width:auto;flex:none;min-height:36px;padding:6px 12px;border-radius:10px}.dsh-mobile-control__ws-paths-row input{flex:1 1 0;min-width:0;box-sizing:border-box;min-height:44px;padding:9px 10px;border:1px solid var(--dsw-alias-border-l3,#cfd5dd);border-radius:10px;background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-primary,#16181d);font:16px/1.4 system-ui}.dsh-mobile-control__ws-paths-row button{flex:none}.dsh-mobile-control__ws-paths-detected-title{margin:0 0 2px;font:600 12px/1.4 system-ui}.dsh-mobile-control__ws-paths-advanced{margin-top:8px}.dsh-mobile-control__ws-paths-advanced summary{cursor:pointer;color:var(--dsw-alias-label-secondary,#606873);font:12px/1.4 system-ui;user-select:none}.dsh-mobile-control__ws-paths-advanced summary:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,currentColor);outline-offset:2px;border-radius:4px}.dsh-mobile-control__ws-paths-advanced[open] summary{margin-bottom:6px}.dsh-mobile-control__ws-paths-advanced .dsh-mobile-control__status{margin:6px 0 0}
10037
10047
  @media (max-width:359px){.dsh-mobile-control__provider{min-height:68px}}@media (prefers-reduced-motion:reduce){.dsh-mobile-control__provider,.dsh-mobile-control__cpolar-connect{transition:none}.dsh-mobile-control__diagnostic-summary.is-running .dsh-mobile-control__diagnostic-summary-icon::before,.dsh-mobile-control__diagnostic-checks{animation:none}}
10038
10048
 
10039
- .dsh-mobile-control__origin-setup{margin:0;padding:12px;border:1px solid var(--dsw-alias-border-l2,#dbe1e8);border-radius:13px;background:var(--dsw-alias-bg-layer-2,#fff)}.dsh-mobile-control__origin-setup[hidden],.dsh-mobile-control__origin-backend[hidden],.dsh-mobile-control__origin-feedback[hidden]{display:none}.dsh-mobile-control__origin-fields{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:12px}.dsh-mobile-control__origin-fields>.dsh-mobile-control__field{font-size:12px}.dsh-mobile-control__origin-fields>.dsh-mobile-control__field:nth-child(1),.dsh-mobile-control__origin-fields>.dsh-mobile-control__field:nth-child(4){grid-column:1/-1}.dsh-mobile-control__origin-fields>.dsh-mobile-control__field:nth-child(2){grid-column:1}.dsh-mobile-control__origin-fields>.dsh-mobile-control__field:nth-child(3){grid-column:2}.dsh-mobile-control__origin-warning{margin:12px 0;padding:10px 12px;border-left:3px solid var(--dsw-alias-state-warn-primary,#a56810);border-radius:4px;background:var(--dsw-alias-bg-layer-1,#f3f5f8);color:var(--dsw-alias-label-primary,#384152);font-size:12px;line-height:1.6}.dsh-mobile-control__origin-feedback{font-size:12px;line-height:1.6;overflow-wrap:anywhere}.dsh-mobile-control__origin-feedback.is-error{color:var(--dsw-alias-state-error-primary,#bc3030)}.dsh-mobile-control__origin-fields input[aria-invalid=true]{border-color:var(--dsw-alias-state-error-primary,#bc3030)}.dsh-mobile-control__origin-backend{display:flex;min-width:0;flex-direction:column;align-items:stretch;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l2,#dbe1e8)}.dsh-mobile-control__origin-backend button{align-self:flex-start;min-height:44px}.dsh-mobile-control__self-hosted-body .is-origin{margin-top:8px}
10049
+ .dsh-mobile-control__origin-setup{margin:0;padding:12px;border:1px solid var(--dsw-alias-border-l2,#dbe1e8);border-radius:13px;background:var(--dsw-alias-bg-layer-2,#fff)}.dsh-mobile-control__origin-setup[hidden],.dsh-mobile-control__origin-setup [hidden]{display:none}
10050
+ /* Mode choices are not text fields; preserve native radio sizing and keyboard behavior. */
10051
+ .dsh-mobile-control__origin-modes{min-width:0;margin:0 0 14px;padding:0;border:0}.dsh-mobile-control__origin-modes legend{margin:0 0 8px;padding:0;color:var(--dsw-alias-label-secondary,#606873);font:600 12px/1.4 system-ui}.dsh-mobile-control__origin-mode{display:flex;box-sizing:border-box;min-height:44px;align-items:center;gap:10px;padding:10px;border:1px solid var(--dsw-alias-border-l2,#dbe1e8);border-radius:10px;background:var(--dsw-alias-bg-layer-1,#f3f5f8);font:12px/1.5 system-ui;cursor:pointer}.dsh-mobile-control__origin-mode+.dsh-mobile-control__origin-mode{margin-top:8px}.dsh-mobile-control__origin-mode:has(input:checked){border-color:var(--dsw-alias-label-primary-bluish,#2563eb)}.dsh-mobile-control__origin-mode:focus-within{outline:2px solid var(--dsw-alias-state-business-primary,#2563eb);outline-offset:2px}.dsh-mobile-control__origin-mode:has(input:disabled){cursor:wait;opacity:.55}.dsh-mobile-control__origin-mode input[type=radio]{flex:0 0 18px;box-sizing:border-box;width:18px;height:18px;min-height:18px;margin:0;padding:0;accent-color:var(--dsw-alias-label-primary-bluish,#2563eb)}.dsh-mobile-control__origin-mode span{min-width:0;overflow-wrap:anywhere}
10052
+ /* Base the columns on the card width, not the desktop viewport behind the popup. */
10053
+ .dsh-mobile-control__origin-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));gap:12px}.dsh-mobile-control__origin-fields>.dsh-mobile-control__field{min-width:0;grid-column:auto;font-size:12px}.dsh-mobile-control__origin-fields>.dsh-mobile-control__field--full{grid-column:1/-1}.dsh-mobile-control__origin-fields select{box-sizing:border-box;width:100%;min-height:44px;padding:9px 10px;border:1px solid var(--dsw-alias-border-l3,#cfd5dd);border-radius:10px;background:var(--dsw-alias-bg-layer-2,#fff);color:var(--dsw-alias-label-primary,#16181d);font:16px/1.4 system-ui}.dsh-mobile-control__origin-fields select:disabled{cursor:not-allowed;opacity:.55}.dsh-mobile-control__caddy-form{display:grid;gap:12px}.dsh-mobile-control__caddy-form>.dsh-mobile-control__component-note,.dsh-mobile-control__caddy-form>.dsh-mobile-control__component-status,.dsh-mobile-control__caddy-form>.dsh-mobile-control__origin-feedback{margin:0;overflow-wrap:anywhere}.dsh-mobile-control__origin-setup .dsh-mobile-control__actions.dsh-mobile-control__caddy-actions{grid-template-columns:minmax(0,1fr);margin:0}.dsh-mobile-control__caddy-actions button{box-sizing:border-box;min-width:0;min-height:44px;padding:10px 12px;border-radius:10px;font:600 12px/1.4 system-ui;cursor:pointer}.dsh-mobile-control__origin-warning{margin:12px 0;padding:10px 12px;border-left:3px solid var(--dsw-alias-state-warn-primary,#a56810);border-radius:4px;background:var(--dsw-alias-bg-layer-1,#f3f5f8);color:var(--dsw-alias-label-primary,#384152);font-size:12px;line-height:1.6}.dsh-mobile-control__origin-feedback{font-size:12px;line-height:1.6;overflow-wrap:anywhere}.dsh-mobile-control__origin-feedback.is-error{color:var(--dsw-alias-state-error-primary,#bc3030)}.dsh-mobile-control__origin-fields input[aria-invalid=true]{border-color:var(--dsw-alias-state-error-primary,#bc3030)}.dsh-mobile-control__origin-backend{display:flex;min-width:0;flex-direction:column;align-items:stretch;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l2,#dbe1e8)}.dsh-mobile-control__origin-backend button{align-self:flex-start;min-height:44px}.dsh-mobile-control__self-hosted-body .is-origin{margin-top:8px}
10040
10054
  `;
10041
10055
  /** Mount the desktop control or mobile feature enhancements. */
10042
10056
  function apply(ctx) {