@morehao/dsh-github-trending 0.8.5 → 0.8.7
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 +20 -0
- package/README.en.md +1 -1
- package/README.md +2 -2
- package/client.js +320 -288
- package/lib/{chunk-QOYTABJH.js → chunk-OMQY3T3V.js} +15 -267
- package/lib/index.d.ts +0 -1
- package/lib/index.js +2 -5
- package/lib/internal.d.ts +26 -96
- package/lib/internal.js +1 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -54,7 +54,7 @@ var DICT = {
|
|
|
54
54
|
"st.model": "模型",
|
|
55
55
|
"st.repo": "仓库",
|
|
56
56
|
"st.auth": "认证",
|
|
57
|
-
"st.scope": "
|
|
57
|
+
"st.scope": "榜单",
|
|
58
58
|
"st.summarize": "摘要与用量",
|
|
59
59
|
"st.releases": "订阅",
|
|
60
60
|
"st.schedule": "调度",
|
|
@@ -127,19 +127,22 @@ var DICT = {
|
|
|
127
127
|
"auth.gh.hint": "使用本机 gh 登录态:终端执行 `gh auth login` 完成登录,再点「测试认证」。",
|
|
128
128
|
"auth.browser.hint": "在浏览器里完成 GitHub 授权,token 由 DSH 安全保存,无需手工粘贴。点一下会打开 GitHub 验证页,把下方验证码输入并确认即可。",
|
|
129
129
|
"auth.browser.signin": "用 GitHub 登录",
|
|
130
|
-
"auth.browser.waiting": "等待浏览器授权…",
|
|
131
|
-
"auth.browser.code": "验证码:",
|
|
132
130
|
"auth.browser.copyCode": "复制验证码",
|
|
133
131
|
"auth.browser.codeCopied": "验证码已复制",
|
|
134
132
|
"auth.browser.codeCopyFailed": "复制失败,请手动记下验证码",
|
|
135
133
|
"auth.browser.cancel": "取消",
|
|
136
134
|
"auth.browser.done": "已登录",
|
|
137
|
-
"auth.browser.device": "用设备码登录",
|
|
138
135
|
"auth.browser.unavailable": "宿主的 authorization 服务不可用(或 GitHub 授权流程没注册成功):请重试一次;仍不行就改用「本机 gh」或 PAT。",
|
|
139
|
-
"auth.
|
|
140
|
-
"auth.
|
|
141
|
-
"auth.
|
|
142
|
-
"auth.
|
|
136
|
+
"auth.modal.title": "用 GitHub 登录",
|
|
137
|
+
"auth.modal.lead": "在浏览器中打开 GitHub,输入下面的验证码完成授权。",
|
|
138
|
+
"auth.modal.openPage": "打开 GitHub 验证页",
|
|
139
|
+
"auth.modal.waiting": "等待授权中…",
|
|
140
|
+
"auth.modal.exchanging": "授权成功,正在换取令牌…",
|
|
141
|
+
"auth.modal.requesting": "正在向 GitHub 申请验证码…",
|
|
142
|
+
"auth.modal.retry": "重试",
|
|
143
|
+
"auth.modal.close": "关闭",
|
|
144
|
+
"auth.modal.closeHint": "关窗不取消,可随时回来查看。",
|
|
145
|
+
"auth.modal.viewCode": "查看验证码",
|
|
143
146
|
"auth.browser.failed": "登录失败",
|
|
144
147
|
"auth.browser.failed.detail": "登录失败:{message}",
|
|
145
148
|
"auth.browser.failed.hint": "请重试一次;仍失败可改用「本机 gh」或 PAT。",
|
|
@@ -582,7 +585,7 @@ var DICT = {
|
|
|
582
585
|
"overview.releases.repos": "仓库",
|
|
583
586
|
"overview.tokens.note": "概览一屏带出「这次任务共花了多少 token / 历史上累计多少 / 订阅仓库有几个新版本」;只给总用量,不拆维度;本次任务总量已含订阅阶段消耗。旧核心无数据时对应小块整体隐藏,不留 0。",
|
|
584
587
|
"about.title": "关于",
|
|
585
|
-
"about.copy": "
|
|
588
|
+
"about.copy": "复制包名与版本",
|
|
586
589
|
"about.copied": "已复制",
|
|
587
590
|
"about.close": "关闭",
|
|
588
591
|
"about.repo": "GitHub 仓库",
|
|
@@ -602,7 +605,7 @@ var DICT = {
|
|
|
602
605
|
"st.model": "Model",
|
|
603
606
|
"st.repo": "Repository",
|
|
604
607
|
"st.auth": "Auth",
|
|
605
|
-
"st.scope": "
|
|
608
|
+
"st.scope": "Board",
|
|
606
609
|
"st.summarize": "Summary & usage",
|
|
607
610
|
"st.releases": "Subscriptions",
|
|
608
611
|
"st.schedule": "Schedule",
|
|
@@ -675,19 +678,22 @@ var DICT = {
|
|
|
675
678
|
"auth.gh.hint": "Uses your local gh login: run `gh auth login` in a terminal, then click Test authentication.",
|
|
676
679
|
"auth.browser.hint": "Authorize GitHub in your browser; DSH stores the token securely, no manual paste. Clicking opens the GitHub verification page — enter the code below and confirm.",
|
|
677
680
|
"auth.browser.signin": "Sign in with GitHub",
|
|
678
|
-
"auth.browser.waiting": "Waiting for browser authorization…",
|
|
679
|
-
"auth.browser.code": "Verification code:",
|
|
680
681
|
"auth.browser.copyCode": "Copy code",
|
|
681
682
|
"auth.browser.codeCopied": "Code copied",
|
|
682
683
|
"auth.browser.codeCopyFailed": "Copy failed — please note the code manually",
|
|
683
684
|
"auth.browser.cancel": "Cancel",
|
|
684
685
|
"auth.browser.done": "Signed in",
|
|
685
|
-
"auth.browser.device": "Use a device code",
|
|
686
686
|
"auth.browser.unavailable": "The host authorization service is unavailable (or the GitHub flow did not register): retry once, then fall back to Local gh or a PAT.",
|
|
687
|
-
"auth.
|
|
688
|
-
"auth.
|
|
689
|
-
"auth.
|
|
690
|
-
"auth.
|
|
687
|
+
"auth.modal.title": "Sign in with GitHub",
|
|
688
|
+
"auth.modal.lead": "Open GitHub in your browser and enter the code below to authorize.",
|
|
689
|
+
"auth.modal.openPage": "Open GitHub verification page",
|
|
690
|
+
"auth.modal.waiting": "Waiting for authorization…",
|
|
691
|
+
"auth.modal.exchanging": "Authorized — exchanging for token…",
|
|
692
|
+
"auth.modal.requesting": "Requesting a device code from GitHub…",
|
|
693
|
+
"auth.modal.retry": "Retry",
|
|
694
|
+
"auth.modal.close": "Close",
|
|
695
|
+
"auth.modal.closeHint": "Closing keeps the attempt running; reopen anytime.",
|
|
696
|
+
"auth.modal.viewCode": "View code",
|
|
691
697
|
"auth.browser.failed": "Sign-in failed",
|
|
692
698
|
"auth.browser.failed.detail": "Sign-in failed: {message}",
|
|
693
699
|
"auth.browser.failed.hint": "Retry once; if it keeps failing, use Local gh or a PAT instead.",
|
|
@@ -1130,7 +1136,7 @@ var DICT = {
|
|
|
1130
1136
|
"overview.releases.repos": "Repos",
|
|
1131
1137
|
"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.',
|
|
1132
1138
|
"about.title": "About",
|
|
1133
|
-
"about.copy": "Copy
|
|
1139
|
+
"about.copy": "Copy package name and version",
|
|
1134
1140
|
"about.copied": "Copied",
|
|
1135
1141
|
"about.close": "Close",
|
|
1136
1142
|
"about.repo": "GitHub repository",
|
|
@@ -1184,6 +1190,7 @@ var CSS = `
|
|
|
1184
1190
|
.dshgt-card-h{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
|
|
1185
1191
|
.dshgt-card-h h3{margin:0;font-size:13px;font-weight:600;white-space:nowrap;}
|
|
1186
1192
|
.dshgt-hint{color:var(--gt-muted);font-size:12px;}
|
|
1193
|
+
.dshgt-card .dshgt-hint.dshgt-mono{overflow-wrap:anywhere;}
|
|
1187
1194
|
.dshgt-desc{margin:0;color:var(--gt-muted);font-size:12px;}
|
|
1188
1195
|
.dshgt-subhead{margin:4px 0 0;padding-top:8px;border-top:1px solid var(--gt-border);font-size:12px;font-weight:600;color:var(--gt-muted);}
|
|
1189
1196
|
.dshgt-row{display:flex;gap:10px;align-items:center;min-height:28px;flex-wrap:wrap;}
|
|
@@ -1238,6 +1245,21 @@ var CSS = `
|
|
|
1238
1245
|
.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;}
|
|
1239
1246
|
.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);}
|
|
1240
1247
|
|
|
1248
|
+
/* ——— GitHub 设备码登录弹窗 ——— */
|
|
1249
|
+
.dshgt-authmodal{max-width:420px;gap:14px;}
|
|
1250
|
+
.dshgt-authmodal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
|
|
1251
|
+
.dshgt-authmodal-x{border:0;background:transparent;color:var(--gt-muted);font-size:14px;line-height:1;cursor:pointer;padding:4px 6px;border-radius:6px;}
|
|
1252
|
+
.dshgt-authmodal-x:hover{background:color-mix(in srgb,var(--gt-fg) 8%,transparent);color:var(--gt-fg);}
|
|
1253
|
+
.dshgt-authmodal-body{display:flex;flex-direction:column;gap:12px;}
|
|
1254
|
+
.dshgt-authcode{display:flex;align-items:center;justify-content:center;padding:16px 12px;border:1px dashed color-mix(in srgb,var(--gt-accent) 45%,var(--gt-border));border-radius:12px;background:color-mix(in srgb,var(--gt-accent) 6%,var(--gt-bg));}
|
|
1255
|
+
.dshgt-authcode-value{font-family:var(--gt-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:30px;font-weight:700;letter-spacing:6px;line-height:1.1;color:var(--gt-fg);user-select:all;}
|
|
1256
|
+
.dshgt-authcode-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;}
|
|
1257
|
+
.dshgt-authwait{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--gt-muted);}
|
|
1258
|
+
.dshgt-authwait-dot{width:8px;height:8px;border-radius:50%;background:var(--gt-accent);animation:dshgt-pulse 1.1s ease-in-out infinite;}
|
|
1259
|
+
@keyframes dshgt-pulse{0%,100%{opacity:.25;transform:scale(.8);}50%{opacity:1;transform:scale(1);}}
|
|
1260
|
+
.dshgt-authmodal-footer{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;border-top:1px solid var(--gt-border);padding-top:10px;}
|
|
1261
|
+
.dshgt-authmodal-footer .dshgt-hint{margin-right:auto;}
|
|
1262
|
+
|
|
1241
1263
|
/* ——— 01 工作台外壳 ——— */
|
|
1242
1264
|
.dshgt-shell{gap:0;height:100%;min-height:0;overflow:hidden;}
|
|
1243
1265
|
.dshgt-app{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--gt-bg);}
|
|
@@ -1286,29 +1308,29 @@ var CSS = `
|
|
|
1286
1308
|
.dshgt-inline-tag{margin-left:6px;vertical-align:1px;}
|
|
1287
1309
|
|
|
1288
1310
|
/* ——— 顶部身份条(第一行):名称 / 版本 / 完整包名 / GitHub / 检查更新 ——— */
|
|
1289
|
-
.dshgt-idbar{display:flex;align-items:center;gap:
|
|
1290
|
-
.dshgt-idbar .dshgt-brand{display:flex;align-items:center;gap:9px;padding:0;flex:none;}
|
|
1311
|
+
.dshgt-idbar{display:flex;align-items:center;gap:9px;height:48px;padding:0 18px;border-bottom:1px solid var(--gt-border);flex:none;background:var(--gt-bg);min-width:0;}
|
|
1312
|
+
.dshgt-idbar .dshgt-brand{display:flex;align-items:center;gap:9px;padding:0;flex:none;min-width:0;}
|
|
1291
1313
|
.dshgt-idbar .dshgt-brand svg{width:22px;height:22px;flex:none;border-radius:6px;}
|
|
1292
1314
|
.dshgt-brand-name{font-size:13.5px;font-weight:650;letter-spacing:-.01em;white-space:nowrap;line-height:1.3;}
|
|
1293
|
-
.dshgt-id-ver{
|
|
1294
|
-
.dshgt-id-ver:hover{border-color:color-mix(in srgb,var(--gt-accent) 45%,var(--gt-border));}
|
|
1315
|
+
.dshgt-id-ver{display:inline-flex;align-items:center;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--gt-fg);background:var(--gt-card);border:1px solid var(--gt-border);border-radius:999px;padding:1px 7px;line-height:16px;flex:none;white-space:nowrap;}
|
|
1295
1316
|
.dshgt-id-sep{width:1px;height:16px;background:var(--gt-border);flex:none;}
|
|
1296
|
-
.dshgt-id-pkg{appearance:none;border:0;background:none;padding:2px 4px;border-radius:5px;color:var(--gt-muted);cursor:pointer;font-size:12px;max-width:44vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:
|
|
1317
|
+
.dshgt-id-pkg{appearance:none;border:0;background:none;padding:2px 4px;border-radius:5px;color:var(--gt-muted);cursor:pointer;font-size:12px;max-width:min(44vw,360px);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto;}
|
|
1297
1318
|
.dshgt-id-pkg:hover{color:var(--gt-fg);background:color-mix(in srgb,var(--gt-fg) 5%,var(--gt-bg));}
|
|
1298
|
-
.dshgt-idbar-right{margin-left:auto;display:flex;align-items:center;gap:10px;flex:none;}
|
|
1299
|
-
.dshgt-id-gh{display:inline-flex;align-items:center;justify-content:center;width:
|
|
1319
|
+
.dshgt-idbar-right{margin-left:auto;display:flex;align-items:center;gap:10px;flex:none;min-width:0;}
|
|
1320
|
+
.dshgt-id-gh{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;color:var(--gt-muted);border:1px solid transparent;flex:none;}
|
|
1300
1321
|
.dshgt-id-gh:hover{color:var(--gt-fg);background:color-mix(in srgb,var(--gt-fg) 6%,var(--gt-bg));border-color:var(--gt-border);}
|
|
1301
|
-
.dshgt-id-upd{display:flex;align-items:center;gap:10px;}
|
|
1302
|
-
.dshgt-id-status{font-size:12px;color:var(--gt-muted);white-space:nowrap;display:inline-flex;align-items:center;gap:6px;}
|
|
1322
|
+
.dshgt-id-upd{display:flex;align-items:center;gap:10px;min-width:0;}
|
|
1323
|
+
.dshgt-id-status{font-size:12px;color:var(--gt-muted);white-space:nowrap;display:inline-flex;align-items:center;gap:6px;min-width:0;overflow:hidden;text-overflow:ellipsis;}
|
|
1303
1324
|
.dshgt-id-status.ok{color:var(--gt-ok);}
|
|
1304
1325
|
.dshgt-id-status.new{color:var(--gt-warn);}
|
|
1305
1326
|
.dshgt-id-status.err{color:var(--gt-err);}
|
|
1306
|
-
.dshgt-id-actions{display:flex;align-items:center;gap:8px;}
|
|
1327
|
+
.dshgt-id-actions{display:flex;align-items:center;gap:8px;flex:none;}
|
|
1307
1328
|
|
|
1308
1329
|
/* ——— 横向 tab(第二行)+ 右侧状态 ——— */
|
|
1309
|
-
.dshgt-tabsbar{display:flex;align-items:stretch;gap:
|
|
1310
|
-
.dshgt-tabnav{display:flex;align-items:stretch;gap:2px;height:100%;}
|
|
1311
|
-
.dshgt-
|
|
1330
|
+
.dshgt-tabsbar{display:flex;align-items:stretch;gap:12px;height:46px;padding:0 18px;border-bottom:1px solid var(--gt-border);flex:none;background:var(--gt-bg);min-width:0;}
|
|
1331
|
+
.dshgt-tabnav{display:flex;align-items:stretch;gap:2px;height:100%;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;}
|
|
1332
|
+
.dshgt-tabnav::-webkit-scrollbar{display:none;}
|
|
1333
|
+
.dshgt-tab{display:flex;align-items:center;gap:7px;padding:0 12px;border:0;background:none;color:var(--gt-muted);cursor:pointer;font:inherit;font-size:13.5px;position:relative;border-bottom:2px solid transparent;margin-bottom:-1px;flex:none;white-space:nowrap;}
|
|
1312
1334
|
.dshgt-tab svg{opacity:.8;}
|
|
1313
1335
|
.dshgt-tab:hover{color:var(--gt-fg);}
|
|
1314
1336
|
.dshgt-tab.on{color:var(--gt-fg);font-weight:600;border-bottom-color:var(--gt-accent);}
|
|
@@ -1320,7 +1342,10 @@ var CSS = `
|
|
|
1320
1342
|
.dshgt-status-val{color:var(--gt-fg);font-weight:600;}
|
|
1321
1343
|
.dshgt-status-sub{color:var(--gt-muted);}
|
|
1322
1344
|
@media (max-width:1100px){ .dshgt-id-pkg{max-width:26vw;} }
|
|
1323
|
-
@media (max-width:
|
|
1345
|
+
@media (max-width:900px){
|
|
1346
|
+
.dshgt-id-pkg{max-width:22vw;}
|
|
1347
|
+
.dshgt-status-item.dshgt-next{display:none;}
|
|
1348
|
+
}
|
|
1324
1349
|
|
|
1325
1350
|
/* ——— 概览 ——— */
|
|
1326
1351
|
.dshgt-delivery{border:1px solid var(--gt-border);border-radius:12px;padding:18px 20px 16px;background:var(--gt-card);display:flex;flex-direction:column;gap:6px;}
|
|
@@ -1463,7 +1488,7 @@ var CSS = `
|
|
|
1463
1488
|
.dshgt-run-what{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;}
|
|
1464
1489
|
.dshgt-run-muted{color:var(--gt-muted);font-size:12px;margin-left:6px;}
|
|
1465
1490
|
.dshgt-run-files,.dshgt-run-duration{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;color:var(--gt-muted);text-align:right;}
|
|
1466
|
-
.dshgt-run-tokens{font-size:11.5px;color:var(--gt-muted);text-align:right;white-space:nowrap;}
|
|
1491
|
+
.dshgt-run-tokens{font-size:11.5px;color:var(--gt-muted);text-align:right;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;}
|
|
1467
1492
|
.dshgt-run-item.has-tokens .dshgt-run-row{grid-template-columns:18px 120px 56px minmax(0,1fr) 64px 78px 74px 20px;}
|
|
1468
1493
|
.dshgt-run-chev{color:var(--gt-muted);text-align:center;transition:transform .15s;}
|
|
1469
1494
|
.dshgt-run-item.open .dshgt-run-chev{transform:rotate(90deg);}
|
|
@@ -1487,29 +1512,23 @@ var CSS = `
|
|
|
1487
1512
|
.dshgt-log-head .dshgt-btn{margin-left:auto;}
|
|
1488
1513
|
.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;}
|
|
1489
1514
|
.dshgt-log-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
|
|
1490
|
-
.dshgt-about{max-width:520px;}
|
|
1515
|
+
.dshgt-about{max-width:520px;width:100%;}
|
|
1491
1516
|
.dshgt-about-head{display:flex;align-items:center;gap:10px;}
|
|
1492
1517
|
.dshgt-about-title{margin:0;font-size:16px;}
|
|
1493
1518
|
.dshgt-about-head .dshgt-btn{margin-left:auto;}
|
|
1494
|
-
.dshgt-about-pkg{display:flex;align-items:center;width:100%;text-align:left;border:1px solid var(--gt-border);background:var(--gt-card);border-radius:8px;padding:9px 10px;cursor:pointer;font-family:inherit;color:inherit;transition:border-color .12s ease,background .12s ease;}
|
|
1519
|
+
.dshgt-about-pkg{display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:1px solid var(--gt-border);background:var(--gt-card);border-radius:8px;padding:9px 10px;cursor:pointer;font-family:inherit;color:inherit;transition:border-color .12s ease,background .12s ease;}
|
|
1495
1520
|
.dshgt-about-pkg:hover{border-color:color-mix(in srgb,var(--gt-accent) 40%,var(--gt-border));background:color-mix(in srgb,var(--gt-fg) 4%,var(--gt-card));}
|
|
1496
1521
|
.dshgt-about-pkg.is-copied{border-color:color-mix(in srgb,var(--gt-ok) 45%,var(--gt-border));}
|
|
1497
|
-
.dshgt-about-pkg
|
|
1498
|
-
.dshgt-about
|
|
1522
|
+
.dshgt-about-pkg-name{flex:1;min-width:0;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;user-select:text;}
|
|
1523
|
+
.dshgt-about-pkg-done{flex:none;font-size:11px;color:var(--gt-ok);}
|
|
1524
|
+
.dshgt-about .dshgt-kv{grid-template-columns:110px minmax(0,1fr);}
|
|
1499
1525
|
.dshgt-about .dshgt-kv a{color:var(--gt-accent);text-decoration:none;}
|
|
1500
1526
|
.dshgt-about .dshgt-kv a:hover{text-decoration:underline;}
|
|
1527
|
+
.dshgt-about .dshgt-kv dd{min-width:0;overflow-wrap:anywhere;}
|
|
1501
1528
|
.dshgt-about-core{display:inline-flex;align-items:center;gap:7px;}
|
|
1502
1529
|
.dshgt-about-gh{display:inline-flex;align-items:center;justify-content:center;color:var(--gt-muted);}
|
|
1503
1530
|
.dshgt-about-gh:hover{color:var(--gt-fg);}
|
|
1504
1531
|
.dshgt-gh{width:15px;height:15px;display:block;fill:currentColor;}
|
|
1505
|
-
/* 关于弹层的更新行:与身份条同构(左侧状态 + 右侧单按钮),无标题、无说明。 */
|
|
1506
|
-
.dshgt-about-upd{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:6px;padding-top:12px;border-top:1px solid color-mix(in srgb,var(--gt-border) 70%,transparent);}
|
|
1507
|
-
.dshgt-about-status{display:inline-flex;align-items:center;gap:7px;font-size:12px;color:var(--gt-muted);}
|
|
1508
|
-
.dshgt-about-status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;flex:none;opacity:.9;}
|
|
1509
|
-
.dshgt-about-status.ok{color:var(--gt-ok);}
|
|
1510
|
-
.dshgt-about-status.new{color:var(--gt-warn);}
|
|
1511
|
-
.dshgt-about-status.err{color:var(--gt-err);}
|
|
1512
|
-
.dshgt-about-actions{display:flex;align-items:center;gap:8px;flex:none;}
|
|
1513
1532
|
|
|
1514
1533
|
/* ——— 订阅:命令栏 + 四列表格 + 选择条 + 发版记录抽屉 ——— */
|
|
1515
1534
|
.dshgt-subs{gap:12px;padding-bottom:10px;}
|
|
@@ -1642,7 +1661,6 @@ var CSS = `
|
|
|
1642
1661
|
}
|
|
1643
1662
|
|
|
1644
1663
|
@media (max-width:1100px){
|
|
1645
|
-
.dshgt-app{grid-template-columns:190px minmax(0,1fr);}
|
|
1646
1664
|
.dshgt-page-head{padding:18px 22px 12px;}
|
|
1647
1665
|
.dshgt-view{padding:18px 22px 30px;}
|
|
1648
1666
|
.dshgt-facts{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:10px;}
|
|
@@ -1656,11 +1674,57 @@ var CSS = `
|
|
|
1656
1674
|
.dshgt-dateselect{min-width:180px;}
|
|
1657
1675
|
}
|
|
1658
1676
|
@media (max-width:980px){
|
|
1659
|
-
.dshgt-app{grid-template-columns:172px minmax(0,1fr);}
|
|
1660
1677
|
.dshgt-page-head h1{font-size:19px;}
|
|
1661
1678
|
.dshgt-dek{font-size:12.5px;}
|
|
1662
1679
|
.dshgt-main-body > .dshgt-settings{padding:14px 18px 18px;}
|
|
1663
1680
|
}
|
|
1681
|
+
@media (max-width:900px){
|
|
1682
|
+
.dshgt-main-body > .dshgt-settings{padding:14px 16px 18px;}
|
|
1683
|
+
}
|
|
1684
|
+
@media (max-width:760px){
|
|
1685
|
+
.dshgt-idbar{padding:0 14px;gap:8px;}
|
|
1686
|
+
.dshgt-id-pkg{max-width:26vw;}
|
|
1687
|
+
.dshgt-id-status{display:none;}
|
|
1688
|
+
.dshgt-tabsbar{padding:0 14px;gap:8px;}
|
|
1689
|
+
.dshgt-tabsbar-status{display:none;}
|
|
1690
|
+
.dshgt-page-head{flex-wrap:wrap;padding:16px 18px 12px;gap:10px 16px;}
|
|
1691
|
+
.dshgt-head-actions{margin-left:0;width:100%;justify-content:flex-start;padding-top:0;flex-wrap:wrap;}
|
|
1692
|
+
.dshgt-view{padding:16px 18px 28px;}
|
|
1693
|
+
.dshgt-runs-filter{margin-left:0;width:100%;flex-wrap:wrap;}
|
|
1694
|
+
.dshgt-run-row{grid-template-columns:14px 92px 46px minmax(0,1fr) 20px;gap:8px;padding:0 2px;}
|
|
1695
|
+
.dshgt-run-item.has-tokens .dshgt-run-row{grid-template-columns:14px 92px 46px minmax(0,1fr) 64px 20px;}
|
|
1696
|
+
.dshgt-run-duration{display:none;}
|
|
1697
|
+
.dshgt-settings{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:10px;}
|
|
1698
|
+
.dshgt-vtabs{flex-direction:row;flex-wrap:wrap;overflow:visible;border-right:0;border-bottom:1px solid var(--gt-border);padding:0 0 8px;}
|
|
1699
|
+
.dshgt-vtabs::-webkit-scrollbar{display:none;}
|
|
1700
|
+
.dshgt-vtab{flex:none;white-space:nowrap;}
|
|
1701
|
+
.dshgt-vpanel{padding-right:0;}
|
|
1702
|
+
.dshgt-facts{grid-template-columns:minmax(0,1fr);row-gap:8px;}
|
|
1703
|
+
.dshgt-fact{padding:0;}
|
|
1704
|
+
.dshgt-fact + .dshgt-fact{border-left:0;padding-top:8px;border-top:1px solid color-mix(in srgb,var(--gt-border) 70%,transparent);}
|
|
1705
|
+
.dshgt-detail-grid{grid-template-columns:minmax(0,1fr);}
|
|
1706
|
+
}
|
|
1707
|
+
@media (max-width:560px){
|
|
1708
|
+
.dshgt-modal{width:calc(100% - 20px);padding:14px;max-height:88vh;}
|
|
1709
|
+
.dshgt-about{max-width:none;}
|
|
1710
|
+
.dshgt-about .dshgt-kv{grid-template-columns:88px minmax(0,1fr);}
|
|
1711
|
+
.dshgt-authmodal-footer .dshgt-hint{flex-basis:100%;}
|
|
1712
|
+
}
|
|
1713
|
+
@media (max-width:480px){
|
|
1714
|
+
.dshgt-brand-name{display:none;}
|
|
1715
|
+
.dshgt-id-pkg{max-width:30vw;}
|
|
1716
|
+
.dshgt-tab{padding:0 9px;gap:5px;font-size:13px;}
|
|
1717
|
+
.dshgt-tab-tail{display:none;}
|
|
1718
|
+
}
|
|
1719
|
+
@media (max-width:380px){
|
|
1720
|
+
.dshgt-tab svg{display:none;}
|
|
1721
|
+
.dshgt-tab{padding:0 10px;}
|
|
1722
|
+
}
|
|
1723
|
+
@media (max-width:420px){
|
|
1724
|
+
.dshgt-about .dshgt-kv{grid-template-columns:minmax(0,1fr);gap:2px 0;}
|
|
1725
|
+
.dshgt-about .dshgt-kv dt{margin-top:6px;}
|
|
1726
|
+
.dshgt-authcode-value{font-size:24px;letter-spacing:4px;}
|
|
1727
|
+
}
|
|
1664
1728
|
`;
|
|
1665
1729
|
function injectStyles() {
|
|
1666
1730
|
if (typeof document === "undefined") return () => void 0;
|
|
@@ -1891,8 +1955,8 @@ async function apiCall(method, path, body, options = {}) {
|
|
|
1891
1955
|
}
|
|
1892
1956
|
return json;
|
|
1893
1957
|
}
|
|
1894
|
-
async function beginGithubSignIn(
|
|
1895
|
-
const payload = await apiCall("POST", "/github/browser/begin", {
|
|
1958
|
+
async function beginGithubSignIn() {
|
|
1959
|
+
const payload = await apiCall("POST", "/github/browser/begin", {});
|
|
1896
1960
|
return payload.attempt;
|
|
1897
1961
|
}
|
|
1898
1962
|
async function getGithubSignInStatus(signal) {
|
|
@@ -2136,6 +2200,7 @@ function SettingsView(props) {
|
|
|
2136
2200
|
const [testing, setTesting] = import_react.default.useState(false);
|
|
2137
2201
|
const [githubTest, setGithubTest] = import_react.default.useState(null);
|
|
2138
2202
|
const [signIn, setSignIn] = import_react.default.useState({ phase: "idle" });
|
|
2203
|
+
const [signInModal, setSignInModal] = import_react.default.useState(false);
|
|
2139
2204
|
const anyDirty = SECTIONS.some((id) => dirtySections[id]);
|
|
2140
2205
|
const sectionEditable = section !== "source";
|
|
2141
2206
|
import_react.default.useEffect(() => {
|
|
@@ -2263,50 +2328,43 @@ function SettingsView(props) {
|
|
|
2263
2328
|
setTesting(false);
|
|
2264
2329
|
}
|
|
2265
2330
|
};
|
|
2266
|
-
const
|
|
2331
|
+
const openVerifyPage = (url) => {
|
|
2332
|
+
if (url === void 0) return;
|
|
2267
2333
|
try {
|
|
2268
|
-
|
|
2334
|
+
window.open(url, "_blank", "noopener,noreferrer");
|
|
2335
|
+
} catch {
|
|
2336
|
+
}
|
|
2337
|
+
};
|
|
2338
|
+
const startSignIn = async () => {
|
|
2339
|
+
setSignInModal(true);
|
|
2340
|
+
setSignIn({ phase: "idle" });
|
|
2341
|
+
try {
|
|
2342
|
+
let view = await beginGithubSignIn();
|
|
2269
2343
|
if (view.phase === "idle") view = await getGithubSignInStatus();
|
|
2270
2344
|
setSignIn(view);
|
|
2271
|
-
if (view.phase === "
|
|
2272
|
-
notify("err", t("auth.browser.failed.detail", { message: view.error ?? "" }));
|
|
2273
|
-
return;
|
|
2274
|
-
}
|
|
2275
|
-
if (view.phase === "waiting-browser" && view.authorizeUrl !== void 0) {
|
|
2276
|
-
try {
|
|
2277
|
-
window.open(view.authorizeUrl, "_blank", "noopener,noreferrer");
|
|
2278
|
-
} catch {
|
|
2279
|
-
}
|
|
2280
|
-
}
|
|
2281
|
-
const deviceUrl = view.verificationUriComplete ?? view.verificationUri;
|
|
2282
|
-
if (view.phase === "waiting-device" && deviceUrl !== void 0) {
|
|
2283
|
-
try {
|
|
2284
|
-
window.open(deviceUrl, "_blank", "noopener,noreferrer");
|
|
2285
|
-
} catch {
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2345
|
+
if (view.phase === "waiting-device") openVerifyPage(view.verificationUri);
|
|
2288
2346
|
} catch (error) {
|
|
2289
|
-
|
|
2347
|
+
setSignIn({ phase: "error", error: error instanceof Error ? error.message : String(error) });
|
|
2290
2348
|
}
|
|
2291
2349
|
};
|
|
2350
|
+
const openSignInModal = () => setSignInModal(true);
|
|
2351
|
+
const closeSignInModal = () => setSignInModal(false);
|
|
2292
2352
|
const cancelSignIn = async () => {
|
|
2293
2353
|
try {
|
|
2294
2354
|
setSignIn(await cancelGithubSignIn());
|
|
2295
2355
|
} catch (error) {
|
|
2296
2356
|
notify("err", error instanceof Error ? error.message : String(error));
|
|
2357
|
+
} finally {
|
|
2358
|
+
setSignInModal(false);
|
|
2297
2359
|
}
|
|
2298
2360
|
};
|
|
2299
|
-
const copyAuthorizeLink = () => {
|
|
2300
|
-
if (signIn.authorizeUrl === void 0) return;
|
|
2301
|
-
void navigator.clipboard?.writeText(signIn.authorizeUrl).then(() => notify("ok", t("auth.browser.copied")));
|
|
2302
|
-
};
|
|
2303
2361
|
const copyDeviceCode = () => {
|
|
2304
2362
|
if (signIn.userCode === void 0) return;
|
|
2305
2363
|
void copyText(signIn.userCode).then(
|
|
2306
2364
|
(ok) => notify(ok ? "ok" : "err", ok ? t("auth.browser.codeCopied") : t("auth.browser.codeCopyFailed"))
|
|
2307
2365
|
);
|
|
2308
2366
|
};
|
|
2309
|
-
const signInActive = signIn.phase === "waiting-
|
|
2367
|
+
const signInActive = signIn.phase === "waiting-device" || signIn.phase === "exchanging";
|
|
2310
2368
|
import_react.default.useEffect(() => {
|
|
2311
2369
|
if (!signInActive) return void 0;
|
|
2312
2370
|
let alive = true;
|
|
@@ -2367,7 +2425,6 @@ function SettingsView(props) {
|
|
|
2367
2425
|
const isGh = draft.github.authMode === "gh";
|
|
2368
2426
|
const isBrowser = draft.github.authMode === "browser";
|
|
2369
2427
|
const browserAvailable = state.github.browserAvailable === true;
|
|
2370
|
-
const loopbackAvailable = state.github.loopbackAvailable === true;
|
|
2371
2428
|
const sections = [
|
|
2372
2429
|
{ id: "source", label: t("st.source") },
|
|
2373
2430
|
{ id: "model", label: t("st.model") },
|
|
@@ -2562,13 +2619,10 @@ function SettingsView(props) {
|
|
|
2562
2619
|
{
|
|
2563
2620
|
small: true,
|
|
2564
2621
|
variant: "primary",
|
|
2565
|
-
onClick: () => void
|
|
2566
|
-
disabled: signInActive
|
|
2622
|
+
onClick: () => void (signInActive ? openSignInModal() : startSignIn())
|
|
2567
2623
|
},
|
|
2568
|
-
signIn.phase === "done" && signIn.login !== void 0 ? `${t("auth.browser.done")} · @${signIn.login}` :
|
|
2569
|
-
) : h("span", { className: "dshgt-hint" }, t("auth.browser.unavailable"))
|
|
2570
|
-
browserAvailable && loopbackAvailable ? h(Btn, { small: true, variant: "ghost", onClick: () => void startSignIn("device"), disabled: signInActive }, t("auth.browser.device")) : null,
|
|
2571
|
-
signInActive ? h(Btn, { small: true, variant: "ghost", onClick: () => void cancelSignIn() }, t("auth.browser.cancel")) : null
|
|
2624
|
+
signInActive ? t("auth.modal.viewCode") : signIn.phase === "done" && signIn.login !== void 0 ? `${t("auth.browser.done")} · @${signIn.login}` : t("auth.browser.signin")
|
|
2625
|
+
) : h("span", { className: "dshgt-hint" }, t("auth.browser.unavailable"))
|
|
2572
2626
|
) : h(
|
|
2573
2627
|
Row,
|
|
2574
2628
|
{ label: t("auth.tokenRef") },
|
|
@@ -2577,47 +2631,6 @@ function SettingsView(props) {
|
|
|
2577
2631
|
}) }),
|
|
2578
2632
|
h("span", { className: "dshgt-hint" }, t("auth.tokenRef.hint"))
|
|
2579
2633
|
),
|
|
2580
|
-
// 浏览器登录失败:必须显式说出来,否则「点了没反应」又回来了。
|
|
2581
|
-
isBrowser && signIn.phase === "error" ? h(Alert, { kind: "err", title: t("auth.browser.failed") }, signIn.error ?? t("auth.browser.failed.hint")) : null,
|
|
2582
|
-
// 浏览器登录进行中的状态行:可点的授权页链接 + 复制兜底 + 设备码。
|
|
2583
|
-
isBrowser && (signIn.phase === "waiting-browser" || signIn.phase === "waiting-device" || signIn.phase === "exchanging") ? h(
|
|
2584
|
-
"div",
|
|
2585
|
-
{ className: "dshgt-hint" },
|
|
2586
|
-
signIn.authorizeUrl !== void 0 ? h(
|
|
2587
|
-
"div",
|
|
2588
|
-
{ className: "dshgt-desc" },
|
|
2589
|
-
h("span", null, t("auth.browser.openHint")),
|
|
2590
|
-
" ",
|
|
2591
|
-
h(
|
|
2592
|
-
"a",
|
|
2593
|
-
{ className: "dshgt-link", href: signIn.authorizeUrl, target: "_blank", rel: "noreferrer" },
|
|
2594
|
-
t("auth.browser.open")
|
|
2595
|
-
),
|
|
2596
|
-
" ",
|
|
2597
|
-
h(Btn, { small: true, variant: "ghost", onClick: () => copyAuthorizeLink() }, t("auth.browser.copy"))
|
|
2598
|
-
) : null,
|
|
2599
|
-
signIn.verificationUriComplete !== void 0 || signIn.verificationUri !== void 0 ? h(
|
|
2600
|
-
"div",
|
|
2601
|
-
{ className: "dshgt-desc" },
|
|
2602
|
-
h(
|
|
2603
|
-
"a",
|
|
2604
|
-
{
|
|
2605
|
-
className: "dshgt-link",
|
|
2606
|
-
href: signIn.verificationUriComplete ?? signIn.verificationUri,
|
|
2607
|
-
target: "_blank",
|
|
2608
|
-
rel: "noreferrer"
|
|
2609
|
-
},
|
|
2610
|
-
t("auth.browser.open")
|
|
2611
|
-
)
|
|
2612
|
-
) : null,
|
|
2613
|
-
signIn.userCode !== void 0 ? h(
|
|
2614
|
-
"div",
|
|
2615
|
-
{ className: "dshgt-desc", style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" } },
|
|
2616
|
-
h("span", null, t("auth.browser.code")),
|
|
2617
|
-
h("span", { className: "dshgt-mono", style: { fontSize: "1.1em", fontWeight: "bold", letterSpacing: "1px" } }, signIn.userCode),
|
|
2618
|
-
h(Btn, { small: true, variant: "ghost", onClick: () => copyDeviceCode() }, t("auth.browser.copyCode"))
|
|
2619
|
-
) : null
|
|
2620
|
-
) : null,
|
|
2621
2634
|
h(
|
|
2622
2635
|
Row,
|
|
2623
2636
|
{ label: t("auth.test") },
|
|
@@ -2891,7 +2904,88 @@ function SettingsView(props) {
|
|
|
2891
2904
|
setDirtySections({ ...EMPTY_DIRTY });
|
|
2892
2905
|
setSavedSection(null);
|
|
2893
2906
|
void store.refresh({ quiet: true });
|
|
2894
|
-
} }) : null
|
|
2907
|
+
} }) : null,
|
|
2908
|
+
signInModal ? h(AuthSignInModal, {
|
|
2909
|
+
t,
|
|
2910
|
+
view: signIn,
|
|
2911
|
+
onClose: closeSignInModal,
|
|
2912
|
+
onCancel: () => void cancelSignIn(),
|
|
2913
|
+
onRetry: () => void startSignIn(),
|
|
2914
|
+
onCopyCode: copyDeviceCode,
|
|
2915
|
+
onOpenPage: () => openVerifyPage(signIn.verificationUri)
|
|
2916
|
+
}) : null
|
|
2917
|
+
);
|
|
2918
|
+
}
|
|
2919
|
+
function AuthSignInModal(props) {
|
|
2920
|
+
const { t, view } = props;
|
|
2921
|
+
const active = view.phase === "waiting-device" || view.phase === "exchanging";
|
|
2922
|
+
const body = view.phase === "waiting-device" || view.phase === "exchanging" ? h(
|
|
2923
|
+
"div",
|
|
2924
|
+
{ className: "dshgt-authmodal-body" },
|
|
2925
|
+
h("p", { className: "dshgt-hint", style: { margin: 0 } }, t("auth.modal.lead")),
|
|
2926
|
+
view.userCode !== void 0 ? h(
|
|
2927
|
+
"div",
|
|
2928
|
+
{ className: "dshgt-authcode" },
|
|
2929
|
+
h("span", { className: "dshgt-authcode-value" }, view.userCode)
|
|
2930
|
+
) : null,
|
|
2931
|
+
view.userCode !== void 0 ? h(
|
|
2932
|
+
"div",
|
|
2933
|
+
{ className: "dshgt-authcode-actions" },
|
|
2934
|
+
h(Btn, { small: true, variant: "ghost", onClick: props.onCopyCode }, t("auth.browser.copyCode")),
|
|
2935
|
+
view.verificationUri !== void 0 ? h(Btn, { small: true, variant: "primary", onClick: props.onOpenPage }, `${t("auth.modal.openPage")} ↗`) : null
|
|
2936
|
+
) : null,
|
|
2937
|
+
h(
|
|
2938
|
+
"div",
|
|
2939
|
+
{ className: "dshgt-authwait" },
|
|
2940
|
+
h("span", { className: "dshgt-authwait-dot" }),
|
|
2941
|
+
h("span", null, view.phase === "exchanging" ? t("auth.modal.exchanging") : t("auth.modal.waiting"))
|
|
2942
|
+
)
|
|
2943
|
+
) : view.phase === "done" ? h(
|
|
2944
|
+
"div",
|
|
2945
|
+
{ className: "dshgt-authmodal-body" },
|
|
2946
|
+
h(Alert, { kind: "ok" }, view.login === void 0 ? t("auth.browser.done") : `${t("auth.browser.done")} · @${view.login}`)
|
|
2947
|
+
) : view.phase === "error" ? h(
|
|
2948
|
+
"div",
|
|
2949
|
+
{ className: "dshgt-authmodal-body" },
|
|
2950
|
+
h(Alert, { kind: "err", title: t("auth.browser.failed") }, view.error ?? t("auth.browser.failed.hint"))
|
|
2951
|
+
) : h(
|
|
2952
|
+
"div",
|
|
2953
|
+
{ className: "dshgt-authmodal-body dshgt-authwait" },
|
|
2954
|
+
h("span", { className: "dshgt-authwait-dot" }),
|
|
2955
|
+
h("span", null, t("auth.modal.requesting"))
|
|
2956
|
+
);
|
|
2957
|
+
const footer = view.phase === "error" ? h(
|
|
2958
|
+
"div",
|
|
2959
|
+
{ className: "dshgt-authmodal-footer" },
|
|
2960
|
+
h(Btn, { small: true, variant: "primary", onClick: props.onRetry }, t("auth.modal.retry")),
|
|
2961
|
+
h(Btn, { small: true, variant: "ghost", onClick: props.onClose }, t("auth.modal.close"))
|
|
2962
|
+
) : view.phase === "done" ? h(
|
|
2963
|
+
"div",
|
|
2964
|
+
{ className: "dshgt-authmodal-footer" },
|
|
2965
|
+
h(Btn, { small: true, variant: "primary", onClick: props.onClose }, t("auth.modal.close"))
|
|
2966
|
+
) : h(
|
|
2967
|
+
"div",
|
|
2968
|
+
{ className: "dshgt-authmodal-footer" },
|
|
2969
|
+
h("span", { className: "dshgt-hint" }, t("auth.modal.closeHint")),
|
|
2970
|
+
h(Btn, { small: true, variant: "ghost", onClick: props.onCancel, disabled: !active }, t("auth.browser.cancel"))
|
|
2971
|
+
);
|
|
2972
|
+
return h(
|
|
2973
|
+
"div",
|
|
2974
|
+
{ className: "dshgt-modal-mask", onClick: (event) => {
|
|
2975
|
+
if (event.target === event.currentTarget) props.onClose();
|
|
2976
|
+
} },
|
|
2977
|
+
h(
|
|
2978
|
+
"div",
|
|
2979
|
+
{ className: "dshgt-modal dshgt-authmodal", role: "dialog", "aria-modal": "true", "aria-label": t("auth.modal.title") },
|
|
2980
|
+
h(
|
|
2981
|
+
"div",
|
|
2982
|
+
{ className: "dshgt-authmodal-head" },
|
|
2983
|
+
h("h3", { style: { margin: 0, fontSize: 14 } }, t("auth.modal.title")),
|
|
2984
|
+
h("button", { type: "button", className: "dshgt-authmodal-x", "aria-label": t("auth.modal.close"), onClick: props.onClose }, "✕")
|
|
2985
|
+
),
|
|
2986
|
+
body,
|
|
2987
|
+
footer
|
|
2988
|
+
)
|
|
2895
2989
|
);
|
|
2896
2990
|
}
|
|
2897
2991
|
function QuickFillModal(props) {
|
|
@@ -5382,6 +5476,100 @@ function SubscriptionsView(props) {
|
|
|
5382
5476
|
);
|
|
5383
5477
|
}
|
|
5384
5478
|
|
|
5479
|
+
// client/about.ts
|
|
5480
|
+
function githubIcon() {
|
|
5481
|
+
return h("svg", {
|
|
5482
|
+
className: "dshgt-gh",
|
|
5483
|
+
viewBox: "0 0 16 16",
|
|
5484
|
+
"aria-hidden": "true",
|
|
5485
|
+
dangerouslySetInnerHTML: {
|
|
5486
|
+
__html: '<path 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"/>'
|
|
5487
|
+
}
|
|
5488
|
+
});
|
|
5489
|
+
}
|
|
5490
|
+
function AboutDialog(props) {
|
|
5491
|
+
const { t, state } = props;
|
|
5492
|
+
const [copied, setCopied] = import_react.default.useState(false);
|
|
5493
|
+
const plugin = state.plugin;
|
|
5494
|
+
const fullName = `${plugin.name}@${plugin.version}`;
|
|
5495
|
+
const repository = plugin.repository;
|
|
5496
|
+
const ownerRepo = repository === void 0 ? void 0 : repository.replace(/^https?:\/\/github\.com\//, "");
|
|
5497
|
+
const core = state.core;
|
|
5498
|
+
const coreVersion = core.version === void 0 ? "" : `trendradar ${core.version}`;
|
|
5499
|
+
const coreRepo = core.repository;
|
|
5500
|
+
const coreOwnerRepo = coreRepo === void 0 ? void 0 : coreRepo.replace(/^https?:\/\/github\.com\//, "");
|
|
5501
|
+
import_react.default.useEffect(() => {
|
|
5502
|
+
const onKey = (event) => {
|
|
5503
|
+
if (event.key === "Escape") props.onClose();
|
|
5504
|
+
};
|
|
5505
|
+
document.addEventListener("keydown", onKey);
|
|
5506
|
+
return () => document.removeEventListener("keydown", onKey);
|
|
5507
|
+
}, [props]);
|
|
5508
|
+
const copy = () => {
|
|
5509
|
+
void copyText(fullName).then((ok) => {
|
|
5510
|
+
if (!ok) return;
|
|
5511
|
+
setCopied(true);
|
|
5512
|
+
setTimeout(() => setCopied(false), 1400);
|
|
5513
|
+
});
|
|
5514
|
+
};
|
|
5515
|
+
const coreValue = () => {
|
|
5516
|
+
if (coreRepo !== void 0 && coreOwnerRepo !== void 0) {
|
|
5517
|
+
const label = core.version === void 0 ? coreOwnerRepo : `${coreOwnerRepo}@${core.version}`;
|
|
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
|
+
);
|
|
5528
|
+
}
|
|
5529
|
+
return coreVersion === "" ? "—" : coreVersion;
|
|
5530
|
+
};
|
|
5531
|
+
const dialog = h(
|
|
5532
|
+
"div",
|
|
5533
|
+
{ className: "dshgt-modal-mask", onClick: (event) => {
|
|
5534
|
+
if (event.target === event.currentTarget) props.onClose();
|
|
5535
|
+
} },
|
|
5536
|
+
h(
|
|
5537
|
+
"div",
|
|
5538
|
+
{ className: "dshgt-modal dshgt-about", role: "dialog", "aria-modal": "true", "aria-label": t("about.title") },
|
|
5539
|
+
h(
|
|
5540
|
+
"div",
|
|
5541
|
+
{ className: "dshgt-about-head" },
|
|
5542
|
+
h("h3", { className: "dshgt-about-title" }, t("about.title")),
|
|
5543
|
+
h(Btn, { small: true, onClick: () => props.onClose() }, t("about.close"))
|
|
5544
|
+
),
|
|
5545
|
+
h(
|
|
5546
|
+
"button",
|
|
5547
|
+
{
|
|
5548
|
+
type: "button",
|
|
5549
|
+
className: `dshgt-about-pkg${copied ? " is-copied" : ""}`,
|
|
5550
|
+
title: copied ? t("about.copied") : t("about.copy"),
|
|
5551
|
+
"aria-label": `${t("about.copy")}: ${fullName}`,
|
|
5552
|
+
onClick: copy
|
|
5553
|
+
},
|
|
5554
|
+
h("span", { className: "dshgt-about-pkg-name dshgt-mono" }, fullName),
|
|
5555
|
+
copied ? h("span", { className: "dshgt-about-pkg-done" }, t("about.copied")) : null
|
|
5556
|
+
),
|
|
5557
|
+
h(KV, {
|
|
5558
|
+
items: [
|
|
5559
|
+
[
|
|
5560
|
+
t("about.repo"),
|
|
5561
|
+
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
|
+
[t("about.license"), "MIT"],
|
|
5564
|
+
[t("about.core"), coreValue()],
|
|
5565
|
+
[t("about.env"), t("about.env.value")]
|
|
5566
|
+
]
|
|
5567
|
+
})
|
|
5568
|
+
)
|
|
5569
|
+
);
|
|
5570
|
+
return h("div", { className: "dshgt-root" }, dialog);
|
|
5571
|
+
}
|
|
5572
|
+
|
|
5385
5573
|
// node_modules/@morehao/dsh-plugin-kit/dist/update-client.js
|
|
5386
5574
|
var IDLE = { status: "idle", view: null, error: null };
|
|
5387
5575
|
function errorOf(error) {
|
|
@@ -5490,154 +5678,6 @@ function usePluginUpdate() {
|
|
|
5490
5678
|
return [state, controller];
|
|
5491
5679
|
}
|
|
5492
5680
|
|
|
5493
|
-
// client/about.ts
|
|
5494
|
-
function githubIcon() {
|
|
5495
|
-
return h("svg", {
|
|
5496
|
-
className: "dshgt-gh",
|
|
5497
|
-
viewBox: "0 0 16 16",
|
|
5498
|
-
"aria-hidden": "true",
|
|
5499
|
-
dangerouslySetInnerHTML: {
|
|
5500
|
-
__html: '<path 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"/>'
|
|
5501
|
-
}
|
|
5502
|
-
});
|
|
5503
|
-
}
|
|
5504
|
-
function updateLine(t, state, fallbackVersion) {
|
|
5505
|
-
const { status, view, error } = state;
|
|
5506
|
-
if (status === "checking" || view === null) return { text: t("shell.update.checking"), kind: "muted" };
|
|
5507
|
-
if (status === "applying") return { text: t("shell.update.applying", { version: view.latestVersion ?? "" }), kind: "muted" };
|
|
5508
|
-
if (status === "restart-required" || status === "applied") return { text: t("shell.update.done", { version: view.latestVersion ?? "" }), kind: "ok" };
|
|
5509
|
-
if (status === "failed") return { text: error?.code === "CHECK_FAILED" ? t("shell.update.checkFailed") : t("shell.update.failed"), kind: "err" };
|
|
5510
|
-
if (view.checkFailed) return { text: t("shell.update.checkFailed"), kind: "err" };
|
|
5511
|
-
if (view.updateAvailable) return { text: t("shell.update.available", { latest: view.latestVersion ?? "" }), kind: "new" };
|
|
5512
|
-
return { text: t("shell.update.latest", { version: view.currentVersion ?? fallbackVersion }), kind: "ok" };
|
|
5513
|
-
}
|
|
5514
|
-
function UpdateRow(props) {
|
|
5515
|
-
const { t, update, controller, fallbackVersion } = props;
|
|
5516
|
-
const [confirming, setConfirming] = import_react.default.useState(false);
|
|
5517
|
-
const [cmdCopied, setCmdCopied] = import_react.default.useState(false);
|
|
5518
|
-
import_react.default.useEffect(() => {
|
|
5519
|
-
if (update.status === "applying" || update.status === "restart-required" || update.status === "applied") setConfirming(false);
|
|
5520
|
-
}, [update.status]);
|
|
5521
|
-
const view = update.view;
|
|
5522
|
-
const status = update.status;
|
|
5523
|
-
const busy = status === "checking" || status === "applying";
|
|
5524
|
-
const settled = status === "restart-required" || status === "applied";
|
|
5525
|
-
const latestVersion = view === null ? "" : view.latestVersion ?? "";
|
|
5526
|
-
const actionable = view !== null && view.updateAvailable && view.canApply && !settled && !busy;
|
|
5527
|
-
const manual = view !== null && (!view.canApply || view.checkFailed) ? view.manualCommand ?? null : null;
|
|
5528
|
-
const line = updateLine(t, update, fallbackVersion);
|
|
5529
|
-
const copyCmd = () => {
|
|
5530
|
-
if (manual === null) return;
|
|
5531
|
-
void copyText(manual).then((ok) => {
|
|
5532
|
-
if (!ok) return;
|
|
5533
|
-
setCmdCopied(true);
|
|
5534
|
-
setTimeout(() => setCmdCopied(false), 1400);
|
|
5535
|
-
});
|
|
5536
|
-
};
|
|
5537
|
-
function action() {
|
|
5538
|
-
if (status === "applying") return h(Btn, { small: true, disabled: true }, t("shell.update.applyingShort"));
|
|
5539
|
-
if (actionable) {
|
|
5540
|
-
if (confirming) {
|
|
5541
|
-
return [
|
|
5542
|
-
h(Btn, { key: "yes", small: true, variant: "danger", onClick: () => {
|
|
5543
|
-
setConfirming(false);
|
|
5544
|
-
void controller.apply();
|
|
5545
|
-
} }, t("shell.update.confirmYes")),
|
|
5546
|
-
h(Btn, { key: "no", small: true, onClick: () => setConfirming(false) }, t("shell.update.cancel"))
|
|
5547
|
-
];
|
|
5548
|
-
}
|
|
5549
|
-
return h(Btn, { small: true, variant: "primary", onClick: () => setConfirming(true) }, t("shell.update.apply", { version: latestVersion }));
|
|
5550
|
-
}
|
|
5551
|
-
if (manual !== null) return h(Btn, { small: true, onClick: copyCmd }, cmdCopied ? t("shell.update.copied") : t("shell.update.copyCmd"));
|
|
5552
|
-
return h(Btn, { small: true, disabled: busy, onClick: () => void controller.check({ fresh: true }) }, t("shell.update.check"));
|
|
5553
|
-
}
|
|
5554
|
-
return h(
|
|
5555
|
-
"div",
|
|
5556
|
-
{ className: "dshgt-about-upd" },
|
|
5557
|
-
h(
|
|
5558
|
-
"span",
|
|
5559
|
-
{ className: `dshgt-about-status ${confirming ? "new" : line.kind}` },
|
|
5560
|
-
confirming ? t("shell.update.confirmHint") : line.text
|
|
5561
|
-
),
|
|
5562
|
-
h("span", { className: "dshgt-about-actions" }, action())
|
|
5563
|
-
);
|
|
5564
|
-
}
|
|
5565
|
-
function AboutDialog(props) {
|
|
5566
|
-
const { t, state } = props;
|
|
5567
|
-
const [copied, setCopied] = import_react.default.useState(false);
|
|
5568
|
-
const [updateState, updateController] = usePluginUpdate();
|
|
5569
|
-
const plugin = state.plugin;
|
|
5570
|
-
const fullName = `${plugin.name}@v${plugin.version}`;
|
|
5571
|
-
const repository = plugin.repository;
|
|
5572
|
-
const ownerRepo = repository === void 0 ? void 0 : repository.replace(/^https?:\/\/github\.com\//, "");
|
|
5573
|
-
const repoVersion = ownerRepo === void 0 ? void 0 : `${ownerRepo}@v${plugin.version}`;
|
|
5574
|
-
const core = state.core;
|
|
5575
|
-
const coreVersion = core.version === void 0 ? "" : `trendradar ${core.version}`;
|
|
5576
|
-
const coreRepo = core.repository;
|
|
5577
|
-
import_react.default.useEffect(() => {
|
|
5578
|
-
const onKey = (event) => {
|
|
5579
|
-
if (event.key === "Escape") props.onClose();
|
|
5580
|
-
};
|
|
5581
|
-
document.addEventListener("keydown", onKey);
|
|
5582
|
-
return () => document.removeEventListener("keydown", onKey);
|
|
5583
|
-
}, [props]);
|
|
5584
|
-
const copy = () => {
|
|
5585
|
-
void copyText(fullName).then((ok) => {
|
|
5586
|
-
if (!ok) return;
|
|
5587
|
-
setCopied(true);
|
|
5588
|
-
setTimeout(() => setCopied(false), 1400);
|
|
5589
|
-
});
|
|
5590
|
-
};
|
|
5591
|
-
const coreValue = () => {
|
|
5592
|
-
if (coreVersion === "") return "—";
|
|
5593
|
-
if (coreRepo === void 0) return coreVersion;
|
|
5594
|
-
return h(
|
|
5595
|
-
"span",
|
|
5596
|
-
{ className: "dshgt-about-core" },
|
|
5597
|
-
h("a", { href: coreRepo, target: "_blank", rel: "noreferrer" }, coreVersion),
|
|
5598
|
-
h(
|
|
5599
|
-
"a",
|
|
5600
|
-
{ className: "dshgt-about-gh", href: coreRepo, target: "_blank", rel: "noreferrer", title: t("about.core.repo"), "aria-label": t("about.core.repo") },
|
|
5601
|
-
githubIcon()
|
|
5602
|
-
)
|
|
5603
|
-
);
|
|
5604
|
-
};
|
|
5605
|
-
const dialog = h(
|
|
5606
|
-
"div",
|
|
5607
|
-
{ className: "dshgt-modal-mask", onClick: (event) => {
|
|
5608
|
-
if (event.target === event.currentTarget) props.onClose();
|
|
5609
|
-
} },
|
|
5610
|
-
h(
|
|
5611
|
-
"div",
|
|
5612
|
-
{ className: "dshgt-modal dshgt-about", role: "dialog", "aria-modal": "true", "aria-label": t("about.title") },
|
|
5613
|
-
h(
|
|
5614
|
-
"div",
|
|
5615
|
-
{ className: "dshgt-about-head" },
|
|
5616
|
-
h("h3", { className: "dshgt-about-title" }, t("about.title")),
|
|
5617
|
-
h(Btn, { small: true, onClick: () => props.onClose() }, t("about.close"))
|
|
5618
|
-
),
|
|
5619
|
-
h(
|
|
5620
|
-
"button",
|
|
5621
|
-
{ type: "button", className: `dshgt-about-pkg${copied ? " is-copied" : ""}`, onClick: copy },
|
|
5622
|
-
h("span", { className: "dshgt-mono" }, fullName)
|
|
5623
|
-
),
|
|
5624
|
-
h(KV, {
|
|
5625
|
-
items: [
|
|
5626
|
-
[
|
|
5627
|
-
t("about.repo"),
|
|
5628
|
-
repository === void 0 || repoVersion === void 0 ? h("span", { className: "dshgt-hint" }, t("about.repo.missing")) : h("a", { href: repository, target: "_blank", rel: "noreferrer" }, repoVersion)
|
|
5629
|
-
],
|
|
5630
|
-
[t("about.license"), "MIT"],
|
|
5631
|
-
[t("about.core"), coreValue()],
|
|
5632
|
-
[t("about.env"), t("about.env.value")]
|
|
5633
|
-
]
|
|
5634
|
-
}),
|
|
5635
|
-
h(UpdateRow, { t, update: updateState, controller: updateController, fallbackVersion: plugin.version })
|
|
5636
|
-
)
|
|
5637
|
-
);
|
|
5638
|
-
return h("div", { className: "dshgt-root" }, dialog);
|
|
5639
|
-
}
|
|
5640
|
-
|
|
5641
5681
|
// client/identity-bar.ts
|
|
5642
5682
|
function logo() {
|
|
5643
5683
|
return h(
|
|
@@ -5655,7 +5695,6 @@ function githubIcon2() {
|
|
|
5655
5695
|
}
|
|
5656
5696
|
function IdentityBar(props) {
|
|
5657
5697
|
const { t, plugin } = props;
|
|
5658
|
-
const [copied, setCopied] = import_react.default.useState(false);
|
|
5659
5698
|
const [confirming, setConfirming] = import_react.default.useState(false);
|
|
5660
5699
|
const [cmdCopied, setCmdCopied] = import_react.default.useState(false);
|
|
5661
5700
|
const [updateState, controller] = usePluginUpdate();
|
|
@@ -5664,13 +5703,6 @@ function IdentityBar(props) {
|
|
|
5664
5703
|
import_react.default.useEffect(() => {
|
|
5665
5704
|
if (status === "applying" || status === "restart-required" || status === "applied") setConfirming(false);
|
|
5666
5705
|
}, [status]);
|
|
5667
|
-
const copyPkg = () => {
|
|
5668
|
-
void copyText(plugin.name).then((ok) => {
|
|
5669
|
-
if (!ok) return;
|
|
5670
|
-
setCopied(true);
|
|
5671
|
-
setTimeout(() => setCopied(false), 1400);
|
|
5672
|
-
});
|
|
5673
|
-
};
|
|
5674
5706
|
const busy = status === "checking" || status === "applying";
|
|
5675
5707
|
const settled = status === "restart-required" || status === "applied";
|
|
5676
5708
|
const latestVersion = view === null ? "" : view.latestVersion ?? "";
|
|
@@ -5717,17 +5749,20 @@ function IdentityBar(props) {
|
|
|
5717
5749
|
"div",
|
|
5718
5750
|
{ className: "dshgt-idbar" },
|
|
5719
5751
|
h("div", { className: "dshgt-brand" }, logo(), h("span", { className: "dshgt-brand-name" }, t("section.title"))),
|
|
5720
|
-
h("
|
|
5721
|
-
h("span", { className: "dshgt-id-sep" }),
|
|
5752
|
+
h("span", { className: "dshgt-id-ver dshgt-mono" }, `v${plugin.version}`),
|
|
5753
|
+
h("span", { className: "dshgt-id-sep dshgt-id-sep-pkg" }),
|
|
5722
5754
|
h(
|
|
5723
5755
|
"button",
|
|
5724
|
-
{ type: "button", className: "dshgt-id-pkg dshgt-mono", title:
|
|
5725
|
-
|
|
5756
|
+
{ type: "button", className: "dshgt-id-pkg dshgt-mono", title: t("about.title"), onClick: () => props.onOpenAbout() },
|
|
5757
|
+
plugin.name
|
|
5726
5758
|
),
|
|
5759
|
+
plugin.repository === void 0 ? null : [
|
|
5760
|
+
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") }, githubIcon2())
|
|
5762
|
+
],
|
|
5727
5763
|
h(
|
|
5728
5764
|
"div",
|
|
5729
5765
|
{ className: "dshgt-idbar-right" },
|
|
5730
|
-
plugin.repository === void 0 ? null : h("a", { className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") }, githubIcon2()),
|
|
5731
5766
|
h(
|
|
5732
5767
|
"span",
|
|
5733
5768
|
{ className: "dshgt-id-upd" },
|
|
@@ -5737,9 +5772,6 @@ function IdentityBar(props) {
|
|
|
5737
5772
|
)
|
|
5738
5773
|
);
|
|
5739
5774
|
}
|
|
5740
|
-
function updatedCopyTitle(t, copied) {
|
|
5741
|
-
return copied ? t("about.copied") : t("about.copy");
|
|
5742
|
-
}
|
|
5743
5775
|
|
|
5744
5776
|
// client/panel-icon.ts
|
|
5745
5777
|
var TREND_LINE = "3 16.5 9 10.5 13 14.5 21 6.5";
|
|
@@ -5771,8 +5803,8 @@ var inject = ["slots", "locale"];
|
|
|
5771
5803
|
var NAV = [
|
|
5772
5804
|
{ id: "overview", label: "nav.overview", icon: "grid" },
|
|
5773
5805
|
{ id: "digest", label: "nav.digest", icon: "doc" },
|
|
5774
|
-
{ id: "runs", label: "nav.runs", icon: "list" },
|
|
5775
5806
|
{ id: "subscriptions", label: "nav.subscriptions", icon: "rss" },
|
|
5807
|
+
{ id: "runs", label: "nav.runs", icon: "list" },
|
|
5776
5808
|
{ id: "settings", label: "nav.settings", icon: "sliders" }
|
|
5777
5809
|
];
|
|
5778
5810
|
function navIcon(name, size = 16) {
|