@morehao/dsh-github-trending 0.8.7 → 0.8.9
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/CHANGELOG.md +8 -0
- package/client.js +337 -139
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/client.js
CHANGED
|
@@ -55,7 +55,6 @@ var DICT = {
|
|
|
55
55
|
"st.repo": "仓库",
|
|
56
56
|
"st.auth": "认证",
|
|
57
57
|
"st.scope": "榜单",
|
|
58
|
-
"st.summarize": "摘要与用量",
|
|
59
58
|
"st.releases": "订阅",
|
|
60
59
|
"st.schedule": "调度",
|
|
61
60
|
"card.source.title": "内容来源",
|
|
@@ -284,9 +283,10 @@ var DICT = {
|
|
|
284
283
|
"shell.update.confirmHint": "更新会重装插件,需重启 DSH 生效",
|
|
285
284
|
"shell.update.confirmYes": "确认更新",
|
|
286
285
|
"shell.update.cancel": "取消",
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
"
|
|
286
|
+
"restoreNotice.title": "已更新到 v{version}",
|
|
287
|
+
"restoreNotice.titleBare": "更新已安装",
|
|
288
|
+
"restoreNotice.body": "请彻底退出 DSH(⌘Q)再重新打开,更新才会生效。",
|
|
289
|
+
"restoreNotice.dismiss": "知道了",
|
|
290
290
|
"time.in.minutes": "{minutes} 分钟后",
|
|
291
291
|
"time.in.hours": "{hours} 小时 {minutes} 分后",
|
|
292
292
|
"time.in.days": "{days} 天后",
|
|
@@ -332,6 +332,7 @@ var DICT = {
|
|
|
332
332
|
"runs.filter.monthly": "月榜",
|
|
333
333
|
"runs.filter.failed": "失败",
|
|
334
334
|
"runs.filter.dry": "试跑",
|
|
335
|
+
"runs.filterHintSubs": "周期 / 试跑筛选仅对日报有效,订阅不受此限制",
|
|
335
336
|
"runs.type.all": "全部",
|
|
336
337
|
"runs.type.digest": "日报",
|
|
337
338
|
"runs.type.release": "订阅",
|
|
@@ -438,7 +439,6 @@ var DICT = {
|
|
|
438
439
|
"runs.detail.tokensNone": "—",
|
|
439
440
|
"runs.footer.total": "历史累计 tokens:{total}",
|
|
440
441
|
"card.summarize.title": "摘要与用量",
|
|
441
|
-
"card.summarize.hint": "对应核心 summarize.*(core 0.4.1+)",
|
|
442
442
|
"summarize.batchSize": "批量大小",
|
|
443
443
|
"summarize.batchSize.help": "每次模型调用处理的仓库数;批次越大速度越快,单次提示词也越长。",
|
|
444
444
|
"summarize.maxRetries": "失败重试",
|
|
@@ -585,16 +585,15 @@ var DICT = {
|
|
|
585
585
|
"overview.releases.repos": "仓库",
|
|
586
586
|
"overview.tokens.note": "概览一屏带出「这次任务共花了多少 token / 历史上累计多少 / 订阅仓库有几个新版本」;只给总用量,不拆维度;本次任务总量已含订阅阶段消耗。旧核心无数据时对应小块整体隐藏,不留 0。",
|
|
587
587
|
"about.title": "关于",
|
|
588
|
-
"about.copy": "
|
|
588
|
+
"about.copy": "复制包名",
|
|
589
589
|
"about.copied": "已复制",
|
|
590
590
|
"about.close": "关闭",
|
|
591
|
+
"about.pkg": "包名",
|
|
591
592
|
"about.repo": "GitHub 仓库",
|
|
592
593
|
"about.repo.missing": "package.json 没有可解析的仓库地址",
|
|
593
594
|
"about.license": "许可",
|
|
594
595
|
"about.core": "核心",
|
|
595
|
-
"about.core.repo": "打开核心 GitHub 仓库"
|
|
596
|
-
"about.env": "运行环境",
|
|
597
|
-
"about.env.value": "DSH Web · Node 插件"
|
|
596
|
+
"about.core.repo": "打开核心 GitHub 仓库"
|
|
598
597
|
},
|
|
599
598
|
en: {
|
|
600
599
|
"section.title": "GitHub Trending",
|
|
@@ -606,7 +605,6 @@ var DICT = {
|
|
|
606
605
|
"st.repo": "Repository",
|
|
607
606
|
"st.auth": "Auth",
|
|
608
607
|
"st.scope": "Board",
|
|
609
|
-
"st.summarize": "Summary & usage",
|
|
610
608
|
"st.releases": "Subscriptions",
|
|
611
609
|
"st.schedule": "Schedule",
|
|
612
610
|
"card.source.title": "Content source",
|
|
@@ -835,9 +833,10 @@ var DICT = {
|
|
|
835
833
|
"shell.update.confirmHint": "Reinstalls the plugin; restart DSH to apply",
|
|
836
834
|
"shell.update.confirmYes": "Confirm",
|
|
837
835
|
"shell.update.cancel": "Cancel",
|
|
838
|
-
"
|
|
839
|
-
"
|
|
840
|
-
"
|
|
836
|
+
"restoreNotice.title": "Updated to v{version}",
|
|
837
|
+
"restoreNotice.titleBare": "Update installed",
|
|
838
|
+
"restoreNotice.body": "Quit DSH completely (⌘Q) and reopen it so the update takes effect.",
|
|
839
|
+
"restoreNotice.dismiss": "Got it",
|
|
841
840
|
"time.in.minutes": "in {minutes} min",
|
|
842
841
|
"time.in.hours": "in {hours} h {minutes} min",
|
|
843
842
|
"time.in.days": "in {days} d",
|
|
@@ -883,6 +882,7 @@ var DICT = {
|
|
|
883
882
|
"runs.filter.monthly": "Monthly",
|
|
884
883
|
"runs.filter.failed": "Failed",
|
|
885
884
|
"runs.filter.dry": "Dry run",
|
|
885
|
+
"runs.filterHintSubs": "Period / dry-run filters apply to digests only; subscriptions are exempt",
|
|
886
886
|
"runs.type.all": "All",
|
|
887
887
|
"runs.type.digest": "Digest",
|
|
888
888
|
"runs.type.release": "Subs",
|
|
@@ -989,7 +989,6 @@ var DICT = {
|
|
|
989
989
|
"runs.detail.tokensNone": "—",
|
|
990
990
|
"runs.footer.total": "All-time tokens: {total}",
|
|
991
991
|
"card.summarize.title": "Summary & usage",
|
|
992
|
-
"card.summarize.hint": "Maps to core summarize.* (core 0.4.1+)",
|
|
993
992
|
"summarize.batchSize": "Batch size",
|
|
994
993
|
"summarize.batchSize.help": "Repos per model call; larger batches run faster but make each prompt longer.",
|
|
995
994
|
"summarize.maxRetries": "Retries",
|
|
@@ -1136,16 +1135,15 @@ var DICT = {
|
|
|
1136
1135
|
"overview.releases.repos": "Repos",
|
|
1137
1136
|
"overview.tokens.note": 'The overview surfaces "how many tokens this run spent / all-time accumulated / how many new versions across subscribed repos"; total only, not split by dimension; this run total already includes the subscriptions stage. With an old core that has no data, the corresponding tile is hidden entirely, never shown as 0.',
|
|
1138
1137
|
"about.title": "About",
|
|
1139
|
-
"about.copy": "Copy package name
|
|
1138
|
+
"about.copy": "Copy package name",
|
|
1140
1139
|
"about.copied": "Copied",
|
|
1141
1140
|
"about.close": "Close",
|
|
1141
|
+
"about.pkg": "Package",
|
|
1142
1142
|
"about.repo": "GitHub repository",
|
|
1143
1143
|
"about.repo.missing": "package.json has no resolvable repository URL",
|
|
1144
1144
|
"about.license": "License",
|
|
1145
1145
|
"about.core": "Core",
|
|
1146
|
-
"about.core.repo": "Open core GitHub repository"
|
|
1147
|
-
"about.env": "Runtime",
|
|
1148
|
-
"about.env.value": "DSH Web · Node plugin"
|
|
1146
|
+
"about.core.repo": "Open core GitHub repository"
|
|
1149
1147
|
}
|
|
1150
1148
|
};
|
|
1151
1149
|
function activeLang(locale) {
|
|
@@ -1235,6 +1233,7 @@ var CSS = `
|
|
|
1235
1233
|
.dshgt-period{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--gt-fg);}
|
|
1236
1234
|
.dshgt-period-check{color:var(--gt-ok);font-size:12px;line-height:1;}
|
|
1237
1235
|
.dshgt-chip{appearance:none;font:inherit;cursor:pointer;border:1px solid var(--gt-border);background:var(--gt-bg);border-radius:999px;padding:2px 10px;font-size:12px;color:var(--gt-muted);}
|
|
1236
|
+
.dshgt-chip:disabled{cursor:not-allowed;opacity:.4;}
|
|
1238
1237
|
.dshgt-chip[aria-pressed="true"]{background:color-mix(in srgb,var(--gt-accent) 14%,var(--gt-bg));border-color:var(--gt-accent);color:var(--gt-fg);}
|
|
1239
1238
|
.dshgt-switch{appearance:none;cursor:pointer;width:36px;height:20px;border-radius:999px;border:1px solid var(--gt-border);background:var(--gt-muted);position:relative;transition:background .15s;}
|
|
1240
1239
|
.dshgt-switch::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .15s;}
|
|
@@ -1245,6 +1244,14 @@ var CSS = `
|
|
|
1245
1244
|
.dshgt-modal-mask{position:fixed;inset:0;background:var(--dsw-alias-bg-mask-1,rgba(15,23,42,.38));display:flex;align-items:center;justify-content:center;z-index:2147483000;}
|
|
1246
1245
|
.dshgt-modal{background:var(--gt-bg);border-radius:12px;border:1px solid var(--gt-border);max-width:640px;width:calc(100% - 32px);max-height:80vh;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:10px;box-shadow:0 20px 50px rgba(15,23,42,.25);}
|
|
1247
1246
|
|
|
1247
|
+
/* ——— 自更新后的恢复提示(右下角,约 6 秒后自动消失) ——— */
|
|
1248
|
+
.dshgt-restore{position:fixed;right:20px;bottom:20px;z-index:2147483000;max-width:360px;display:flex;flex-direction:column;gap:10px;padding:14px 16px;border-radius:12px;border:1px solid var(--gt-border);background:var(--gt-bg);box-shadow:0 16px 40px rgba(15,23,42,.28);animation:dshgt-restore-in .18s ease-out;}
|
|
1249
|
+
.dshgt-restore-text{display:flex;flex-direction:column;gap:4px;}
|
|
1250
|
+
.dshgt-restore-title{font-size:13px;font-weight:600;color:var(--gt-fg);}
|
|
1251
|
+
.dshgt-restore-body{font-size:12px;line-height:1.5;color:var(--gt-muted);}
|
|
1252
|
+
.dshgt-restore-actions{display:flex;justify-content:flex-end;gap:8px;}
|
|
1253
|
+
@keyframes dshgt-restore-in{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}
|
|
1254
|
+
|
|
1248
1255
|
/* ——— GitHub 设备码登录弹窗 ——— */
|
|
1249
1256
|
.dshgt-authmodal{max-width:420px;gap:14px;}
|
|
1250
1257
|
.dshgt-authmodal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
|
|
@@ -1299,8 +1306,11 @@ var CSS = `
|
|
|
1299
1306
|
.dshgt-head-actions{margin-left:auto;display:flex;align-items:center;gap:8px;padding-top:2px;flex:none;}
|
|
1300
1307
|
.dshgt-main-body{flex:1;min-height:0;display:flex;min-width:0;}
|
|
1301
1308
|
.dshgt-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;}
|
|
1302
|
-
.dshgt-main-body > .dshgt-settings{flex:1;min-height:0;padding:16px 24px 20px;}
|
|
1303
|
-
|
|
1309
|
+
.dshgt-main-body > .dshgt-settings{flex:1;min-height:0;padding:16px 24px 20px;width:100%;max-width:1240px;margin-inline:auto;}
|
|
1310
|
+
/* 视图区随可用宽度自适应:不再硬卡 1180,避免超宽屏右侧留大片空白。
|
|
1311
|
+
结构化内容(卡片 / 网格 / 表格 / 列表)铺满;只有长文阅读块(日报正文、空态说明)
|
|
1312
|
+
单独限制行宽并居中,保证可读性。与 .dshgt-page-head 的左/右内边距保持一致。 */
|
|
1313
|
+
.dshgt-view{padding:22px 30px 38px;width:100%;display:flex;flex-direction:column;gap:18px;}
|
|
1304
1314
|
.dshgt-grow{flex:1;min-width:0;}
|
|
1305
1315
|
.dshgt-dim{font-size:12px;color:var(--gt-muted);}
|
|
1306
1316
|
.dshgt-empty{padding:48px 0;text-align:center;color:var(--gt-muted);font-size:13px;}
|
|
@@ -1400,14 +1410,17 @@ var CSS = `
|
|
|
1400
1410
|
@keyframes dshgt-spin{to{transform:rotate(360deg);}}
|
|
1401
1411
|
|
|
1402
1412
|
/* ——— 日报 ——— */
|
|
1413
|
+
/* 日报是阅读页:整列(工具栏 + 纸面)统一限宽并居中,避免超宽屏下工具栏与正文两段式错位。 */
|
|
1403
1414
|
.dshgt-digest{padding-top:20px;gap:12px;}
|
|
1415
|
+
.dshgt-digest > *{width:100%;max-width:920px;margin-inline:auto;}
|
|
1404
1416
|
.dshgt-digest-subbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
|
|
1405
1417
|
.dshgt-datenav{display:flex;align-items:center;gap:2px;border:1px solid var(--gt-border);border-radius:8px;background:var(--gt-card);padding:2px;}
|
|
1406
1418
|
.dshgt-icon-btn{width:28px;height:28px;display:grid;place-items:center;border:1px solid transparent;background:var(--gt-bg);border-radius:6px;color:var(--gt-fg);font-family:inherit;font-size:18px;line-height:1;cursor:pointer;flex:none;}
|
|
1407
1419
|
.dshgt-icon-btn:hover:not(:disabled){background:color-mix(in srgb,var(--gt-fg) 7%,var(--gt-bg));border-color:var(--gt-border);}
|
|
1408
1420
|
.dshgt-icon-btn:disabled{opacity:.3;cursor:not-allowed;}
|
|
1409
1421
|
.dshgt-dateselect{appearance:none;height:28px;border:0;background:transparent;font-family:inherit;font-size:13px;color:var(--gt-fg);padding:0 8px;min-width:210px;max-width:320px;cursor:pointer;}
|
|
1410
|
-
.dshgt-digest
|
|
1422
|
+
/* 日报预览纸面:阅读类长文,限制行宽。整体列宽由 .dshgt-digest 视图统一居中约束。 */
|
|
1423
|
+
.dshgt-digest-sheet{max-width:920px;width:100%;border:1px solid var(--gt-border);border-radius:12px;background:var(--gt-card);overflow:hidden;}
|
|
1411
1424
|
.dshgt-digest-body{display:flex;flex-direction:column;min-width:0;}
|
|
1412
1425
|
.dshgt-digest-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:9px 12px;border-bottom:1px solid color-mix(in srgb,var(--gt-border) 70%,transparent);background:color-mix(in srgb,var(--gt-fg) 2.5%,var(--gt-card));}
|
|
1413
1426
|
.dshgt-seg{display:inline-flex;border:1px solid var(--gt-border);border-radius:8px;padding:2px;background:var(--gt-bg);gap:2px;}
|
|
@@ -1479,7 +1492,10 @@ var CSS = `
|
|
|
1479
1492
|
|
|
1480
1493
|
/* ——— 运行记录 ——— */
|
|
1481
1494
|
.dshgt-runs-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
|
|
1482
|
-
.dshgt-runs-filter{display:flex;gap:4px;margin-left:auto;}
|
|
1495
|
+
.dshgt-runs-filter{display:flex;align-items:center;gap:4px;margin-left:auto;flex-wrap:wrap;}
|
|
1496
|
+
/* 两个筛选维度:记录类型 与 周期/状态,用竖线隔开,避免同名胶囊混淆。 */
|
|
1497
|
+
.dshgt-chipgroup{display:flex;align-items:center;gap:4px;flex-wrap:wrap;}
|
|
1498
|
+
.dshgt-chipgroup-sep{width:1px;align-self:stretch;min-height:14px;background:var(--gt-border);margin:0 4px;}
|
|
1483
1499
|
.dshgt-run-list{border-top:1px solid var(--gt-border);}
|
|
1484
1500
|
.dshgt-run-item{border-bottom:1px solid color-mix(in srgb,var(--gt-border) 70%,transparent);}
|
|
1485
1501
|
.dshgt-run-row{display:grid;grid-template-columns:18px 120px 56px minmax(0,1fr) 78px 74px 20px;align-items:center;gap:12px;min-height:52px;width:100%;padding:0 6px;border:0;background:none;text-align:left;font-family:inherit;color:var(--gt-fg);cursor:pointer;border-radius:6px;}
|
|
@@ -1512,22 +1528,29 @@ var CSS = `
|
|
|
1512
1528
|
.dshgt-log-head .dshgt-btn{margin-left:auto;}
|
|
1513
1529
|
.dshgt-log-pre{margin:0;max-height:52vh;overflow:auto;padding:12px;border-radius:8px;background:color-mix(in srgb,var(--gt-fg) 5%,var(--gt-card));font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;white-space:pre-wrap;word-break:break-word;}
|
|
1514
1530
|
.dshgt-log-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
|
|
1515
|
-
.dshgt-about{max-width:
|
|
1531
|
+
.dshgt-about{max-width:460px;width:100%;}
|
|
1516
1532
|
.dshgt-about-head{display:flex;align-items:center;gap:10px;}
|
|
1517
|
-
.dshgt-about-title{margin:0;font-size:
|
|
1518
|
-
.dshgt-about-
|
|
1519
|
-
.dshgt-about-
|
|
1520
|
-
.dshgt-about-
|
|
1521
|
-
|
|
1522
|
-
.dshgt-about-
|
|
1523
|
-
.dshgt-about-
|
|
1524
|
-
.dshgt-about
|
|
1533
|
+
.dshgt-about-title{margin:0;font-size:15px;font-weight:600;}
|
|
1534
|
+
.dshgt-about-close{margin-left:auto;flex:none;display:grid;place-items:center;width:28px;height:28px;padding:0;appearance:none;font:inherit;cursor:pointer;border-radius:7px;border:1px solid transparent;background:transparent;color:var(--gt-muted);}
|
|
1535
|
+
.dshgt-about-close:hover{color:var(--gt-fg);background:color-mix(in srgb,var(--gt-fg) 7%,var(--gt-bg));border-color:var(--gt-border);}
|
|
1536
|
+
.dshgt-about-close:focus-visible{outline:2px solid color-mix(in srgb,var(--gt-accent) 45%,transparent);outline-offset:1px;}
|
|
1537
|
+
/* 居中的应用身份区块:logo / 名称 / 版本胶囊 */
|
|
1538
|
+
.dshgt-about-identity{display:flex;flex-direction:column;align-items:center;gap:8px;padding:4px 0 16px;}
|
|
1539
|
+
.dshgt-about-logo svg{width:56px;height:56px;border-radius:14px;display:block;box-shadow:0 4px 14px rgba(0,0,0,.18);}
|
|
1540
|
+
.dshgt-about-name{font-size:16px;font-weight:650;letter-spacing:-.01em;}
|
|
1541
|
+
.dshgt-about-ver{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;color:var(--gt-fg);background:var(--gt-card);border:1px solid var(--gt-border);border-radius:999px;padding:1px 9px;line-height:17px;}
|
|
1542
|
+
/* 信息表:上方一条分割线,左对齐 label/value */
|
|
1543
|
+
.dshgt-about .dshgt-kv{grid-template-columns:88px minmax(0,1fr);border-top:1px solid var(--gt-border);padding-top:2px;}
|
|
1525
1544
|
.dshgt-about .dshgt-kv a{color:var(--gt-accent);text-decoration:none;}
|
|
1526
1545
|
.dshgt-about .dshgt-kv a:hover{text-decoration:underline;}
|
|
1527
1546
|
.dshgt-about .dshgt-kv dd{min-width:0;overflow-wrap:anywhere;}
|
|
1528
|
-
|
|
1529
|
-
.dshgt-about-
|
|
1530
|
-
.dshgt-about-
|
|
1547
|
+
/* 包名行:整行可点复制,无独立按钮;复制后行尾浮现「已复制」 */
|
|
1548
|
+
.dshgt-about-pkgrow{padding:0 !important;}
|
|
1549
|
+
.dshgt-about-pkglink{appearance:none;font:inherit;border:0;background:none;padding:9px 6px;margin:-9px -6px;border-radius:6px;width:calc(100% + 12px);display:flex;align-items:center;gap:8px;text-align:left;cursor:pointer;color:inherit;}
|
|
1550
|
+
.dshgt-about-pkglink:hover{background:color-mix(in srgb,var(--gt-fg) 5%,var(--gt-bg));}
|
|
1551
|
+
.dshgt-about-pkglink-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;user-select:text;}
|
|
1552
|
+
.dshgt-about-copied{opacity:0;transition:opacity .12s ease;font-size:11px;color:var(--gt-ok);flex:none;}
|
|
1553
|
+
.dshgt-about-pkglink.is-copied .dshgt-about-copied{opacity:1;}
|
|
1531
1554
|
.dshgt-gh{width:15px;height:15px;display:block;fill:currentColor;}
|
|
1532
1555
|
|
|
1533
1556
|
/* ——— 订阅:命令栏 + 四列表格 + 选择条 + 发版记录抽屉 ——— */
|
|
@@ -2148,8 +2171,8 @@ function credentialView(model, t) {
|
|
|
2148
2171
|
|
|
2149
2172
|
// client/settings.ts
|
|
2150
2173
|
var LANGUAGES = ["all", "typescript", "python", "go", "rust", "java", "c", "cpp", "javascript", "csharp"];
|
|
2151
|
-
var SECTIONS = ["source", "model", "repo", "auth", "scope", "
|
|
2152
|
-
var EMPTY_DIRTY = { source: false, model: false, repo: false, auth: false, scope: false,
|
|
2174
|
+
var SECTIONS = ["source", "model", "repo", "auth", "scope", "releases"];
|
|
2175
|
+
var EMPTY_DIRTY = { source: false, model: false, repo: false, auth: false, scope: false, releases: false };
|
|
2153
2176
|
function cloneSettings(settings) {
|
|
2154
2177
|
return JSON.parse(JSON.stringify(settings));
|
|
2155
2178
|
}
|
|
@@ -2164,9 +2187,7 @@ function sectionSlice(settings, section) {
|
|
|
2164
2187
|
case "auth":
|
|
2165
2188
|
return { github: settings.github };
|
|
2166
2189
|
case "scope":
|
|
2167
|
-
return { trending: settings.trending, schedule: settings.schedule };
|
|
2168
|
-
case "summarize":
|
|
2169
|
-
return { summarize: settings.summarize };
|
|
2190
|
+
return { trending: settings.trending, schedule: settings.schedule, summarize: settings.summarize };
|
|
2170
2191
|
case "releases":
|
|
2171
2192
|
return { releases: settings.releases };
|
|
2172
2193
|
}
|
|
@@ -2431,7 +2452,6 @@ function SettingsView(props) {
|
|
|
2431
2452
|
{ id: "repo", label: t("st.repo") },
|
|
2432
2453
|
{ id: "auth", label: t("st.auth") },
|
|
2433
2454
|
{ id: "scope", label: t("st.scope") },
|
|
2434
|
-
{ id: "summarize", label: t("st.summarize") },
|
|
2435
2455
|
{ id: "releases", label: t("st.releases") }
|
|
2436
2456
|
];
|
|
2437
2457
|
const sourceCard = h(
|
|
@@ -2703,11 +2723,8 @@ function SettingsView(props) {
|
|
|
2703
2723
|
{ label: t("schedule.periods") },
|
|
2704
2724
|
h("span", { className: "dshgt-hint" }, t("schedule.periods.value"))
|
|
2705
2725
|
),
|
|
2706
|
-
h("p", { className: "dshgt-hint" }, t("schedule.source"))
|
|
2707
|
-
|
|
2708
|
-
const summarizeCard = h(
|
|
2709
|
-
Card,
|
|
2710
|
-
{ title: t("card.summarize.title"), hint: t("card.summarize.hint") },
|
|
2726
|
+
h("p", { className: "dshgt-hint" }, t("schedule.source")),
|
|
2727
|
+
h("h4", { className: "dshgt-subhead" }, t("card.summarize.title")),
|
|
2711
2728
|
h(
|
|
2712
2729
|
Row,
|
|
2713
2730
|
{ label: t("summarize.batchSize"), help: t("summarize.batchSize.help") },
|
|
@@ -2852,7 +2869,7 @@ function SettingsView(props) {
|
|
|
2852
2869
|
})
|
|
2853
2870
|
)
|
|
2854
2871
|
);
|
|
2855
|
-
const currentCard = section === "source" ? sourceCard : section === "model" ? modelCard : section === "repo" ? repoCard : section === "auth" ? authCard : section === "scope" ? scopeCard :
|
|
2872
|
+
const currentCard = section === "source" ? sourceCard : section === "model" ? modelCard : section === "repo" ? repoCard : section === "auth" ? authCard : section === "scope" ? scopeCard : releasesCard;
|
|
2856
2873
|
return h(
|
|
2857
2874
|
"div",
|
|
2858
2875
|
{ className: "dshgt-settings" },
|
|
@@ -3940,38 +3957,51 @@ function RunsView(props) {
|
|
|
3940
3957
|
h(
|
|
3941
3958
|
"div",
|
|
3942
3959
|
{ className: "dshgt-runs-filter" },
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
className: "dshgt-chip",
|
|
3950
|
-
"aria-pressed": kind === item.id ? "true" : "false",
|
|
3951
|
-
onClick: () => {
|
|
3952
|
-
setKind(item.id);
|
|
3953
|
-
if (item.id === "release") setFilter("all");
|
|
3954
|
-
}
|
|
3955
|
-
},
|
|
3956
|
-
t(item.key)
|
|
3957
|
-
)
|
|
3958
|
-
),
|
|
3959
|
-
kind === "release" ? null : h("span", { key: "sep", className: "dshgt-hint" }, "·"),
|
|
3960
|
-
kind === "release" ? null : FILTERS.filter((item) => item.id !== "all").map(
|
|
3961
|
-
(item) => (
|
|
3962
|
-
// 再点一次当前项 = 取消该筛选,这样不必再摆一个和「全部」重名的胶囊。
|
|
3963
|
-
h(
|
|
3960
|
+
// 记录类型:全部 / 日报 / 订阅,始终可选。
|
|
3961
|
+
h(
|
|
3962
|
+
"div",
|
|
3963
|
+
{ key: "kind", className: "dshgt-chipgroup" },
|
|
3964
|
+
KINDS.map(
|
|
3965
|
+
(item) => h(
|
|
3964
3966
|
"button",
|
|
3965
3967
|
{
|
|
3966
3968
|
key: item.id,
|
|
3967
3969
|
type: "button",
|
|
3968
3970
|
className: "dshgt-chip",
|
|
3969
|
-
"aria-pressed":
|
|
3970
|
-
onClick: () =>
|
|
3971
|
+
"aria-pressed": kind === item.id ? "true" : "false",
|
|
3972
|
+
onClick: () => {
|
|
3973
|
+
setKind(item.id);
|
|
3974
|
+
if (item.id === "release") setFilter("all");
|
|
3975
|
+
}
|
|
3971
3976
|
},
|
|
3972
3977
|
t(item.key)
|
|
3973
3978
|
)
|
|
3974
3979
|
)
|
|
3980
|
+
),
|
|
3981
|
+
// 周期 / 状态:只对日报有意义。切到订阅时不清空标签,而是置灰禁用,
|
|
3982
|
+
// 让筛选维度保持可见、只是不适用,避免出现「选项突然变少」的错觉。
|
|
3983
|
+
h("span", { key: "sep", className: "dshgt-chipgroup-sep", "aria-hidden": "true" }),
|
|
3984
|
+
h(
|
|
3985
|
+
"div",
|
|
3986
|
+
{ key: "filter", className: "dshgt-chipgroup" },
|
|
3987
|
+
FILTERS.filter((item) => item.id !== "all").map(
|
|
3988
|
+
(item) => (
|
|
3989
|
+
// 再点一次当前项 = 取消该筛选,这样不必再摆一个和「全部」重名的胶囊。
|
|
3990
|
+
h(
|
|
3991
|
+
"button",
|
|
3992
|
+
{
|
|
3993
|
+
key: item.id,
|
|
3994
|
+
type: "button",
|
|
3995
|
+
className: "dshgt-chip",
|
|
3996
|
+
"aria-pressed": filter === item.id ? "true" : "false",
|
|
3997
|
+
disabled: kind === "release",
|
|
3998
|
+
title: kind === "release" ? t("runs.filterHintSubs") : void 0,
|
|
3999
|
+
onClick: () => setFilter(filter === item.id ? "all" : item.id)
|
|
4000
|
+
},
|
|
4001
|
+
t(item.key)
|
|
4002
|
+
)
|
|
4003
|
+
)
|
|
4004
|
+
)
|
|
3975
4005
|
)
|
|
3976
4006
|
)
|
|
3977
4007
|
),
|
|
@@ -5477,15 +5507,21 @@ function SubscriptionsView(props) {
|
|
|
5477
5507
|
}
|
|
5478
5508
|
|
|
5479
5509
|
// client/about.ts
|
|
5480
|
-
function
|
|
5481
|
-
return h(
|
|
5482
|
-
|
|
5483
|
-
viewBox: "0 0
|
|
5484
|
-
"
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5510
|
+
function logo() {
|
|
5511
|
+
return h(
|
|
5512
|
+
"svg",
|
|
5513
|
+
{ viewBox: "0 0 64 64", "aria-hidden": "true" },
|
|
5514
|
+
h("rect", { x: 4, y: 4, width: 56, height: 56, rx: 14, fill: "#0d1117" }),
|
|
5515
|
+
h("path", {
|
|
5516
|
+
d: "M18 46V22l14 12 14-12v24",
|
|
5517
|
+
fill: "none",
|
|
5518
|
+
stroke: "#58a6ff",
|
|
5519
|
+
strokeWidth: 4,
|
|
5520
|
+
strokeLinecap: "round",
|
|
5521
|
+
strokeLinejoin: "round"
|
|
5522
|
+
}),
|
|
5523
|
+
h("circle", { cx: 32, cy: 45, r: 3, fill: "#3fb950" })
|
|
5524
|
+
);
|
|
5489
5525
|
}
|
|
5490
5526
|
function AboutDialog(props) {
|
|
5491
5527
|
const { t, state } = props;
|
|
@@ -5495,7 +5531,6 @@ function AboutDialog(props) {
|
|
|
5495
5531
|
const repository = plugin.repository;
|
|
5496
5532
|
const ownerRepo = repository === void 0 ? void 0 : repository.replace(/^https?:\/\/github\.com\//, "");
|
|
5497
5533
|
const core = state.core;
|
|
5498
|
-
const coreVersion = core.version === void 0 ? "" : `trendradar ${core.version}`;
|
|
5499
5534
|
const coreRepo = core.repository;
|
|
5500
5535
|
const coreOwnerRepo = coreRepo === void 0 ? void 0 : coreRepo.replace(/^https?:\/\/github\.com\//, "");
|
|
5501
5536
|
import_react.default.useEffect(() => {
|
|
@@ -5512,62 +5547,91 @@ function AboutDialog(props) {
|
|
|
5512
5547
|
setTimeout(() => setCopied(false), 1400);
|
|
5513
5548
|
});
|
|
5514
5549
|
};
|
|
5550
|
+
const pkgRow = h(
|
|
5551
|
+
"dd",
|
|
5552
|
+
{ className: "dshgt-about-pkgrow" },
|
|
5553
|
+
h(
|
|
5554
|
+
"button",
|
|
5555
|
+
{
|
|
5556
|
+
type: "button",
|
|
5557
|
+
className: `dshgt-about-pkglink${copied ? " is-copied" : ""}`,
|
|
5558
|
+
title: copied ? t("about.copied") : t("about.copy"),
|
|
5559
|
+
"aria-label": `${t("about.copy")}: ${fullName}`,
|
|
5560
|
+
onClick: copy
|
|
5561
|
+
},
|
|
5562
|
+
h("span", { className: "dshgt-mono dshgt-about-pkglink-name" }, fullName),
|
|
5563
|
+
h("span", { className: "dshgt-about-copied" }, t("about.copied"))
|
|
5564
|
+
)
|
|
5565
|
+
);
|
|
5515
5566
|
const coreValue = () => {
|
|
5516
5567
|
if (coreRepo !== void 0 && coreOwnerRepo !== void 0) {
|
|
5517
|
-
|
|
5518
|
-
return h(
|
|
5519
|
-
"span",
|
|
5520
|
-
{ className: "dshgt-about-core" },
|
|
5521
|
-
h("a", { href: coreRepo, target: "_blank", rel: "noreferrer" }, label),
|
|
5522
|
-
h(
|
|
5523
|
-
"a",
|
|
5524
|
-
{ className: "dshgt-about-gh", href: coreRepo, target: "_blank", rel: "noreferrer", title: t("about.core.repo"), "aria-label": t("about.core.repo") },
|
|
5525
|
-
githubIcon()
|
|
5526
|
-
)
|
|
5527
|
-
);
|
|
5568
|
+
return h("a", { className: "dshgt-mono", href: coreRepo, target: "_blank", rel: "noreferrer" }, coreOwnerRepo);
|
|
5528
5569
|
}
|
|
5529
|
-
return
|
|
5570
|
+
return core.version === void 0 ? "—" : `trendradar ${core.version}`;
|
|
5530
5571
|
};
|
|
5531
|
-
|
|
5572
|
+
return h(
|
|
5532
5573
|
"div",
|
|
5533
|
-
{ className: "dshgt-
|
|
5534
|
-
if (event.target === event.currentTarget) props.onClose();
|
|
5535
|
-
} },
|
|
5574
|
+
{ className: "dshgt-root" },
|
|
5536
5575
|
h(
|
|
5537
5576
|
"div",
|
|
5538
|
-
{ className: "dshgt-modal
|
|
5577
|
+
{ className: "dshgt-modal-mask", onClick: (event) => {
|
|
5578
|
+
if (event.target === event.currentTarget) props.onClose();
|
|
5579
|
+
} },
|
|
5539
5580
|
h(
|
|
5540
5581
|
"div",
|
|
5541
|
-
{ className: "dshgt-about-
|
|
5542
|
-
h(
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5582
|
+
{ className: "dshgt-modal dshgt-about", role: "dialog", "aria-modal": "true", "aria-label": t("about.title") },
|
|
5583
|
+
h(
|
|
5584
|
+
"div",
|
|
5585
|
+
{ className: "dshgt-about-head" },
|
|
5586
|
+
h("h3", { className: "dshgt-about-title" }, t("about.title")),
|
|
5587
|
+
h(
|
|
5588
|
+
"button",
|
|
5589
|
+
{
|
|
5590
|
+
type: "button",
|
|
5591
|
+
className: "dshgt-about-close",
|
|
5592
|
+
title: t("about.close"),
|
|
5593
|
+
"aria-label": t("about.close"),
|
|
5594
|
+
onClick: () => props.onClose()
|
|
5595
|
+
},
|
|
5596
|
+
h(
|
|
5597
|
+
"svg",
|
|
5598
|
+
{ viewBox: "0 0 16 16", width: 16, height: 16, "aria-hidden": "true", focusable: "false" },
|
|
5599
|
+
h("path", {
|
|
5600
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
5601
|
+
fill: "none",
|
|
5602
|
+
stroke: "currentColor",
|
|
5603
|
+
strokeWidth: 1.6,
|
|
5604
|
+
strokeLinecap: "round"
|
|
5605
|
+
})
|
|
5606
|
+
)
|
|
5607
|
+
)
|
|
5608
|
+
),
|
|
5609
|
+
h(
|
|
5610
|
+
"div",
|
|
5611
|
+
{ className: "dshgt-about-identity" },
|
|
5612
|
+
h("div", { className: "dshgt-about-logo" }, logo()),
|
|
5613
|
+
h("div", { className: "dshgt-about-name" }, t("section.title")),
|
|
5614
|
+
h("span", { className: "dshgt-about-ver dshgt-mono" }, `v${plugin.version}`)
|
|
5615
|
+
),
|
|
5616
|
+
h(
|
|
5617
|
+
"dl",
|
|
5618
|
+
{ className: "dshgt-kv dshgt-about-kv" },
|
|
5619
|
+
h("dt", null, t("about.pkg")),
|
|
5620
|
+
pkgRow,
|
|
5621
|
+
h("dt", null, t("about.repo")),
|
|
5622
|
+
h(
|
|
5623
|
+
"dd",
|
|
5624
|
+
null,
|
|
5561
5625
|
repository === void 0 || ownerRepo === void 0 ? h("span", { className: "dshgt-hint" }, t("about.repo.missing")) : h("a", { href: repository, target: "_blank", rel: "noreferrer" }, ownerRepo)
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5626
|
+
),
|
|
5627
|
+
h("dt", null, t("about.core")),
|
|
5628
|
+
h("dd", null, coreValue()),
|
|
5629
|
+
h("dt", null, t("about.license")),
|
|
5630
|
+
h("dd", null, "MIT")
|
|
5631
|
+
)
|
|
5632
|
+
)
|
|
5568
5633
|
)
|
|
5569
5634
|
);
|
|
5570
|
-
return h("div", { className: "dshgt-root" }, dialog);
|
|
5571
5635
|
}
|
|
5572
5636
|
|
|
5573
5637
|
// node_modules/@morehao/dsh-plugin-kit/dist/update-client.js
|
|
@@ -5678,8 +5742,115 @@ function usePluginUpdate() {
|
|
|
5678
5742
|
return [state, controller];
|
|
5679
5743
|
}
|
|
5680
5744
|
|
|
5745
|
+
// node_modules/@morehao/dsh-plugin-kit/dist/update-restore.js
|
|
5746
|
+
var PENDING_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
5747
|
+
var DEFAULT_KEY_PREFIX = "dsh-plugin-update:";
|
|
5748
|
+
var FUTURE_TOLERANCE_MS = 60 * 1e3;
|
|
5749
|
+
function resolveStorage(explicit) {
|
|
5750
|
+
if (explicit !== void 0) {
|
|
5751
|
+
try {
|
|
5752
|
+
const probeKey = "__dsh_pending_probe__";
|
|
5753
|
+
explicit.setItem(probeKey, "1");
|
|
5754
|
+
explicit.removeItem(probeKey);
|
|
5755
|
+
return explicit;
|
|
5756
|
+
} catch {
|
|
5757
|
+
return null;
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
try {
|
|
5761
|
+
const w = typeof globalThis !== "undefined" ? globalThis : void 0;
|
|
5762
|
+
const s = w?.localStorage;
|
|
5763
|
+
if (!s) return null;
|
|
5764
|
+
const probeKey = "__dsh_pending_probe__";
|
|
5765
|
+
s.setItem(probeKey, "1");
|
|
5766
|
+
s.removeItem(probeKey);
|
|
5767
|
+
return s;
|
|
5768
|
+
} catch {
|
|
5769
|
+
return null;
|
|
5770
|
+
}
|
|
5771
|
+
}
|
|
5772
|
+
function createPendingStore(options = {}) {
|
|
5773
|
+
const keyPrefix = options.keyPrefix === void 0 ? DEFAULT_KEY_PREFIX : options.keyPrefix;
|
|
5774
|
+
const key = `${keyPrefix}update-pending`;
|
|
5775
|
+
const ttlMs = options.ttlMs === void 0 ? PENDING_TTL_MS : options.ttlMs;
|
|
5776
|
+
const now = options.now === void 0 ? Date.now : options.now;
|
|
5777
|
+
const storage = () => resolveStorage(options.storage);
|
|
5778
|
+
function removeKey() {
|
|
5779
|
+
const s = storage();
|
|
5780
|
+
if (!s) return;
|
|
5781
|
+
try {
|
|
5782
|
+
s.removeItem(key);
|
|
5783
|
+
} catch {
|
|
5784
|
+
}
|
|
5785
|
+
}
|
|
5786
|
+
function write(from, to) {
|
|
5787
|
+
const s = storage();
|
|
5788
|
+
if (!s) return;
|
|
5789
|
+
const value = { from: String(from || ""), to: String(to || ""), at: now() };
|
|
5790
|
+
try {
|
|
5791
|
+
s.setItem(key, JSON.stringify(value));
|
|
5792
|
+
} catch {
|
|
5793
|
+
}
|
|
5794
|
+
}
|
|
5795
|
+
function read() {
|
|
5796
|
+
const s = storage();
|
|
5797
|
+
if (!s) return null;
|
|
5798
|
+
let raw;
|
|
5799
|
+
try {
|
|
5800
|
+
raw = s.getItem(key);
|
|
5801
|
+
} catch {
|
|
5802
|
+
return null;
|
|
5803
|
+
}
|
|
5804
|
+
if (raw === null || raw === "") return null;
|
|
5805
|
+
let value;
|
|
5806
|
+
try {
|
|
5807
|
+
value = JSON.parse(raw);
|
|
5808
|
+
} catch {
|
|
5809
|
+
removeKey();
|
|
5810
|
+
return null;
|
|
5811
|
+
}
|
|
5812
|
+
if (!value || typeof value !== "object") return null;
|
|
5813
|
+
const { from, to, at } = value;
|
|
5814
|
+
if (typeof at !== "number" || !Number.isFinite(at)) {
|
|
5815
|
+
removeKey();
|
|
5816
|
+
return null;
|
|
5817
|
+
}
|
|
5818
|
+
const current = now();
|
|
5819
|
+
if (current - at > ttlMs || at > current + FUTURE_TOLERANCE_MS) {
|
|
5820
|
+
removeKey();
|
|
5821
|
+
return null;
|
|
5822
|
+
}
|
|
5823
|
+
return { from: typeof from === "string" ? from : "", to: typeof to === "string" ? to : "", at };
|
|
5824
|
+
}
|
|
5825
|
+
function clear() {
|
|
5826
|
+
removeKey();
|
|
5827
|
+
}
|
|
5828
|
+
return { write, read, clear };
|
|
5829
|
+
}
|
|
5830
|
+
|
|
5831
|
+
// client/update-store.ts
|
|
5832
|
+
var PREFIX = "dsh-github-trending:";
|
|
5833
|
+
function browserStorage() {
|
|
5834
|
+
try {
|
|
5835
|
+
const w = typeof window !== "undefined" ? window : void 0;
|
|
5836
|
+
return w?.localStorage ?? void 0;
|
|
5837
|
+
} catch {
|
|
5838
|
+
return void 0;
|
|
5839
|
+
}
|
|
5840
|
+
}
|
|
5841
|
+
var pendingStore = createPendingStore({ keyPrefix: PREFIX, storage: browserStorage() });
|
|
5842
|
+
function writePendingUpdate(from, to) {
|
|
5843
|
+
pendingStore.write(from, to);
|
|
5844
|
+
}
|
|
5845
|
+
function readPendingUpdate() {
|
|
5846
|
+
return pendingStore.read();
|
|
5847
|
+
}
|
|
5848
|
+
function clearPendingUpdate() {
|
|
5849
|
+
pendingStore.clear();
|
|
5850
|
+
}
|
|
5851
|
+
|
|
5681
5852
|
// client/identity-bar.ts
|
|
5682
|
-
function
|
|
5853
|
+
function logo2() {
|
|
5683
5854
|
return h(
|
|
5684
5855
|
"svg",
|
|
5685
5856
|
{ width: 22, height: 22, viewBox: "0 0 64 64", "aria-hidden": "true" },
|
|
@@ -5688,7 +5859,7 @@ function logo() {
|
|
|
5688
5859
|
h("circle", { cx: 32, cy: 45, r: 3, fill: "#3fb950" })
|
|
5689
5860
|
);
|
|
5690
5861
|
}
|
|
5691
|
-
function
|
|
5862
|
+
function githubIcon() {
|
|
5692
5863
|
return h("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true" }, h("path", {
|
|
5693
5864
|
d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"
|
|
5694
5865
|
}));
|
|
@@ -5696,7 +5867,6 @@ function githubIcon2() {
|
|
|
5696
5867
|
function IdentityBar(props) {
|
|
5697
5868
|
const { t, plugin } = props;
|
|
5698
5869
|
const [confirming, setConfirming] = import_react.default.useState(false);
|
|
5699
|
-
const [cmdCopied, setCmdCopied] = import_react.default.useState(false);
|
|
5700
5870
|
const [updateState, controller] = usePluginUpdate();
|
|
5701
5871
|
const view = updateState.view;
|
|
5702
5872
|
const status = updateState.status;
|
|
@@ -5708,16 +5878,7 @@ function IdentityBar(props) {
|
|
|
5708
5878
|
const latestVersion = view === null ? "" : view.latestVersion ?? "";
|
|
5709
5879
|
const updateAvailable = view !== null && view.updateAvailable;
|
|
5710
5880
|
const actionable = updateAvailable && view !== null && view.canApply && !settled && !busy;
|
|
5711
|
-
const manual = view !== null && (!view.canApply || view.checkFailed) ? view.manualCommand ?? null : null;
|
|
5712
5881
|
const currentVersion = view === null ? plugin.version : view.currentVersion ?? plugin.version;
|
|
5713
|
-
const copyCmd = () => {
|
|
5714
|
-
if (manual === void 0 || manual === null) return;
|
|
5715
|
-
void copyText(manual).then((ok) => {
|
|
5716
|
-
if (!ok) return;
|
|
5717
|
-
setCmdCopied(true);
|
|
5718
|
-
setTimeout(() => setCmdCopied(false), 1400);
|
|
5719
|
-
});
|
|
5720
|
-
};
|
|
5721
5882
|
function statusLine() {
|
|
5722
5883
|
if (status === "checking" || view === null) return { text: t("shell.update.checking"), kind: "muted" };
|
|
5723
5884
|
if (status === "applying") return { text: t("shell.update.applying", { version: latestVersion }), kind: "muted" };
|
|
@@ -5734,6 +5895,7 @@ function IdentityBar(props) {
|
|
|
5734
5895
|
return [
|
|
5735
5896
|
h(Btn, { key: "yes", small: true, variant: "danger", onClick: () => {
|
|
5736
5897
|
setConfirming(false);
|
|
5898
|
+
writePendingUpdate(currentVersion, latestVersion);
|
|
5737
5899
|
void controller.apply();
|
|
5738
5900
|
} }, t("shell.update.confirmYes")),
|
|
5739
5901
|
h(Btn, { key: "no", small: true, onClick: () => setConfirming(false) }, t("shell.update.cancel"))
|
|
@@ -5741,14 +5903,13 @@ function IdentityBar(props) {
|
|
|
5741
5903
|
}
|
|
5742
5904
|
return h(Btn, { small: true, variant: "primary", onClick: () => setConfirming(true) }, t("shell.update.apply", { version: latestVersion }));
|
|
5743
5905
|
}
|
|
5744
|
-
if (manual !== null) return h(Btn, { small: true, onClick: copyCmd }, cmdCopied ? t("shell.update.copied") : t("shell.update.copyCmd"));
|
|
5745
5906
|
return h(Btn, { small: true, disabled: busy, onClick: () => void controller.check({ fresh: true }) }, t("shell.update.check"));
|
|
5746
5907
|
}
|
|
5747
5908
|
const line = statusLine();
|
|
5748
5909
|
return h(
|
|
5749
5910
|
"div",
|
|
5750
5911
|
{ className: "dshgt-idbar" },
|
|
5751
|
-
h("div", { className: "dshgt-brand" },
|
|
5912
|
+
h("div", { className: "dshgt-brand" }, logo2(), h("span", { className: "dshgt-brand-name" }, t("section.title"))),
|
|
5752
5913
|
h("span", { className: "dshgt-id-ver dshgt-mono" }, `v${plugin.version}`),
|
|
5753
5914
|
h("span", { className: "dshgt-id-sep dshgt-id-sep-pkg" }),
|
|
5754
5915
|
h(
|
|
@@ -5758,7 +5919,7 @@ function IdentityBar(props) {
|
|
|
5758
5919
|
),
|
|
5759
5920
|
plugin.repository === void 0 ? null : [
|
|
5760
5921
|
h("span", { key: "gh-sep", className: "dshgt-id-sep dshgt-id-sep-gh" }),
|
|
5761
|
-
h("a", { key: "gh", className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") },
|
|
5922
|
+
h("a", { key: "gh", className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") }, githubIcon())
|
|
5762
5923
|
],
|
|
5763
5924
|
h(
|
|
5764
5925
|
"div",
|
|
@@ -5773,6 +5934,31 @@ function IdentityBar(props) {
|
|
|
5773
5934
|
);
|
|
5774
5935
|
}
|
|
5775
5936
|
|
|
5937
|
+
// client/restore-notice.ts
|
|
5938
|
+
var AUTO_DISMISS_MS = 6e3;
|
|
5939
|
+
function RestoreNotice({ t, version, onDismiss }) {
|
|
5940
|
+
import_react.default.useEffect(() => {
|
|
5941
|
+
const timer = setTimeout(() => onDismiss(), AUTO_DISMISS_MS);
|
|
5942
|
+
return () => clearTimeout(timer);
|
|
5943
|
+
}, [onDismiss]);
|
|
5944
|
+
const title = version !== void 0 && version !== "" ? t("restoreNotice.title", { version }) : t("restoreNotice.titleBare");
|
|
5945
|
+
return h(
|
|
5946
|
+
"div",
|
|
5947
|
+
{ className: "dshgt-restore", role: "status", "aria-live": "polite" },
|
|
5948
|
+
h(
|
|
5949
|
+
"div",
|
|
5950
|
+
{ className: "dshgt-restore-text" },
|
|
5951
|
+
h("div", { className: "dshgt-restore-title" }, title),
|
|
5952
|
+
h("div", { className: "dshgt-restore-body" }, t("restoreNotice.body"))
|
|
5953
|
+
),
|
|
5954
|
+
h(
|
|
5955
|
+
"div",
|
|
5956
|
+
{ className: "dshgt-restore-actions" },
|
|
5957
|
+
h(Btn, { small: true, variant: "primary", onClick: () => onDismiss() }, t("restoreNotice.dismiss"))
|
|
5958
|
+
)
|
|
5959
|
+
);
|
|
5960
|
+
}
|
|
5961
|
+
|
|
5776
5962
|
// client/panel-icon.ts
|
|
5777
5963
|
var TREND_LINE = "3 16.5 9 10.5 13 14.5 21 6.5";
|
|
5778
5964
|
var TREND_ARROW = "15.5 6.5 21 6.5 21 12";
|
|
@@ -5908,6 +6094,10 @@ function apply(ctx) {
|
|
|
5908
6094
|
const [view, setView] = import_react.default.useState("overview");
|
|
5909
6095
|
const [digestTarget2, setDigestTarget] = import_react.default.useState(void 0);
|
|
5910
6096
|
const [aboutOpen, setAboutOpen] = import_react.default.useState(false);
|
|
6097
|
+
const [pendingUpdate, setPendingUpdate] = import_react.default.useState(null);
|
|
6098
|
+
import_react.default.useEffect(() => {
|
|
6099
|
+
setPendingUpdate(readPendingUpdate());
|
|
6100
|
+
}, []);
|
|
5911
6101
|
const openDigest = import_react.default.useCallback((target) => {
|
|
5912
6102
|
if (target !== void 0) setDigestTarget(target);
|
|
5913
6103
|
setView("digest");
|
|
@@ -6045,7 +6235,15 @@ function apply(ctx) {
|
|
|
6045
6235
|
h("div", { className: "dshgt-main-body" }, view === "settings" ? viewNode : h("div", { className: "dshgt-scroll" }, viewNode))
|
|
6046
6236
|
)
|
|
6047
6237
|
),
|
|
6048
|
-
aboutOpen && state !== null ? h(AboutDialog, { t, state, onClose: () => setAboutOpen(false) }) : null
|
|
6238
|
+
aboutOpen && state !== null ? h(AboutDialog, { t, state, onClose: () => setAboutOpen(false) }) : null,
|
|
6239
|
+
pendingUpdate ? h(RestoreNotice, {
|
|
6240
|
+
t,
|
|
6241
|
+
version: pendingUpdate.to,
|
|
6242
|
+
onDismiss: () => {
|
|
6243
|
+
clearPendingUpdate();
|
|
6244
|
+
setPendingUpdate(null);
|
|
6245
|
+
}
|
|
6246
|
+
}) : null
|
|
6049
6247
|
);
|
|
6050
6248
|
}
|
|
6051
6249
|
disposers.push(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morehao/dsh-github-trending",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "GitHub 趋势日报的 DeepSeek Harness 插件:按日 / 周 / 月周期定时 spawn 本地 trendradar 核心,抓取 Trending、生成中文简介与周期总结,并可选把订阅仓库的新 Release 合成中文摘要,一起提交到你的仓库、自动开 PR 合并;内置概览 / 榜单 / 运行记录 / 订阅 / 设置工作台。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@morehao/dsh-plugin-kit": "^0.
|
|
54
|
+
"@morehao/dsh-plugin-kit": "^0.4.0",
|
|
55
55
|
"@morehao/trendradar-contract": "0.5.0"
|
|
56
56
|
},
|
|
57
57
|
"dsh": {
|