dsh-remote-web 0.7.6-beta.9 → 0.7.6

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 (2) hide show
  1. package/lib/client.js +19 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -1266,6 +1266,7 @@ window.__ModuleLoader__.load({
1266
1266
  * 之所以是模块级的:拉取发生在 apply() 里(组件还没挂载),而消费方有两个
1267
1267
  * (设置面板的卡片 / shell.overlay 上的弹窗),模块级 store 才能让两边看到同一份数据。
1268
1268
  */
1269
+ var annRetryCount = 0; // 公告首次拉取瞬态失败的有界重试计数(成功即清零)
1269
1270
  var annState = {
1270
1271
  ok: false, // 拉取成功且结构是我们认识的那一种(老服务端 404 / 结构不符 → 一直是 false)
1271
1272
  bubble: false, // bubble_enabled === true 才置真(字段缺失一律当 false = fail closed)
@@ -1428,6 +1429,7 @@ window.__ModuleLoader__.load({
1428
1429
  var norm = annNormalize(b);
1429
1430
  if (!norm) { annState.ok = false; annState.bubble = false; annState.items = []; annState.unread = 0; annEmit(); return false; }
1430
1431
  annState.ok = true;
1432
+ annRetryCount = 0;
1431
1433
  annState.bubble = norm.bubble;
1432
1434
  annState.items = norm.items;
1433
1435
  annState.unread = norm.unread;
@@ -1436,13 +1438,24 @@ window.__ModuleLoader__.load({
1436
1438
  }
1437
1439
  annEmit();
1438
1440
  return true;
1439
- }).catch(function () {
1441
+ }).catch(function (err) {
1440
1442
  // 404(老服务端)/ 不可达 / 超时:fail closed —— 不显示入口、不弹窗,**绝不抛**
1441
1443
  annState.ok = false;
1442
1444
  annState.bubble = false;
1443
1445
  annState.items = [];
1444
1446
  annState.unread = 0;
1445
1447
  annEmit();
1448
+ // 2026-10-25(用户反馈「公告板块没了」):dsh 重启后页面常常比插件宿主路由先就绪,
1449
+ // 首次拉取失败一次,整页(sessionStorage 一次性标记)就再也没有公告入口。
1450
+ // 这里只对**瞬态失败**做有界重试(最多 2 次、间隔 1.5s/3s);404 明确是老服务端,不重试。
1451
+ // 注意:这只发生在**失败后**,成功路径仍然严格"每次页面加载只拉一次"。
1452
+ var st = Number(err && (err.status || err.statusCode));
1453
+ if (st !== 404 && annRetryCount < 2) {
1454
+ annRetryCount += 1;
1455
+ try {
1456
+ setTimeout(function () { annFetch({ openPopup: false }); }, 1500 * annRetryCount);
1457
+ } catch (e2) { /* 忽略 */ }
1458
+ }
1446
1459
  return false;
1447
1460
  });
1448
1461
  }
@@ -5332,8 +5345,12 @@ window.__ModuleLoader__.load({
5332
5345
  function renderAnnouncementsCard() {
5333
5346
  if (!annState.ok || !annState.bubble) return null;
5334
5347
  var items = annState.items;
5335
- if (!items.length) return null;
5336
5348
  var unread = annState.unread;
5349
+ // 2026-10-25:列表为空时**保留板块**(显示「暂无公告」)而不是整卡消失 ——
5350
+ // 板块本身是用户确认"公告功能还在"的锚点,静默消失会被当成功能坏了。
5351
+ if (!items.length) {
5352
+ return card("📣 公告", [h("div", { className: "dru-hint" }, "暂无公告")]);
5353
+ }
5337
5354
  return card("📣 公告" + (unread > 0 ? "(" + unread + " 条未读)" : ""), [
5338
5355
  h("div", { className: "dru-ann-list" }, items.map(function (it) {
5339
5356
  return h("button", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-remote-web",
3
- "version": "0.7.6-beta.9",
3
+ "version": "0.7.6",
4
4
  "description": "公网远程控制 DeepSeek Harness(dsh web):安装即得专属加密地址,人在外面也能用手机访问电脑上的 dsh——无需同一局域网/WiFi、无需公网 IP 与内网穿透,全程加密;手机端 100% 还原电脑体验(对话/工具/审批/设置)。技术用户可选自建服务,流量走自己的服务器。Remote control DeepSeek Harness (dsh web) from anywhere over the public internet — install, get an encrypted URL, use it from your phone on any network (dual-half cordis plugin: Settings panel + same-origin /dsh-remote routes). (2026-09 由 dsh-remote-ui 更名 / renamed from dsh-remote-ui; dsh-remote 的 dsh web 插件半,不是纯 UI/皮肤插件)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",