dsh-life-pack 0.3.48 → 0.3.50
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/dist/client.js +138 -36
- package/dist/client.js.map +1 -1
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -159,14 +159,14 @@ window.__ModuleLoader__.load({
|
|
|
159
159
|
path: "/api/ilife-manager"
|
|
160
160
|
};
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
162
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/config.js
|
|
163
163
|
function assertPrefix(value, role) {
|
|
164
164
|
if (typeof value !== "string" || value.length === 0) throw new Error("[dsh-plugin-update] " + role + " 非法:须为非空字符串(收到 " + JSON.stringify(value) + ")");
|
|
165
165
|
if (value.includes(".") || value.includes("/") || value.includes("\\") || /\s/.test(value)) throw new Error("[dsh-plugin-update] " + role + " 非法:不得含有点、路径分隔符或空白(收到 " + JSON.stringify(value) + ")");
|
|
166
166
|
return value;
|
|
167
167
|
}
|
|
168
168
|
//#endregion
|
|
169
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
169
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/redaction.js
|
|
170
170
|
const COPY_BUDGET_CHARS = 1500;
|
|
171
171
|
const REDACTED_PATH = "<路径>";
|
|
172
172
|
const REDACTED_SECRET = "<脱敏>";
|
|
@@ -230,7 +230,7 @@ window.__ModuleLoader__.load({
|
|
|
230
230
|
return truncateForCopy(scrubWithoutBudget(flat));
|
|
231
231
|
}
|
|
232
232
|
//#endregion
|
|
233
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
233
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/service.js
|
|
234
234
|
function updateError(code) {
|
|
235
235
|
return Object.assign(new Error(code), { code });
|
|
236
236
|
}
|
|
@@ -317,7 +317,7 @@ window.__ModuleLoader__.load({
|
|
|
317
317
|
return 0;
|
|
318
318
|
}
|
|
319
319
|
//#endregion
|
|
320
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
320
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/lang.js
|
|
321
321
|
function normalizeLangTag(tag) {
|
|
322
322
|
if (typeof tag !== "string") return "zh";
|
|
323
323
|
const s = tag.trim().toLowerCase().replace(/_/g, "-");
|
|
@@ -438,7 +438,7 @@ window.__ModuleLoader__.load({
|
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
440
|
//#endregion
|
|
441
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
441
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/bilingual.js
|
|
442
442
|
const BILINGUAL_STRINGS = {
|
|
443
443
|
"entry.label.idle": {
|
|
444
444
|
en: "Check for updates",
|
|
@@ -2030,7 +2030,7 @@ window.__ModuleLoader__.load({
|
|
|
2030
2030
|
}
|
|
2031
2031
|
const BILINGUAL_CSS = [".dsh-upd-bi{display:inline;overflow-wrap:anywhere}", ".dsh-upd-bi [lang]{overflow-wrap:anywhere}"].join("\n");
|
|
2032
2032
|
//#endregion
|
|
2033
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
2033
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/changelog.js
|
|
2034
2034
|
const CHANGELOG_MAX_CHARS = 65536;
|
|
2035
2035
|
const CHANGELOG_ALL_CATEGORIES = [
|
|
2036
2036
|
"Added",
|
|
@@ -2507,12 +2507,12 @@ ${blocks.join("\n")}
|
|
|
2507
2507
|
}
|
|
2508
2508
|
}
|
|
2509
2509
|
//#endregion
|
|
2510
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
2510
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/log-events.js
|
|
2511
2511
|
const LOG_EVENT_CALL = "host.call";
|
|
2512
2512
|
const LOG_EVENT_CALL_FAIL = "host.call.fail";
|
|
2513
2513
|
const LOG_EVENT_INSTALL_EXEC = "update.install.exec";
|
|
2514
2514
|
//#endregion
|
|
2515
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
2515
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/panel.js
|
|
2516
2516
|
function normalizePanelTheme(value) {
|
|
2517
2517
|
return value === "archive" ? "archive" : "default";
|
|
2518
2518
|
}
|
|
@@ -2539,6 +2539,7 @@ ${blocks.join("\n")}
|
|
|
2539
2539
|
busyBg: "--dsh-update-busy-bg",
|
|
2540
2540
|
busyBorder: "--dsh-update-busy-border",
|
|
2541
2541
|
busyText: "--dsh-update-busy-text",
|
|
2542
|
+
newText: "--dsh-update-new-text",
|
|
2542
2543
|
fontSans: "--dsh-update-font-sans",
|
|
2543
2544
|
fontSerif: "--dsh-update-font-serif",
|
|
2544
2545
|
fontMono: "--dsh-update-font-mono",
|
|
@@ -2573,7 +2574,8 @@ ${blocks.join("\n")}
|
|
|
2573
2574
|
"badText",
|
|
2574
2575
|
"busyBg",
|
|
2575
2576
|
"busyBorder",
|
|
2576
|
-
"busyText"
|
|
2577
|
+
"busyText",
|
|
2578
|
+
"newText"
|
|
2577
2579
|
]);
|
|
2578
2580
|
function themeTokensError(raw) {
|
|
2579
2581
|
return /* @__PURE__ */ new Error(`[dsh-plugin-update] \u4E3B\u9898\u53C2\u6570 themeTokens \u975E\u6CD5\uFF1A\u53EA\u6536\u5DF2\u77E5 token \u952E\uFF08\u989C\u8272\u7528 hex \u6216\u82F1\u6587\u540D\uFF0C\u5B57\u4F53/\u5706\u89D2/\u9634\u5F71/\u5C3A\u5BF8\u4E3A\u5B89\u5168 CSS \u503C\uFF0CentryScale \u4E3A\u5927\u4E8E 0 \u7684\u6709\u9650\u6570\uFF09\uFF08\u6536\u5230 ${JSON.stringify(raw ?? null)})`);
|
|
@@ -3079,13 +3081,13 @@ ${blocks.join("\n")}
|
|
|
3079
3081
|
};
|
|
3080
3082
|
}
|
|
3081
3083
|
const UPDATE_PANEL_CSS = [
|
|
3082
|
-
".dsh-upd{font:14px/1.
|
|
3084
|
+
".dsh-upd{font:14px/1.75 system-ui,\"Microsoft YaHei\",sans-serif;color:var(--dsh-update-text,#1f2937);",
|
|
3083
3085
|
"background:var(--dsh-update-bg,#ffffff);border:1px solid var(--dsh-update-border,#e5e7eb);border-radius:8px;padding:12px 14px;max-width:560px;",
|
|
3084
3086
|
"--dsh-update-ok-bg:#ecfdf5;--dsh-update-ok-border:#059669;--dsh-update-warn-bg:#fffbeb;--dsh-update-warn-border:#d97706;",
|
|
3085
3087
|
"--dsh-update-bad-bg:#fef2f2;--dsh-update-bad-border:#dc2626;--dsh-update-busy-bg:#eff6ff;--dsh-update-busy-border:#2563eb}",
|
|
3086
3088
|
".dsh-upd *{box-sizing:border-box}",
|
|
3087
3089
|
".dsh-upd button{font:inherit;border:1px solid var(--dsh-update-border-strong,#d1d5db);border-radius:var(--dsh-update-radius-button,6px);background:var(--dsh-update-button-bg,#f9fafb);",
|
|
3088
|
-
"color:inherit;padding:
|
|
3090
|
+
"color:inherit;padding:7px 14px;cursor:pointer;margin:2px 6px 2px 0}",
|
|
3089
3091
|
".dsh-upd button:disabled{opacity:.45;cursor:not-allowed}",
|
|
3090
3092
|
".dsh-upd button:focus-visible{outline:2px solid var(--dsh-update-focus,#2563eb);outline-offset:1px}",
|
|
3091
3093
|
".dsh-upd button[data-primary=\"1\"]{background:var(--dsh-update-primary,#2563eb);border-color:var(--dsh-update-primary,#2563eb);color:#fff}",
|
|
@@ -3114,7 +3116,8 @@ ${blocks.join("\n")}
|
|
|
3114
3116
|
".dsh-upd-overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;z-index:9999}",
|
|
3115
3117
|
".dsh-upd-overlay .dsh-upd{background:var(--dsh-update-bg,#ffffff);max-height:85vh;display:flex;flex-direction:column;overflow:hidden}",
|
|
3116
3118
|
".dsh-upd-body{min-height:0}",
|
|
3117
|
-
".dsh-upd-
|
|
3119
|
+
".dsh-upd-body *{min-width:0}",
|
|
3120
|
+
".dsh-upd-overlay .dsh-upd-body{flex:1 1 auto;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--dsh-update-border,#e5e7eb) transparent}",
|
|
3118
3121
|
".dsh-upd-overlay .dsh-upd-body::-webkit-scrollbar{width:8px}",
|
|
3119
3122
|
".dsh-upd-overlay .dsh-upd-body::-webkit-scrollbar-thumb{background:var(--dsh-update-border,#e5e7eb);border-radius:4px}",
|
|
3120
3123
|
".dsh-upd-overlay .dsh-upd-body::-webkit-scrollbar-track{background:transparent}",
|
|
@@ -3125,11 +3128,11 @@ ${blocks.join("\n")}
|
|
|
3125
3128
|
".dsh-upd-meta{font-size:12.5px;opacity:.75}",
|
|
3126
3129
|
".dsh-upd-proftag{font-family:Consolas,Menlo,monospace;font-size:11px;border:1px solid var(--dsh-update-border,#d1d5db);border-radius:3px;padding:0 5px;margin-left:6px;letter-spacing:.06em}",
|
|
3127
3130
|
".dsh-upd-strip{display:flex;flex-wrap:wrap;margin:8px 0 0;border:1px solid var(--dsh-update-border,#e5e7eb);border-radius:4px;overflow:hidden;font-size:12.5px}",
|
|
3128
|
-
".dsh-upd-strip>div{flex:1 1 110px;padding:6px 10px;border-left:1px solid var(--dsh-update-border,#e5e7eb)}",
|
|
3131
|
+
".dsh-upd-strip>div{flex:1 1 110px;min-width:0;padding:6px 10px;border-left:1px solid var(--dsh-update-border,#e5e7eb)}",
|
|
3129
3132
|
".dsh-upd-strip>div:first-child{border-left:0}",
|
|
3130
3133
|
".dsh-upd-strip-k{display:block;font-size:11px;letter-spacing:.14em;opacity:.7}",
|
|
3131
|
-
".dsh-upd-strip-v{font-family:Consolas,Menlo,monospace;font-size:12.5px}",
|
|
3132
|
-
".dsh-upd-chapter{margin-top:
|
|
3134
|
+
".dsh-upd-strip-v{font-family:Consolas,Menlo,monospace;font-size:12.5px;word-break:break-all}",
|
|
3135
|
+
".dsh-upd-chapter{margin-top:18px;padding-top:14px;border-top:1px solid var(--dsh-update-border,#e5e7eb)}",
|
|
3133
3136
|
".dsh-upd-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:14px;padding-top:10px;border-top:1px solid var(--dsh-update-border,#e5e7eb)}",
|
|
3134
3137
|
".dsh-upd-foot-note{margin-right:auto;font-size:12px;opacity:.7}",
|
|
3135
3138
|
".dsh-upd-footer button{margin:0}",
|
|
@@ -3139,7 +3142,7 @@ ${blocks.join("\n")}
|
|
|
3139
3142
|
".dsh-upd-chap-rule{flex:1;border-top:1px solid var(--dsh-update-border,#e5e7eb);transform:translateY(-3px)}",
|
|
3140
3143
|
".dsh-upd-chap-note{flex:none;font-size:12px;opacity:.75}",
|
|
3141
3144
|
".dsh-upd-chap-note button{margin:0}",
|
|
3142
|
-
".dsh-upd-qrow{display:flex;align-items:baseline;gap:10px;padding:6px 0}",
|
|
3145
|
+
".dsh-upd-qrow{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;padding:6px 0;min-width:0}",
|
|
3143
3146
|
".dsh-upd-qrow+.dsh-upd-qrow{border-top:1px solid var(--dsh-update-border,#e5e7eb)}",
|
|
3144
3147
|
".dsh-upd-qdot{width:8px;height:8px;border-radius:50%;flex:none;align-self:center;background:currentColor;opacity:.5}",
|
|
3145
3148
|
".dsh-upd-qdot[data-tone=\"busy\"]{background:var(--dsh-update-warn-border,#d97706);opacity:1}",
|
|
@@ -3182,6 +3185,14 @@ ${blocks.join("\n")}
|
|
|
3182
3185
|
".dsh-upd-actions button:first-child:not([aria-busy=\"true\"])::after{content:\"\";display:inline-block;width:11px;height:11px;margin-left:8px;visibility:hidden}",
|
|
3183
3186
|
".dsh-upd-banner{min-height:1.2em}",
|
|
3184
3187
|
".dsh-upd-strip{min-height:48px}",
|
|
3188
|
+
".dsh-upd-actions{align-content:flex-start}",
|
|
3189
|
+
".dsh-upd-actions button{white-space:nowrap}",
|
|
3190
|
+
".dsh-upd-actions button:first-child{min-width:10em}",
|
|
3191
|
+
".dsh-upd-actions button[data-primary=\"1\"]{min-width:9em}",
|
|
3192
|
+
".dsh-upd-banner{min-height:3.4em;display:flex;flex-direction:column;justify-content:center}",
|
|
3193
|
+
".dsh-upd-banner{animation:none}",
|
|
3194
|
+
".dsh-upd-copy{min-height:1.75em}",
|
|
3195
|
+
".dsh-upd-copy--empty{visibility:hidden}",
|
|
3185
3196
|
"@media (prefers-color-scheme: dark){.dsh-upd{--dsh-update-text:#e5e7eb;--dsh-update-bg:#111827;--dsh-update-border:#374151;",
|
|
3186
3197
|
"--dsh-update-button-bg:#1f2937;--dsh-update-bg-soft:#1f2937;--dsh-update-primary:#3b82f6;--dsh-update-focus:#93c5fd;",
|
|
3187
3198
|
"--dsh-update-ok-bg:rgba(16,185,129,.14);--dsh-update-ok-border:#34d399;",
|
|
@@ -3472,6 +3483,7 @@ ${changelogHTML}
|
|
|
3472
3483
|
})}</div>`);
|
|
3473
3484
|
}
|
|
3474
3485
|
if (copyNotice) errLines.push(`<div class="dsh-upd-copy" role="status">${escapeHtml$2(copyNotice)}</div>`);
|
|
3486
|
+
else errLines.push("<div class=\"dsh-upd-copy dsh-upd-copy--empty\" aria-hidden=\"true\"></div>");
|
|
3475
3487
|
chapters.push(chapterOf(4, errLines.join(""), "", l));
|
|
3476
3488
|
}
|
|
3477
3489
|
chapters.push(chapterOf(5, view.showManual && manual ? `<div class="dsh-upd-manual"><div>${escapeHtml$2(copyText("panel.manual.heading", l))}</div><code>${escapeHtml$2(manual)}</code></div>` : `<div class="dsh-upd-manual"><div class="dsh-upd-changelog-neutral">${escapeHtml$2(copyText("panel.manual.absent", l))}</div></div>`, "", l));
|
|
@@ -3498,7 +3510,7 @@ ${UPDATE_PANEL_ARCHIVE_CSS}` : UPDATE_PANEL_CSS}</style>
|
|
|
3498
3510
|
${body}`;
|
|
3499
3511
|
}
|
|
3500
3512
|
//#endregion
|
|
3501
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
3513
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/entry.js
|
|
3502
3514
|
const UPDATE_ENTRY_CSS = [
|
|
3503
3515
|
".dsh-upd-entry{display:inline-flex;align-items:center;gap:8px;font:13px/1.6 var(--dsh-update-font-sans,system-ui,\"Microsoft YaHei\",sans-serif);font-size:var(--dsh-update-entry-font-size,13px);color:var(--dsh-update-text,#1f2937)}",
|
|
3504
3516
|
".dsh-upd-entry-btn{font:inherit;border:1px solid var(--dsh-update-border,#d1d5db);border-radius:var(--dsh-update-entry-border-radius,6px);",
|
|
@@ -3519,6 +3531,8 @@ ${body}`;
|
|
|
3519
3531
|
".dsh-upd-entry[data-state=\"update\"] .dsh-upd-entry-dot{background:var(--dsh-update-ok-border,#059669)}",
|
|
3520
3532
|
".dsh-upd-entry[data-state=\"busy\"] .dsh-upd-entry-dot,.dsh-upd-entry[data-state=\"restart\"] .dsh-upd-entry-dot{background:var(--dsh-update-warn-border,#d97706)}",
|
|
3521
3533
|
".dsh-upd-entry[data-state=\"failed\"] .dsh-upd-entry-dot{background:var(--dsh-update-bad-border,#dc2626)}",
|
|
3534
|
+
".dsh-upd-entry[data-known=\"uptodate\"] .dsh-upd-entry-btn{border-color:var(--dsh-update-border,#d1d5db);color:var(--dsh-update-text-muted,#6b7280)}",
|
|
3535
|
+
".dsh-upd-entry[data-known=\"uptodate\"] .dsh-upd-entry-btn:hover{border-color:var(--dsh-update-primary,#2563eb);color:var(--dsh-update-primary,#2563eb)}",
|
|
3522
3536
|
".dsh-upd-entry-note{font-size:12.5px;opacity:.9;background:var(--dsh-update-bg,#ffffff);border:1px solid var(--dsh-update-border,#e5e7eb);border-radius:var(--dsh-update-radius-badge,4px);padding:1px 8px}",
|
|
3523
3537
|
".dsh-upd-entry[data-theme=\"archive\"] .dsh-upd-entry-note{background:var(--dsh-update-bg);border-color:var(--dsh-update-border-strong);color:var(--dsh-update-text)}",
|
|
3524
3538
|
".dsh-upd-entry[data-theme=\"archive\"]{--dsh-update-text:#1a1a1a;--dsh-update-text-muted:#6f675a;--dsh-update-border-strong:#c4b896;--dsh-update-primary:#c8402a;--dsh-update-bg:#fffdf6;",
|
|
@@ -3527,7 +3541,7 @@ ${body}`;
|
|
|
3527
3541
|
".dsh-upd-entry[data-theme=\"archive\"] .dsh-upd-entry-btn{border-color:var(--dsh-update-border-strong);background:var(--dsh-update-bg);color:var(--dsh-update-text);border-radius:var(--dsh-update-entry-border-radius,3px)}",
|
|
3528
3542
|
".dsh-upd-entry[data-theme=\"archive\"] .dsh-upd-entry-btn:hover{border-color:var(--dsh-update-primary);color:var(--dsh-update-primary)}",
|
|
3529
3543
|
"@media (prefers-color-scheme: dark){.dsh-upd-entry[data-theme=\"archive\"]{--dsh-update-text:#ece5d3;--dsh-update-text-muted:#a89c83;--dsh-update-border-strong:#5c4e3b;--dsh-update-primary:#e0684e;--dsh-update-bg:#1e1a15}}",
|
|
3530
|
-
"@media (prefers-color-scheme: dark){.dsh-upd-entry{color:#e5e7eb}",
|
|
3544
|
+
"@media (prefers-color-scheme: dark){.dsh-upd-entry{color:#e5e7eb;--dsh-update-text-muted:#9ca3af}",
|
|
3531
3545
|
".dsh-upd-entry-btn{--dsh-update-button-bg:#1f2937;--dsh-update-border:#374151}}"
|
|
3532
3546
|
].join("\n");
|
|
3533
3547
|
function isTerminalPhase(phase) {
|
|
@@ -3610,7 +3624,7 @@ ${body}`;
|
|
|
3610
3624
|
}
|
|
3611
3625
|
}
|
|
3612
3626
|
//#endregion
|
|
3613
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
3627
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/panel-batch.js
|
|
3614
3628
|
const BATCH_PANEL_POLL = {
|
|
3615
3629
|
defaultMs: 1500,
|
|
3616
3630
|
minMs: 250
|
|
@@ -3627,7 +3641,7 @@ ${body}`;
|
|
|
3627
3641
|
prefsSave: p + ".batchPrefsSave"
|
|
3628
3642
|
};
|
|
3629
3643
|
}
|
|
3630
|
-
function batchLedgerCounts(rows) {
|
|
3644
|
+
function batchLedgerCounts(rows, inventory) {
|
|
3631
3645
|
const counts = {
|
|
3632
3646
|
updatable: 0,
|
|
3633
3647
|
installing: 0,
|
|
@@ -3643,13 +3657,22 @@ ${body}`;
|
|
|
3643
3657
|
else if (phase === "failed") counts.failed += 1;
|
|
3644
3658
|
else if (phase === "installing") counts.installing += 1;
|
|
3645
3659
|
else if (phase === "ready") counts.updatable += 1;
|
|
3646
|
-
else if (phase === "pending"
|
|
3660
|
+
else if (phase === "pending") counts[ledgerKnowledgeBucket(knowledgeEntryOf(inventory, row.key))] += 1;
|
|
3661
|
+
else if (phase === "checking") counts.pending += 1;
|
|
3647
3662
|
else if (phase === "skipped") counts.skipped += 1;
|
|
3648
3663
|
else if (row.restartRequired === true) counts.restart += 1;
|
|
3649
3664
|
else counts.settled += 1;
|
|
3650
3665
|
}
|
|
3651
3666
|
return counts;
|
|
3652
3667
|
}
|
|
3668
|
+
function ledgerKnowledgeBucket(entry) {
|
|
3669
|
+
if (!entry) return "pending";
|
|
3670
|
+
if (entry.error) return "failed";
|
|
3671
|
+
if (entry.latestVersion && entry.installedVersion) return entry.latestVersion !== entry.installedVersion ? "updatable" : "settled";
|
|
3672
|
+
if (entry.latestVersion && !entry.installedVersion) return "updatable";
|
|
3673
|
+
if (entry.lastCheckedAt > 0) return "settled";
|
|
3674
|
+
return "pending";
|
|
3675
|
+
}
|
|
3653
3676
|
function batchLedgerText(counts, lang) {
|
|
3654
3677
|
const l = langOf(lang);
|
|
3655
3678
|
const parts = [];
|
|
@@ -3752,6 +3775,62 @@ ${body}`;
|
|
|
3752
3775
|
if (entry.lastCheckedAt > 0) return batchText("batch.row.current", lang);
|
|
3753
3776
|
return batchText("batch.row.never", lang);
|
|
3754
3777
|
}
|
|
3778
|
+
function batchRowVersionParts(row, knowledge) {
|
|
3779
|
+
const sessionTarget = typeof row.targetVersion === "string" && row.targetVersion ? row.targetVersion : null;
|
|
3780
|
+
if (sessionTarget) {
|
|
3781
|
+
const current2 = currentVersionOf(row);
|
|
3782
|
+
if (current2 === null) return {
|
|
3783
|
+
current: null,
|
|
3784
|
+
latest: sessionTarget,
|
|
3785
|
+
hasUpdate: true
|
|
3786
|
+
};
|
|
3787
|
+
if (current2 === sessionTarget) return {
|
|
3788
|
+
current: current2,
|
|
3789
|
+
latest: null,
|
|
3790
|
+
hasUpdate: false
|
|
3791
|
+
};
|
|
3792
|
+
return {
|
|
3793
|
+
current: current2,
|
|
3794
|
+
latest: sessionTarget,
|
|
3795
|
+
hasUpdate: true
|
|
3796
|
+
};
|
|
3797
|
+
}
|
|
3798
|
+
const current = currentVersionOf(row) ?? (knowledge && typeof knowledge.installedVersion === "string" && knowledge.installedVersion ? knowledge.installedVersion : null);
|
|
3799
|
+
const latest = knowledge && typeof knowledge.latestVersion === "string" && knowledge.latestVersion ? knowledge.latestVersion : null;
|
|
3800
|
+
if (current && latest && latest !== current) return {
|
|
3801
|
+
current,
|
|
3802
|
+
latest,
|
|
3803
|
+
hasUpdate: true
|
|
3804
|
+
};
|
|
3805
|
+
if (current) return {
|
|
3806
|
+
current,
|
|
3807
|
+
latest: null,
|
|
3808
|
+
hasUpdate: false
|
|
3809
|
+
};
|
|
3810
|
+
if (latest) return {
|
|
3811
|
+
current: latest,
|
|
3812
|
+
latest: null,
|
|
3813
|
+
hasUpdate: false
|
|
3814
|
+
};
|
|
3815
|
+
return {
|
|
3816
|
+
current: null,
|
|
3817
|
+
latest: null,
|
|
3818
|
+
hasUpdate: false
|
|
3819
|
+
};
|
|
3820
|
+
}
|
|
3821
|
+
function batchRowVersionHTML(row, knowledge) {
|
|
3822
|
+
const parts = batchRowVersionParts(row, knowledge);
|
|
3823
|
+
if (parts.hasUpdate && parts.latest) return "<span class=\"dsh-upd-bver\"><span class=\"dsh-upd-bver-cur\">" + escapeHtml$1(parts.current ?? "?") + "</span><span class=\"dsh-upd-bver-arrow\" aria-hidden=\"true\"> → </span><span class=\"dsh-upd-bver-new\">" + escapeHtml$1(parts.latest) + "</span></span>";
|
|
3824
|
+
if (parts.current) return "<span class=\"dsh-upd-bver\">" + escapeHtml$1(parts.current) + "</span>";
|
|
3825
|
+
return "";
|
|
3826
|
+
}
|
|
3827
|
+
function batchRowPendingStatus(row, knowledge, lang) {
|
|
3828
|
+
if (asBatchPhase(row.phase) !== "pending") return null;
|
|
3829
|
+
const known = batchRowKnowledgeText(row, knowledge, lang);
|
|
3830
|
+
if (known !== null) return known;
|
|
3831
|
+
if (!knowledge) return batchText("batch.row.never", lang);
|
|
3832
|
+
return null;
|
|
3833
|
+
}
|
|
3755
3834
|
function renderBatchPanelHTML(input) {
|
|
3756
3835
|
const rows = Array.isArray(input.rows) ? input.rows : [];
|
|
3757
3836
|
const theme = normalizePanelTheme(input.theme);
|
|
@@ -3761,7 +3840,7 @@ ${body}`;
|
|
|
3761
3840
|
const expandedKey = typeof input.expandedKey === "string" && input.expandedKey ? input.expandedKey : null;
|
|
3762
3841
|
const lastError = typeof input.lastError === "string" && input.lastError ? input.lastError : null;
|
|
3763
3842
|
const loaded = input.loaded === void 0 ? rows.length > 0 : input.loaded === true;
|
|
3764
|
-
const counts = batchLedgerCounts(rows);
|
|
3843
|
+
const counts = batchLedgerCounts(rows, input.inventory);
|
|
3765
3844
|
const installing = counts.installing > 0;
|
|
3766
3845
|
const macroBusy = input.inFlight === true || installing;
|
|
3767
3846
|
const total = rows.length;
|
|
@@ -3927,8 +4006,8 @@ ${body}`;
|
|
|
3927
4006
|
const skipped = ctx.skipped;
|
|
3928
4007
|
const queued = isQueuedRow(row);
|
|
3929
4008
|
const position = queued ? queuePositionOf(row) : null;
|
|
3930
|
-
const
|
|
3931
|
-
const
|
|
4009
|
+
const versionHTML = batchRowVersionHTML(row, ctx.knowledge);
|
|
4010
|
+
const rowStatusText = queued ? batchQueuedStatus(position, ctx.lang) : ctx.inRound ? batchRowKnowledgeText(row, ctx.knowledge, ctx.lang) ?? batchRowStatus(row, skipped, ctx.lang) : batchRowPendingStatus(row, ctx.knowledge, ctx.lang) ?? batchRowStatus(row, skipped, ctx.lang);
|
|
3932
4011
|
const actions = [];
|
|
3933
4012
|
const off = ctx.inFlight ? " disabled" : "";
|
|
3934
4013
|
if (phase === "installing") actions.push("<button type=\"button\" data-act=\"row-install\" data-key=\"" + keyAttr + "\" disabled>" + escapeHtml$1(batchText("batch.row-action.installing", ctx.lang)) + "</button>");
|
|
@@ -3949,7 +4028,7 @@ ${body}`;
|
|
|
3949
4028
|
const codeEsc = escapeHtml$1(failCode);
|
|
3950
4029
|
return "<span class=\"dsh-upd-bfail\">" + (escaped.includes(codeEsc) ? escaped.replace(codeEsc, "<code>" + codeEsc + "</code>") : escaped) + "</span>";
|
|
3951
4030
|
})() : "";
|
|
3952
|
-
const main = "<button type=\"button\" class=\"dsh-upd-brow-main\" data-act=\"toggle-details\" data-key=\"" + keyAttr + "\" aria-expanded=\"" + (ctx.expanded ? "true" : "false") + "\"><span class=\"dsh-upd-updot\" data-tone=\"" + dotToneOf(row, phase, skipped, queued) + "\"></span><span class=\"dsh-upd-bname\">" + escapeHtml$1(titleOf(row, ctx.titles)) + "</span>" +
|
|
4031
|
+
const main = "<button type=\"button\" class=\"dsh-upd-brow-main\" data-act=\"toggle-details\" data-key=\"" + keyAttr + "\" aria-expanded=\"" + (ctx.expanded ? "true" : "false") + "\"><span class=\"dsh-upd-updot\" data-tone=\"" + dotToneOf(row, phase, skipped, queued) + "\"></span><span class=\"dsh-upd-bname\">" + escapeHtml$1(titleOf(row, ctx.titles)) + "</span>" + versionHTML + "<span class=\"dsh-upd-bstat\">" + escapeHtml$1(rowStatusText) + (ctx.inRound && !queued ? "(" + escapeHtml$1(batchText("batch.row.unfinished-tag", ctx.lang)) + ")" : "") + "</span>" + failLine + "</button>";
|
|
3953
4032
|
const detail = ctx.expanded ? "<div class=\"dsh-upd-bdetail\" data-key=\"" + keyAttr + "\">" + detailActionsHTML(row, ctx) + (ctx.notice !== null ? "<div class=\"dsh-upd-bdetail-notice\" role=\"status\">" + escapeHtml$1(ctx.notice) + "</div>" : "") + detailHTML(row, ctx) + "</div>" : "";
|
|
3954
4033
|
return "<div class=\"dsh-upd-brow-set\" data-key=\"" + keyAttr + "\"><div class=\"dsh-upd-brow\" data-phase=\"" + escapeHtml$1(phase) + "\" data-key=\"" + keyAttr + "\"" + (queued ? " data-queued=\"1\"" : "") + ">" + main + "<span class=\"dsh-upd-brow-actions\">" + actions.join("") + "</span></div>" + detail + "</div>";
|
|
3955
4034
|
}
|
|
@@ -4013,7 +4092,7 @@ ${body}`;
|
|
|
4013
4092
|
".dsh-upd-brow-set{border-top:1px solid var(--dsh-update-border,#e5e7eb)}",
|
|
4014
4093
|
".dsh-upd-brow-set:first-child{border-top:0}",
|
|
4015
4094
|
".dsh-upd-brow{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 0}",
|
|
4016
|
-
".dsh-upd .dsh-upd-brow-main{display:
|
|
4095
|
+
".dsh-upd .dsh-upd-brow-main{display:grid;grid-template-columns:auto minmax(5em,max-content) minmax(18ch,max-content) minmax(0,1fr);align-items:baseline;column-gap:8px;row-gap:2px;flex:1 1 260px;min-width:0;",
|
|
4017
4096
|
"text-align:left;cursor:pointer;color:inherit;font:inherit;background:transparent;border:0;padding:2px 0;margin:0}",
|
|
4018
4097
|
".dsh-upd .dsh-upd-brow-main:hover{color:var(--dsh-update-primary,#2563eb)}",
|
|
4019
4098
|
".dsh-upd-brow-actions{flex:none;margin-left:auto}",
|
|
@@ -4024,10 +4103,16 @@ ${body}`;
|
|
|
4024
4103
|
".dsh-upd-updot[data-tone=\"busy\"]{background:var(--dsh-update-busy-border,#2563eb);opacity:1}",
|
|
4025
4104
|
".dsh-upd-updot[data-tone=\"warn\"]{background:var(--dsh-update-warn-border,#d97706);opacity:1}",
|
|
4026
4105
|
".dsh-upd-updot[data-tone=\"bad\"]{background:var(--dsh-update-bad-border,#dc2626);opacity:1}",
|
|
4027
|
-
".dsh-upd-bname{font-weight:700;
|
|
4028
|
-
".dsh-upd-bver{font-family:Consolas,Menlo,monospace;font-size:12px;
|
|
4029
|
-
".dsh-upd-
|
|
4030
|
-
".dsh-upd-
|
|
4106
|
+
".dsh-upd-bname{font-weight:700;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
4107
|
+
".dsh-upd-bver{font-family:Consolas,Menlo,monospace;font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums;min-width:0}",
|
|
4108
|
+
".dsh-upd-bver-cur{opacity:.65}",
|
|
4109
|
+
".dsh-upd-bver-arrow{opacity:.6}",
|
|
4110
|
+
".dsh-upd-bver-new{color:var(--dsh-update-new-text,#dc2626);font-weight:700}",
|
|
4111
|
+
".dsh-upd-bstat{font-size:12.5px;opacity:.9;min-width:0;overflow-wrap:anywhere}",
|
|
4112
|
+
".dsh-upd-bfail{grid-column:1/-1;display:block;font-size:12.5px;color:var(--dsh-update-bad-border,#dc2626)}",
|
|
4113
|
+
".dsh-upd-batch{--dsh-update-new-text:#dc2626}",
|
|
4114
|
+
"@media (prefers-color-scheme: dark){.dsh-upd-batch{--dsh-update-new-text:#f87171}}",
|
|
4115
|
+
"@media (forced-colors: active){.dsh-upd-bver-new{color:CanvasText}}",
|
|
4031
4116
|
".dsh-upd-blist{font-size:12.5px;margin-top:2px}",
|
|
4032
4117
|
".dsh-upd-batch-ledger{margin:8px 0 0;font-size:13px;opacity:.85}",
|
|
4033
4118
|
".dsh-upd-batch-more{margin-top:6px}",
|
|
@@ -4061,6 +4146,10 @@ ${body}`;
|
|
|
4061
4146
|
".dsh-upd[data-theme=\"archive\"] .dsh-upd-brow-main:hover{color:var(--dsh-update-primary)}",
|
|
4062
4147
|
".dsh-upd[data-theme=\"archive\"] .dsh-upd-bname{font-family:var(--dsh-update-font-serif)}",
|
|
4063
4148
|
".dsh-upd[data-theme=\"archive\"] .dsh-upd-bver{font-family:var(--dsh-update-font-mono);color:var(--dsh-update-text-muted)}",
|
|
4149
|
+
".dsh-upd[data-theme=\"archive\"] .dsh-upd-bver-cur{opacity:.75}",
|
|
4150
|
+
".dsh-upd[data-theme=\"archive\"] .dsh-upd-bver-new{color:var(--dsh-update-new-text,#b3261e)}",
|
|
4151
|
+
".dsh-upd[data-theme=\"archive\"] .dsh-upd-batch{--dsh-update-new-text:#b3261e}",
|
|
4152
|
+
"@media (prefers-color-scheme: dark){.dsh-upd[data-theme=\"archive\"] .dsh-upd-batch{--dsh-update-new-text:#ef8a7d}}",
|
|
4064
4153
|
".dsh-upd[data-theme=\"archive\"] .dsh-upd-batch-ledger{color:var(--dsh-update-text-muted)}",
|
|
4065
4154
|
".dsh-upd[data-theme=\"archive\"] .dsh-upd-batch-sum{color:var(--dsh-update-text)}",
|
|
4066
4155
|
".dsh-upd[data-theme=\"archive\"] .dsh-upd-brow-set{border-top-color:var(--dsh-update-border)}"
|
|
@@ -4527,10 +4616,23 @@ ${body}`;
|
|
|
4527
4616
|
return;
|
|
4528
4617
|
}
|
|
4529
4618
|
if (reply["ok"] === true) {
|
|
4530
|
-
const
|
|
4531
|
-
const
|
|
4532
|
-
|
|
4533
|
-
|
|
4619
|
+
const hasSession = "session" in reply && reply["session"] !== void 0;
|
|
4620
|
+
const hasRows = "rows" in reply && reply["rows"] !== void 0;
|
|
4621
|
+
if (!hasSession && !hasRows) {
|
|
4622
|
+
if (isObject$1(reply["prefs"])) lastPrefs = reply["prefs"];
|
|
4623
|
+
return;
|
|
4624
|
+
}
|
|
4625
|
+
if (hasSession) {
|
|
4626
|
+
const session = normalizeBatchSession(reply["session"]);
|
|
4627
|
+
lastSession = session;
|
|
4628
|
+
if (hasRows) {
|
|
4629
|
+
const parsed = readRows(reply["rows"]);
|
|
4630
|
+
rows = parsed.length > 0 ? parsed : rowsFromSession(session);
|
|
4631
|
+
} else rows = rowsFromSession(session);
|
|
4632
|
+
} else {
|
|
4633
|
+
const parsed = readRows(reply["rows"]);
|
|
4634
|
+
if (parsed.length > 0) rows = parsed;
|
|
4635
|
+
}
|
|
4534
4636
|
if (isObject$1(reply["inventory"])) {
|
|
4535
4637
|
lastInventory = reply["inventory"];
|
|
4536
4638
|
const at = reply["inventory"]["updatedAt"];
|
|
@@ -4884,7 +4986,7 @@ ${body}`;
|
|
|
4884
4986
|
};
|
|
4885
4987
|
}
|
|
4886
4988
|
//#endregion
|
|
4887
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.
|
|
4989
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.8.0/node_modules/dsh-plugin-update/dist/entry-batch.js
|
|
4888
4990
|
function isObject(value) {
|
|
4889
4991
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
4890
4992
|
}
|
|
@@ -7181,7 +7283,7 @@ ${body}`;
|
|
|
7181
7283
|
}, react.createElement("span", { style: S.morePkg }, row.pkg), react.createElement("span", { style: S.moreDesc }, row.desc), react.createElement("span", { style: S.moreIcon }, react.createElement(ExternalIcon, null)))));
|
|
7182
7284
|
}
|
|
7183
7285
|
/** 版本胶囊那一行字:只在这里拼一次,屏上与用例读的是同一串。 */
|
|
7184
|
-
const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.
|
|
7286
|
+
const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.50";
|
|
7185
7287
|
/** 爱生活面板:总设置区 + 检查更新(七家)+ 爱生活页签条(slot 驱动)+ 技能设置页投影/缺席卡。 */
|
|
7186
7288
|
function LifePackSection(props) {
|
|
7187
7289
|
const tabsId = react.useId();
|