dsh-multipane 1.0.17 → 1.0.19
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.md +7 -0
- package/lib/client.js +18 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,6 +246,13 @@ C:\Users\weiai\.dsh\plugin-src\_probe\sync-client.ps1 -Push # 台式机 ->
|
|
|
246
246
|
|
|
247
247
|
## 更新记录
|
|
248
248
|
|
|
249
|
+
### 1.0.19(2026-11-10)
|
|
250
|
+
- **打开设置页就自动检查一次**(静默,不弹窗):一进去就能看到「有新版本 X」或「已是最新(X,12:30 检查)」,
|
|
251
|
+
不用先点按钮、也就不会有「点了没反应」的错觉。手动点「检查更新」时才会弹窗。
|
|
252
|
+
|
|
253
|
+
### 1.0.18(2026-11-10)
|
|
254
|
+
- 更新弹窗里多一行「检查时间」,一眼看出这个版本号是什么时候问的市场,方便判断是不是缓存滞后。
|
|
255
|
+
|
|
249
256
|
### 1.0.17(2026-11-10)
|
|
250
257
|
- **修「明明有新版本却显示已是最新」**:插件市场对**相同 URL** 有服务端缓存,只带 `force=1` 仍会返回旧结果。
|
|
251
258
|
现在每次检查都加 `&t=时间戳` 绕过它。(这是我上一版验证时的漏洞:我用手写请求带时间戳测通了,
|
package/lib/client.js
CHANGED
|
@@ -17,7 +17,7 @@ window.__ModuleLoader__.load({
|
|
|
17
17
|
*/
|
|
18
18
|
const PLUGIN_LABEL = "多栏视图";
|
|
19
19
|
/* 与 package.json 的 version 必须一致(发版时两处同改;check-names.cjs 会校验)。 */
|
|
20
|
-
const PLUGIN_VERSION = "1.0.
|
|
20
|
+
const PLUGIN_VERSION = "1.0.19";
|
|
21
21
|
const NPM_LATEST_URL = "https://registry.npmjs.org/dsh-multipane/latest";
|
|
22
22
|
/* 插件市场的公开更新 API v1(dshmarket 提供,见其 UPDATE-API-V1.md)。
|
|
23
23
|
它自己负责装包/校验版本/回滚,我们只负责触发和显示结果——
|
|
@@ -6433,7 +6433,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6433
6433
|
checkedAt: ""
|
|
6434
6434
|
});
|
|
6435
6435
|
const closeModal = () => setUpdate((prev) => ({ ...prev, modal: false }));
|
|
6436
|
-
const checkUpdate = async () => {
|
|
6436
|
+
const checkUpdate = async (silent) => {
|
|
6437
|
+
const quiet = silent === true;
|
|
6437
6438
|
setUpdate({
|
|
6438
6439
|
phase: "checking",
|
|
6439
6440
|
text: "正在检查…",
|
|
@@ -6465,11 +6466,12 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6465
6466
|
text: `发现新版本 ${latest}`,
|
|
6466
6467
|
canUpdate: true,
|
|
6467
6468
|
opId: "",
|
|
6468
|
-
modal: true,
|
|
6469
|
+
modal: quiet !== true,
|
|
6469
6470
|
installed,
|
|
6470
6471
|
latest,
|
|
6471
6472
|
forceHint: "",
|
|
6472
|
-
progress: null
|
|
6473
|
+
progress: null,
|
|
6474
|
+
checkedAt: new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" })
|
|
6473
6475
|
});
|
|
6474
6476
|
} else if (compareVersion(latest, installed) > 0) {
|
|
6475
6477
|
/* 市场看到了更新的版本但暂不放行(新版本观察期,防供应链投毒)。
|
|
@@ -6483,7 +6485,8 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6483
6485
|
installed,
|
|
6484
6486
|
latest,
|
|
6485
6487
|
forceHint: "插件市场对刚发布的版本有观察期(通常十几分钟到几小时,防供应链投毒),这段时间装会被市场拒绝。过一会儿点「重新检查」,放行后再更新即可。",
|
|
6486
|
-
progress: null
|
|
6488
|
+
progress: null,
|
|
6489
|
+
checkedAt: new Date().toLocaleTimeString("zh-CN", { hour: "2-digit", minute: "2-digit" })
|
|
6487
6490
|
});
|
|
6488
6491
|
} else {
|
|
6489
6492
|
setUpdate({
|
|
@@ -6511,7 +6514,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6511
6514
|
text: newer ? `发现新版本 ${latest}` : `已是最新版本(${PLUGIN_VERSION})`,
|
|
6512
6515
|
canUpdate: false,
|
|
6513
6516
|
opId: "",
|
|
6514
|
-
modal: newer,
|
|
6517
|
+
modal: newer && quiet !== true,
|
|
6515
6518
|
installed: PLUGIN_VERSION,
|
|
6516
6519
|
latest,
|
|
6517
6520
|
forceHint: newer ? "本机没有可用的插件市场(dshmarket),无法在这里自动安装。到「插件」页填 " + PKG_NAME + "@" + latest + " 安装。" : "",
|
|
@@ -6521,6 +6524,14 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6521
6524
|
setUpdate({ phase: "error", text: `检查失败:${String((err && err.message) || err)}`, canUpdate: false, opId: "" });
|
|
6522
6525
|
}
|
|
6523
6526
|
};
|
|
6527
|
+
/* 一进设置页就静默查一次(不弹窗):省得每次都要手动点,也避免「点了没反应」的错觉。
|
|
6528
|
+
必须放在 checkUpdate 之后 —— const 不提升,提前引用会踩 TDZ。 */
|
|
6529
|
+
const autoChecked = react.useRef(false);
|
|
6530
|
+
react.useEffect(() => {
|
|
6531
|
+
if (autoChecked.current === true) return;
|
|
6532
|
+
autoChecked.current = true;
|
|
6533
|
+
checkUpdate(true);
|
|
6534
|
+
}, []);
|
|
6524
6535
|
const runUpdate = async (force) => {
|
|
6525
6536
|
setUpdate((prev) => ({ ...prev, phase: "updating", text: "正在更新…", canUpdate: false, progress: 0 }));
|
|
6526
6537
|
try {
|
|
@@ -6907,6 +6918,7 @@ const TAB_LABEL_CHROME_DOT_PX = 46;
|
|
|
6907
6918
|
h("span", null, "新版本"),
|
|
6908
6919
|
h("b", null, update.latest)
|
|
6909
6920
|
),
|
|
6921
|
+
update.checkedAt !== "" ? h("div", { className: "dsv-modal-row" }, h("span", null, "检查时间"), h("b", null, update.checkedAt)) : null,
|
|
6910
6922
|
update.progress === null || update.progress === void 0
|
|
6911
6923
|
? null
|
|
6912
6924
|
: h(
|
package/package.json
CHANGED