dsh-rank-scan 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/lib/client.js +210 -137
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ DeepSeek Harness 扫榜插件:定时 + 按需采集多站小说榜单,算变
|
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
dsh plugin --profile desktop add github:kilo-s/dsh-rank-scan
|
|
21
|
-
# 钉版本:github:kilo-s/dsh-rank-scan#v0.
|
|
21
|
+
# 钉版本:github:kilo-s/dsh-rank-scan#v0.4.0
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
仓库不含编译产物,这条命令会在安装时现场构建 `lib/`。首次可能被 pnpm 拦下构建脚本(它会打印要放行的键,加进 `allowBuilds` 后重跑即可),细节见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
|
|
@@ -37,14 +37,14 @@ dsh plugin --profile desktop add "<tgz 的完整路径>"
|
|
|
37
37
|
|
|
38
38
|
```sh
|
|
39
39
|
dsh plugin --profile desktop add dsh-rank-scan
|
|
40
|
-
# 钉版本:dsh-rank-scan@0.
|
|
40
|
+
# 钉版本:dsh-rank-scan@0.4.0
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
npm 上那份是 CI 从源码构建的(包内自带 `lib/`,发布带 `--provenance` 签名)——装的时候不用再编译,也不会被 pnpm 的 `allowBuilds` 拦下。面板的「检查更新」读的就是 npm 上的版本号。
|
|
44
44
|
|
|
45
45
|
**验证**:重开 DSH 后左侧栏会话列表下方应出现「扫榜」入口;或访问 `http://127.0.0.1:19387/api/rank-scan/health`,返回 `{ok:true,...}` 即通。
|
|
46
46
|
|
|
47
|
-
**更新**:重跑安装命令即可(链接直装取最新 `main`,registry 装取最新发布版;本版本为 **0.
|
|
47
|
+
**更新**:重跑安装命令即可(链接直装取最新 `main`,registry 装取最新发布版;本版本为 **0.4.0**);面板「设置」页底部会读 npm 上的版本号提示有没有新版,装了 [dsh-market](https://github.com/dsh-market/dsh-market) 的话还能就地更新。
|
|
48
48
|
|
|
49
49
|
**卸载**:`dsh plugin --profile desktop remove dsh-rank-scan`。数据目录 `~/.dsh/data/rank-scan` 会保留,要彻底清理自行删除;脚本化卸载与 patch 安全口径见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
|
|
50
50
|
|
package/lib/client.js
CHANGED
|
@@ -145,49 +145,120 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
145
145
|
return true
|
|
146
146
|
} catch (e) { return false }
|
|
147
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* 设计令牌:全面板唯一的颜色/间距/字号来源,其余地方不许写色值。
|
|
150
|
+
* 颜色优先读 DSH 宿主的 --dsw-alias-*(亮/暗主题各自解析),再退到旧版 --dsh-* 与静态兜底;
|
|
151
|
+
* 兜底只为了在宿主变量缺失时不至于透明或白底白字,不是第二套主题。
|
|
152
|
+
*/
|
|
153
|
+
const T = {
|
|
154
|
+
surface: 'var(--dsw-alias-bg-layer-1, var(--dsh-surface, #fff))',
|
|
155
|
+
surface2: 'var(--dsw-alias-bg-layer-2, var(--dsh-fill, rgba(128,128,128,.06)))',
|
|
156
|
+
fg: 'var(--dsw-alias-label-primary, var(--dsh-text, currentColor))',
|
|
157
|
+
muted: 'var(--dsw-alias-label-secondary, var(--dsh-text-secondary, rgba(128,128,128,.9)))',
|
|
158
|
+
border: 'var(--dsw-alias-border-l3, var(--dsh-border, rgba(128,128,128,.28)))',
|
|
159
|
+
subtle: 'var(--dsw-alias-interactive-bg-hover, var(--dsh-fill, rgba(128,128,128,.07)))',
|
|
160
|
+
accent: 'var(--dsw-alias-state-business-primary, var(--dsh-accent, #2f6feb))',
|
|
161
|
+
onAccent: 'var(--dsw-alias-label-primary-foreground, #fff)',
|
|
162
|
+
primary: 'var(--dsw-alias-button-primary-fill, #2f6feb)',
|
|
163
|
+
onPrimary: 'var(--dsw-alias-label-primary-foreground, #fff)',
|
|
164
|
+
ok: 'var(--dsw-alias-state-success-primary, #2e9e5b)',
|
|
165
|
+
warn: 'var(--dsw-alias-state-warn-primary, #c98a1a)',
|
|
166
|
+
bad: 'var(--dsw-alias-state-error-primary, #d6453d)',
|
|
167
|
+
// 涨跌口径沿用现有行为:名次前进(好)= 绿,后退(坏)= 红;箭头符号仍在,不靠颜色单打
|
|
168
|
+
up: 'var(--dsw-alias-state-success-primary, #2e9e5b)',
|
|
169
|
+
down: 'var(--dsw-alias-state-error-primary, #d6453d)',
|
|
170
|
+
sp: [0, 4, 8, 12, 16],
|
|
171
|
+
fs: { s: '12px', m: '13px', l: '15px' },
|
|
172
|
+
r: { s: '6px', m: '10px' },
|
|
173
|
+
shadowWin: '0 10px 30px rgba(0,0,0,.20)',
|
|
174
|
+
shadowMenu: '0 8px 20px rgba(0,0,0,.18)',
|
|
175
|
+
shadowBar: '0 -8px 12px -8px rgba(0,0,0,.28)',
|
|
176
|
+
}
|
|
177
|
+
/** 语义色低透明度底:用于提示条/未保存条(color-mix 不可用时退化为透明,不影响可读性) */
|
|
178
|
+
const wash = function (color, pct) { return 'color-mix(in srgb, ' + color + ' ' + pct + '%, transparent)' }
|
|
179
|
+
/**
|
|
180
|
+
* 作用域样式表:内联 style 写不了 :hover / :focus-visible / :disabled,
|
|
181
|
+
* 按钮与提示条改用 rs- 前缀的 class。只注入一次;选择器全部带前缀,不污染宿主。
|
|
182
|
+
*/
|
|
183
|
+
const ensureStyle = function () {
|
|
184
|
+
if (typeof document === 'undefined' || !document.head) return
|
|
185
|
+
// 测试/受限环境可能只有半截 document:缺 DOM API 就静默跳过,不影响功能
|
|
186
|
+
if (typeof document.getElementById !== 'function' || typeof document.createElement !== 'function') return
|
|
187
|
+
if (typeof document.head.appendChild !== 'function') return
|
|
188
|
+
if (document.getElementById('rank-scan-style')) return
|
|
189
|
+
const el = document.createElement('style')
|
|
190
|
+
el.id = 'rank-scan-style'
|
|
191
|
+
el.textContent = [
|
|
192
|
+
'.rs-btn{padding:4px 10px;font-size:' + T.fs.s + ';border-radius:' + T.r.s + ';border:1px solid ' + T.border + ';background:transparent;color:inherit;cursor:pointer;line-height:1.4;font-family:inherit}',
|
|
193
|
+
'.rs-btn:hover:not(:disabled){background:' + T.subtle + '}',
|
|
194
|
+
'.rs-btn:focus-visible{outline:2px solid ' + T.accent + ';outline-offset:1px}',
|
|
195
|
+
'[data-rank-scan-win] button:focus-visible{outline:2px solid ' + T.accent + ';outline-offset:1px}',
|
|
196
|
+
'.rs-btn:disabled{opacity:.45;cursor:not-allowed}',
|
|
197
|
+
'.rs-btn.is-primary{background:' + T.primary + ';border-color:' + T.primary + ';color:' + T.onPrimary + ';font-weight:600}',
|
|
198
|
+
'.rs-btn.is-primary:hover:not(:disabled){background:' + T.primary + ';opacity:.88}',
|
|
199
|
+
'.rs-btn.is-ghost{border-color:transparent}',
|
|
200
|
+
'.rs-btn.is-danger{color:' + T.bad + ';border-color:' + T.bad + '}',
|
|
201
|
+
'.rs-btn.is-on{background:' + T.subtle + ';font-weight:600}',
|
|
202
|
+
'.rs-menu-item{text-align:left;width:100%;border-color:transparent;background:transparent}',
|
|
203
|
+
'.rs-section-toggle{border:none;background:transparent;padding:0;font-weight:600;font-size:' + T.fs.m + ';width:100%;text-align:left;cursor:pointer;color:inherit;font-family:inherit}',
|
|
204
|
+
'.rs-section-toggle:focus-visible{outline:2px solid ' + T.accent + ';outline-offset:2px}',
|
|
205
|
+
'.rs-banner{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0;padding:8px 10px;border-radius:' + T.r.s + ';border:1px solid;border-left-width:3px;color:inherit}',
|
|
206
|
+
'.rs-banner.is-info{border-color:' + T.accent + ';background:' + wash(T.accent, 8) + '}',
|
|
207
|
+
'.rs-banner.is-warn{border-color:' + T.warn + ';background:' + wash(T.warn, 10) + '}',
|
|
208
|
+
'.rs-banner.is-error{border-color:' + T.bad + ';background:' + wash(T.bad, 8) + '}',
|
|
209
|
+
'.rs-banner .rs-banner-body{flex:1 1 100%;min-width:0}',
|
|
210
|
+
'[data-rank-scan-win] tbody tr:hover td{background:' + T.subtle + '}',
|
|
211
|
+
'[data-rank-scan-win] a:focus-visible{outline:2px solid ' + T.accent + ';outline-offset:1px}',
|
|
212
|
+
].join('\n')
|
|
213
|
+
document.head.appendChild(el)
|
|
214
|
+
}
|
|
148
215
|
const C = {
|
|
149
|
-
win: { position: 'fixed', zIndex: 60, background:
|
|
150
|
-
|
|
216
|
+
win: { position: 'fixed', zIndex: 60, background: T.surface, color: T.fg,
|
|
217
|
+
border: '1px solid ' + T.border, borderRadius: T.r.m,
|
|
218
|
+
boxShadow: T.shadowWin, fontSize: T.fs.m, lineHeight: 1.5,
|
|
151
219
|
display: 'flex', flexDirection: 'column', overflow: 'hidden' },
|
|
152
220
|
titlebar: { display: 'flex', alignItems: 'center', gap: '6px', padding: '6px 8px 6px 10px',
|
|
153
|
-
borderBottom: '1px solid
|
|
154
|
-
title: { fontWeight: 600, fontSize:
|
|
155
|
-
body: { padding: '
|
|
221
|
+
borderBottom: '1px solid ' + T.border, cursor: 'move', userSelect: 'none', background: T.subtle },
|
|
222
|
+
title: { fontWeight: 600, fontSize: T.fs.m, marginRight: '2px' },
|
|
223
|
+
body: { padding: '12px', overflow: 'auto', flex: '1 1 auto' },
|
|
156
224
|
row: { display: 'flex', flexWrap: 'wrap', gap: '6px', alignItems: 'center', margin: '5px 0' },
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
table: { width: '100%', borderCollapse: 'collapse', fontSize: '12px' },
|
|
165
|
-
th: { textAlign: 'left', padding: '2px 5px', borderBottom: '1px solid rgba(128,128,128,.3)', whiteSpace: 'nowrap', fontWeight: 600, position: 'sticky', top: 0, zIndex: 3, background: 'var(--dsh-surface, #fff)' },
|
|
166
|
-
td: { padding: '2px 5px', borderBottom: '1px solid rgba(128,128,128,.1)', verticalAlign: 'top' },
|
|
225
|
+
tabs: { display: 'flex', gap: '4px', borderBottom: '1px solid ' + T.border, marginBottom: '6px' },
|
|
226
|
+
tab: (on) => ({ padding: '3px 9px', cursor: 'pointer', border: 'none', background: 'transparent',
|
|
227
|
+
color: on ? T.fg : T.muted,
|
|
228
|
+
borderBottom: '2px solid ' + (on ? T.accent : 'transparent'), fontWeight: on ? 600 : 400 }),
|
|
229
|
+
table: { width: '100%', borderCollapse: 'collapse', fontSize: T.fs.m },
|
|
230
|
+
th: { textAlign: 'left', padding: '6px 8px', borderBottom: '1px solid ' + T.border, whiteSpace: 'nowrap', fontWeight: 600, position: 'sticky', top: 0, zIndex: 3, background: T.surface },
|
|
231
|
+
td: { padding: '6px 8px', borderBottom: '1px solid ' + wash(T.border, 50), verticalAlign: 'top' },
|
|
167
232
|
/**
|
|
168
233
|
* ★ 2026-10-17(易用性 P0):数字列以前会折行(「退 1」被拆成两行、20 个榜的表拉高一倍)。
|
|
169
234
|
* num 给数字列用(不折行 + 等宽数字,扫一眼就能对齐比大小)。
|
|
170
235
|
*/
|
|
171
236
|
num: { whiteSpace: 'nowrap', fontVariantNumeric: 'tabular-nums' },
|
|
172
237
|
/* 涨跌配色:绿涨红跌,与 dot('ok'/'bad') 同一套语义;符号仍然保留,不靠颜色单打 */
|
|
173
|
-
up: { color:
|
|
174
|
-
down: { color:
|
|
238
|
+
up: { color: T.up, whiteSpace: 'nowrap' },
|
|
239
|
+
down: { color: T.down, whiteSpace: 'nowrap' },
|
|
175
240
|
/* 长榜名单行省略(全名放 title 里)——避免「签约榜 × 轻小说(移动端口径)」撑成两行 */
|
|
176
241
|
ellip: { display: 'inline-block', maxWidth: '232px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', verticalAlign: 'bottom' },
|
|
177
|
-
muted: {
|
|
178
|
-
siteBar: { marginTop: '8px', fontWeight: 600, fontSize:
|
|
242
|
+
muted: { color: T.muted, fontSize: T.fs.s },
|
|
243
|
+
siteBar: { marginTop: '8px', fontWeight: 600, fontSize: T.fs.m, display: 'flex', gap: '6px', alignItems: 'center' },
|
|
179
244
|
dot: (tone) => ({ display: 'inline-block', width: '7px', height: '7px', borderRadius: '50%',
|
|
180
|
-
background: tone === 'bad' ?
|
|
245
|
+
background: tone === 'bad' ? T.bad : tone === 'warn' ? T.warn : T.ok }),
|
|
181
246
|
handle: { position: 'absolute', right: '0', bottom: '0', width: '16px', height: '16px', cursor: 'nwse-resize',
|
|
182
|
-
background: 'linear-gradient(135deg, transparent 46%,
|
|
183
|
-
detail: { marginTop: '6px', padding: '6px 8px', border: '1px solid
|
|
247
|
+
background: 'linear-gradient(135deg, transparent 46%, ' + T.muted + ' 46%, ' + T.muted + ' 54%, transparent 54%, transparent 70%, ' + T.muted + ' 70%, ' + T.muted + ' 78%, transparent 78%)' },
|
|
248
|
+
detail: { marginTop: '6px', padding: '6px 8px', border: '1px solid ' + T.border, borderRadius: '8px', background: T.subtle },
|
|
184
249
|
// 书签(用户数据):星标按钮与卡片
|
|
185
|
-
bmOn: { padding: '0 2px', border: 'none', background: 'transparent', cursor: 'pointer', color:
|
|
186
|
-
bmOff: { padding: '0 2px', border: 'none', background: 'transparent', cursor: 'pointer', opacity: 0.32, fontSize:
|
|
187
|
-
card: { margin: '7px 0', padding: '7px 9px', border: '1px solid
|
|
188
|
-
cardTitle: { fontWeight: 600, fontSize:
|
|
189
|
-
chip: { display: 'inline-block', marginRight: '4px', padding: '0 5px', borderRadius: '8px', background:
|
|
190
|
-
input: { padding: '3px 6px', fontSize:
|
|
250
|
+
bmOn: { padding: '0 2px', border: 'none', background: 'transparent', cursor: 'pointer', color: T.warn, fontSize: T.fs.m, lineHeight: 1 },
|
|
251
|
+
bmOff: { padding: '0 2px', border: 'none', background: 'transparent', cursor: 'pointer', opacity: 0.32, fontSize: T.fs.m, lineHeight: 1 },
|
|
252
|
+
card: { margin: '7px 0', padding: '7px 9px', border: '1px solid ' + T.border, borderRadius: '8px', background: T.subtle },
|
|
253
|
+
cardTitle: { fontWeight: 600, fontSize: T.fs.m },
|
|
254
|
+
chip: { display: 'inline-block', marginRight: '4px', padding: '0 5px', borderRadius: '8px', background: T.subtle, fontSize: T.fs.s },
|
|
255
|
+
input: { padding: '3px 6px', fontSize: T.fs.s, borderRadius: T.r.s, border: '1px solid ' + T.border, background: 'transparent', color: 'inherit' },
|
|
256
|
+
}
|
|
257
|
+
/** 统一提示条:三种语气只差颜色,形状一致;错误用 role=alert 让读屏器打断 */
|
|
258
|
+
function Banner(props) {
|
|
259
|
+
const role = props.live === false ? null : (props.tone === 'error' ? 'alert' : 'status')
|
|
260
|
+
return h('div', { className: 'rs-banner is-' + (props.tone || 'info'), role: role },
|
|
261
|
+
props.title ? h('strong', null, props.title) : null, props.children)
|
|
191
262
|
}
|
|
192
263
|
/**
|
|
193
264
|
* ★ 2026-10-17(易用性 P0):哪些列算「数字列」—— 只有它们套 C.num(不折行 + 等宽数字)。
|
|
@@ -478,7 +549,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
478
549
|
return h('span', { ref: wrapRef, style: { position: 'relative', display: 'inline-block' }, onKeyDown: onKey },
|
|
479
550
|
h('button', {
|
|
480
551
|
ref: btnRef,
|
|
481
|
-
|
|
552
|
+
className: 'rs-btn is-ghost' + (open ? ' is-on' : ''),
|
|
482
553
|
title: props.title || '',
|
|
483
554
|
'aria-haspopup': 'menu',
|
|
484
555
|
'aria-expanded': open ? 'true' : 'false',
|
|
@@ -492,18 +563,18 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
492
563
|
visibility: pos ? 'visible' : 'hidden',
|
|
493
564
|
minWidth: (props.width || 230) + 'px', maxWidth: 'min(420px, calc(100vw - 12px))',
|
|
494
565
|
maxHeight: (pos ? pos.maxH : 420) + 'px', overflowY: 'auto', overflowX: 'hidden',
|
|
495
|
-
padding: '5px', borderRadius: '8px', border: '1px solid
|
|
496
|
-
boxShadow:
|
|
566
|
+
padding: '5px', borderRadius: '8px', border: '1px solid ' + T.border, background: T.surface, color: T.fg,
|
|
567
|
+
boxShadow: T.shadowMenu, display: 'flex', flexDirection: 'column', gap: '4px' },
|
|
497
568
|
}, items.map(function (it, i) {
|
|
498
569
|
if (!it) return null
|
|
499
|
-
if (it && it.sep) return h('div', { key: 's' + i, style: { height: '1px', background:
|
|
570
|
+
if (it && it.sep) return h('div', { key: 's' + i, style: { height: '1px', background: T.border, margin: '3px 0' } })
|
|
500
571
|
if (it && it.rows) return h('div', { key: 'r' + i, style: { padding: '2px 2px 4px' } }, it.rows)
|
|
501
572
|
return h('button', {
|
|
502
573
|
key: 'i' + i,
|
|
503
574
|
role: 'menuitem',
|
|
504
575
|
disabled: !!it.disabled,
|
|
505
576
|
title: it.title || '',
|
|
506
|
-
|
|
577
|
+
className: 'rs-btn rs-menu-item', style: { opacity: it.disabled ? 0.45 : 1 },
|
|
507
578
|
onClick: function () { if (it.disabled) return; close(); if (it.onClick) it.onClick() },
|
|
508
579
|
}, it.label)
|
|
509
580
|
})) : null)
|
|
@@ -513,9 +584,9 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
513
584
|
const st = React.useState(props.defaultOpen !== false)
|
|
514
585
|
const open = st[0]
|
|
515
586
|
const setOpen = st[1]
|
|
516
|
-
return h('div', { style: { margin: '8px 0', padding: '6px 8px', border: '1px solid
|
|
587
|
+
return h('div', { style: { margin: '8px 0', padding: '6px 8px', border: '1px solid ' + T.border, borderRadius: '8px', background: T.surface2 } },
|
|
517
588
|
h('button', {
|
|
518
|
-
|
|
589
|
+
className: 'rs-section-toggle',
|
|
519
590
|
'aria-expanded': open ? 'true' : 'false',
|
|
520
591
|
onClick: function () { setOpen(!open) },
|
|
521
592
|
}, (open ? '▾ ' : '▸ ') + (props.title || '')),
|
|
@@ -815,7 +886,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
815
886
|
return h('div', { style: C.titlebar, onMouseDown: start },
|
|
816
887
|
h('span', { style: C.title }, '扫榜面板'),
|
|
817
888
|
h('span', { style: { flex: 1 } }),
|
|
818
|
-
h('button', {
|
|
889
|
+
h('button', { className: 'rs-btn is-ghost', onClick: props.onCollapse, title: '收起面板(Esc 也可以)' }, '收起'))
|
|
819
890
|
}
|
|
820
891
|
|
|
821
892
|
function ResizeHandle(props) {
|
|
@@ -845,10 +916,11 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
845
916
|
componentDidCatch(err) { try { console.error('[rank-scan] 页签渲染失败:' + (this.props.name || ''), err) } catch (e) {} }
|
|
846
917
|
render() {
|
|
847
918
|
if (this.state.err) {
|
|
848
|
-
return h(
|
|
849
|
-
h('div', { style: {
|
|
850
|
-
|
|
851
|
-
|
|
919
|
+
return h(Banner, { tone: 'error' },
|
|
920
|
+
h('div', { style: { display: 'flex', flexWrap: 'wrap', gap: '8px', alignItems: 'center', width: '100%' } },
|
|
921
|
+
h('div', { style: { fontWeight: 600, flex: '1 1 100%' } }, '这个页签渲染出错了(面板其余部分仍可用)'),
|
|
922
|
+
h('div', { style: { ...C.muted, wordBreak: 'break-all', flex: '1 1 320px' } }, String((this.state.err && this.state.err.message) || this.state.err)),
|
|
923
|
+
h('button', { className: 'rs-btn', onClick: function () { this.setState({ err: null }) }.bind(this) }, '重试')))
|
|
852
924
|
}
|
|
853
925
|
return this.props.children
|
|
854
926
|
}
|
|
@@ -1057,21 +1129,21 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1057
1129
|
h('span', { style: C.muted }, '·'),
|
|
1058
1130
|
h('span', null, '已采集 ' + (c.ok || 0) + '/' + total),
|
|
1059
1131
|
waitingRows.length ? h('span', { style: C.muted, title: '这些站今天还没到自己的抓取时刻:不是失败' }, '· 未到计划 ' + waitingRows.length) : null,
|
|
1060
|
-
dueRows.length ? h('span', { style: { color:
|
|
1061
|
-
h('span', { style: issues.length ? { color:
|
|
1132
|
+
dueRows.length ? h('span', { style: { color: T.warn }, title: '已过计划时刻但还没抓到:等兜底,或点「扫描已选榜」马上跑' }, '· 待补跑 ' + dueRows.length) : null,
|
|
1133
|
+
h('span', { style: issues.length ? { color: T.warn, fontWeight: 600 } : { color: T.ok } },
|
|
1062
1134
|
issues.length ? '待处理 ' + issues.length + ' 项' : '无待处理'),
|
|
1063
1135
|
ov.hiddenCount ? h('span', { style: C.muted }, '· 未显示 ' + ov.hiddenCount + ' 个榜') : null),
|
|
1064
1136
|
/* ② 主动作:扫描(联网)与重新载入(只读本地)分开写清 */
|
|
1065
1137
|
h('div', { style: C.row },
|
|
1066
1138
|
h('button', {
|
|
1067
|
-
|
|
1139
|
+
className: 'rs-btn is-primary',
|
|
1068
1140
|
disabled: scanBusy,
|
|
1069
1141
|
title: '按「设置 → 抓取范围」里勾选的榜逐个扫描(会联网)',
|
|
1070
1142
|
onClick: function () { props.act('/scan') },
|
|
1071
1143
|
}, scanBtnText),
|
|
1072
|
-
scanBusy ? h('button', {
|
|
1073
|
-
badRows.length ? h('button', {
|
|
1074
|
-
h('button', {
|
|
1144
|
+
scanBusy ? h('button', { className: 'rs-btn is-danger', onClick: function () { props.act('/cancel') } }, '停止本次(保留已完成)') : null,
|
|
1145
|
+
badRows.length ? h('button', { className: 'rs-btn', disabled: scanBusy, onClick: function () { props.act('/retry') } }, '重试失败 ' + badRows.length + ' 个榜') : null,
|
|
1146
|
+
h('button', { className: 'rs-btn is-ghost', onClick: props.reload, title: '只重新读取本地数据:不联网、不采集' }, '重新载入'),
|
|
1075
1147
|
// 运行中不显示「上次 …」:那一轮还没结束,进度只放在主按钮一处(否则会同时出现两条「扫描中」)
|
|
1076
1148
|
scanRunning ? null : h('span', { style: C.muted }, '上次 ' + scanLabel(scan))),
|
|
1077
1149
|
/* 补全进度:面板顶部只有这一条(三态:跑着 / 还能续跑 / 当日已试满) */
|
|
@@ -1088,12 +1160,11 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1088
1160
|
: retryable === 0
|
|
1089
1161
|
? '补全已尽力:还缺 ' + left + ' 个榜(当日已试满,明天自动续跑)'
|
|
1090
1162
|
: '补全未完成:还缺 ' + left + ' 个榜(后台会继续补,也可进榜点「补全缺失字段」)'
|
|
1091
|
-
return h(
|
|
1163
|
+
return h(Banner, { tone: active ? 'info' : 'warn', live: false }, label)
|
|
1092
1164
|
})(),
|
|
1093
1165
|
/* ③ 需要处理:仅有问题时出现 */
|
|
1094
|
-
issues.length ? h(
|
|
1095
|
-
h('div', { style: {
|
|
1096
|
-
issues.map(function (it) {
|
|
1166
|
+
issues.length ? h(Banner, { tone: issues.some(function (it) { return it.status !== 'stale' && it.status !== 'enrich' }) ? 'error' : 'warn', title: '需要处理' },
|
|
1167
|
+
h('div', { className: 'rs-banner-body', style: { display: 'flex', flexDirection: 'column', gap: '2px' } }, issues.map(function (it) {
|
|
1097
1168
|
/**
|
|
1098
1169
|
* Spec S5:一条问题要给「榜名 + 发生时间 + 影响 + 可执行动作」。
|
|
1099
1170
|
* 以前只有一个泛化「重试失败 N 个榜」,看不出是哪次尝试、也没法直接进榜看。
|
|
@@ -1104,9 +1175,9 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1104
1175
|
it.at ? h('span', { style: C.muted }, fmtLocalHM(it.at)) : null,
|
|
1105
1176
|
h('span', null, it.why),
|
|
1106
1177
|
it.detail ? h('span', { style: C.muted }, '(' + String(it.detail).slice(0, 80) + ')') : null,
|
|
1107
|
-
it.boardId ? h('button', {
|
|
1108
|
-
it.boardId ? h('button', {
|
|
1109
|
-
})) : null,
|
|
1178
|
+
it.boardId ? h('button', { className: 'rs-btn', disabled: props.busy, onClick: function () { props.onOpenBoard && props.onOpenBoard(it.boardId) }, title: '在「榜单」页打开这一榜(保上下文)' }, '查看本榜') : null,
|
|
1179
|
+
it.boardId ? h('button', { className: 'rs-btn', disabled: props.busy, onClick: function () { props.onRescanBoard && props.onRescanBoard(it.boardId) }, title: '只重扫这一榜(会联网)' }, '重扫本榜') : null)
|
|
1180
|
+
}))) : null,
|
|
1110
1181
|
/* ④ 今天的变化 */
|
|
1111
1182
|
h('div', { style: C.siteBar }, '今天的变化' + (chgRealTotal ? '(' + chgRealTotal + ' 条)' : '')),
|
|
1112
1183
|
chg && chg.note ? h('div', { style: C.muted }, chg.note) : null,
|
|
@@ -1116,7 +1187,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1116
1187
|
[{ label: '全部', value: '' }].concat(groupNames.map(function (g) { return { label: g, value: g } })).map(function (o) {
|
|
1117
1188
|
return h('button', {
|
|
1118
1189
|
key: 'f-' + (o.value || 'all'),
|
|
1119
|
-
|
|
1190
|
+
className: chgFilter === o.value ? 'rs-btn is-on' : 'rs-btn',
|
|
1120
1191
|
onClick: function () { setChgFilter(o.value) },
|
|
1121
1192
|
}, o.label + ' ' + (o.value ? groupCount(o.value) : chgRealTotal))
|
|
1122
1193
|
})) : null,
|
|
@@ -1151,7 +1222,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1151
1222
|
h('thead', null, h('tr', null, ['分组', '榜', '书名', '变化'].map(function (t) { return h('th', { key: t, style: C.th }, t) }))),
|
|
1152
1223
|
h('tbody', null, shownBySite.flatMap(function (g) {
|
|
1153
1224
|
const head = h('tr', { key: 'ch-' + g.site },
|
|
1154
|
-
h('td', { style: { ...C.td, paddingTop: '7px', fontWeight: 600, color:
|
|
1225
|
+
h('td', { style: { ...C.td, paddingTop: '7px', fontWeight: 600, color: T.muted }, colSpan: 4 },
|
|
1155
1226
|
g.siteName + ' · ' + g.items.length + ' 条'))
|
|
1156
1227
|
const body = g.items.map(function (e, i) {
|
|
1157
1228
|
return h('tr', {
|
|
@@ -1172,7 +1243,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1172
1243
|
/* ⑤ 全部榜单(可折叠) */
|
|
1173
1244
|
h('div', { style: { ...C.row, marginTop: '8px' } },
|
|
1174
1245
|
h('button', {
|
|
1175
|
-
|
|
1246
|
+
className: 'rs-btn is-ghost',
|
|
1176
1247
|
'aria-expanded': showAll ? 'true' : 'false',
|
|
1177
1248
|
onClick: function () { setShowAll(!showAll) },
|
|
1178
1249
|
}, (showAll ? '▾ ' : '▸ ') + '全部榜单(' + total + ')')),
|
|
@@ -1210,7 +1281,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1210
1281
|
'退 ', h('span', { style: b.out > 0 ? C.down : null }, dash(b.out)))),
|
|
1211
1282
|
h('td', { style: C.td }, b.status === 'ok'
|
|
1212
1283
|
? (headTime ? h('span', { style: C.muted }, '—') : (b.lastCapture ? fmtLocalHM(b.lastCapture) : '—'))
|
|
1213
|
-
: h('span', { style: { color: b.status === 'stale' ?
|
|
1284
|
+
: h('span', { style: { color: b.status === 'stale' ? T.warn : T.bad } }, statusText(b.status))),
|
|
1214
1285
|
hasNoteCol && !chgNarrow ? h('td', { style: C.td }, dash(b.note)) : null)
|
|
1215
1286
|
})
|
|
1216
1287
|
return [head].concat(rowsOut)
|
|
@@ -1429,17 +1500,17 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1429
1500
|
* 「有未保存的改动」和保存按钮(改了半天以为已经生效)。
|
|
1430
1501
|
* 保持原语义:保存只落抓取集 + 两个补全开关,计划时刻仍由「保存计划」单独保存。
|
|
1431
1502
|
*/
|
|
1432
|
-
const saveBar = h('div', { style: { position: 'sticky', bottom: '0', zIndex: 4, marginTop: '6px', padding: '
|
|
1433
|
-
border: '1px solid ' + (dirty ?
|
|
1434
|
-
background:
|
|
1435
|
-
backgroundImage: dirty ? 'linear-gradient(
|
|
1436
|
-
boxShadow:
|
|
1503
|
+
const saveBar = h('div', { style: { position: 'sticky', bottom: '0', zIndex: 4, marginTop: '6px', padding: '6px 8px',
|
|
1504
|
+
border: '1px solid ' + (dirty ? wash(T.warn, 60) : T.border), borderRadius: T.r.s,
|
|
1505
|
+
background: T.surface,
|
|
1506
|
+
backgroundImage: dirty ? 'linear-gradient(' + wash(T.warn, 16) + ',' + wash(T.warn, 16) + ')' : 'none',
|
|
1507
|
+
boxShadow: T.shadowBar } },
|
|
1437
1508
|
h('div', { style: C.row },
|
|
1438
|
-
h('button', {
|
|
1509
|
+
h('button', { className: 'rs-btn is-primary', disabled: busy || !dirty, onClick: save }, dirty ? '保存设置(' + picked.length + ' 个榜)' : '已保存(' + picked.length + ' 个榜)'),
|
|
1439
1510
|
// 放弃改动 = 真的丢掉草稿(否则 load 会按草稿再恢复一遍,等于没放弃)
|
|
1440
|
-
dirty ? h('button', {
|
|
1441
|
-
dirty ? h('span', { style: { color:
|
|
1442
|
-
h('button', {
|
|
1511
|
+
dirty ? h('button', { className: 'rs-btn', disabled: busy, onClick: function () { DRAFTS.settings = null; dirtyGuard.set('settings', false); setNote('已放弃改动'); load() } }, '放弃改动') : null,
|
|
1512
|
+
dirty ? h('span', { style: { color: T.warn } }, '有未保存的改动') : null,
|
|
1513
|
+
h('button', { className: 'rs-btn', disabled: busy, onClick: restoreDefaults, title: '把勾选恢复成插件默认抓取集(只改草稿,保存后生效)' }, '恢复默认'),
|
|
1443
1514
|
note ? h('span', { style: C.muted }, String(note).slice(0, 100)) : null))
|
|
1444
1515
|
return h('div', null,
|
|
1445
1516
|
h(Section, { title: '抓取范围(' + picked.length + ' 个榜)', defaultOpen: true },
|
|
@@ -1447,8 +1518,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1447
1518
|
h('div', { style: C.row }, sites.map(function (s) {
|
|
1448
1519
|
return h('span', { key: s, style: { ...C.row, margin: 0 } },
|
|
1449
1520
|
h('span', { style: C.muted }, siteNameOf(s) + ' ' + pickedOf(s) + '/' + siteTotal(s)),
|
|
1450
|
-
h('button', {
|
|
1451
|
-
h('button', {
|
|
1521
|
+
h('button', { className: 'rs-btn is-ghost', onClick: function () { setAll(s, true) } }, '全选'),
|
|
1522
|
+
h('button', { className: 'rs-btn is-ghost', onClick: function () { setAll(s, false) } }, '全不选'),
|
|
1452
1523
|
h(PopMenu, { label: '更多', width: 190, items: [
|
|
1453
1524
|
{ label: '补齐该站缺失字段', onClick: function () { enrichSite(s) }, title: '把该站已勾选的榜逐个补全(逐本 1 请求,很慢)' },
|
|
1454
1525
|
] }))
|
|
@@ -1489,18 +1560,18 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1489
1560
|
return h('div', { key: key, style: { ...C.row, marginTop: '2px' } },
|
|
1490
1561
|
h('span', { style: { width: '46px', flex: '0 0 auto' } }, s[1]),
|
|
1491
1562
|
h('input', {
|
|
1492
|
-
type: 'time', style: { ...C.
|
|
1563
|
+
type: 'time', style: { ...C.input, width: '92px' }, value: (tTimes || {})[key] || '',
|
|
1493
1564
|
onChange: function (e) { const nx = Object.assign({}, tTimes); nx[key] = e.target.value; setTTimes(nx) },
|
|
1494
1565
|
}),
|
|
1495
1566
|
h('span', { style: C.muted }, why))
|
|
1496
1567
|
})),
|
|
1497
1568
|
h('div', { style: { ...C.row, marginTop: '2px' } },
|
|
1498
1569
|
h('span', { style: { width: '46px', flex: '0 0 auto' } }, '兜底'),
|
|
1499
|
-
h('input', { type: 'time', style: { ...C.
|
|
1570
|
+
h('input', { type: 'time', style: { ...C.input, width: '92px' }, value: tFall, onChange: function (e) { setTFall(e.target.value) } }),
|
|
1500
1571
|
h('span', { style: C.muted }, '当天失败或内容待核对的站,到这个点再补一次(每站每天一次)')),
|
|
1501
1572
|
timesDirty ? h('div', { style: C.row },
|
|
1502
|
-
h('button', {
|
|
1503
|
-
h('span', { style: { color:
|
|
1573
|
+
h('button', { className: 'rs-btn', onClick: savePlan }, '保存计划'),
|
|
1574
|
+
h('span', { style: { color: T.warn } }, '时刻有改动,未保存')) : null,
|
|
1504
1575
|
h('div', { style: C.muted }, '状态更新于 ' + ((planLive && planLive.now) || '—') + (planLive && planLive.installedToday ? ' · 今天刚安装:安装当天不自动跑,明天起按上面的时刻执行' : '')),
|
|
1505
1576
|
tNote ? h('div', { style: C.muted }, String(tNote).slice(0, 140)) : null),
|
|
1506
1577
|
h(Section, { title: '数据与性能', defaultOpen: false, summary: (ov && ov.storage ? '数据目录 ' + fmtBytes(ov.storage.totalBytes) + ' · 保留 ' + retention + ' 天' : '') },
|
|
@@ -1530,8 +1601,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1530
1601
|
h('span', { style: C.muted }, '起点收藏补全'),
|
|
1531
1602
|
h('input', { type: 'checkbox', checked: qdEnrich, onChange: function (e) { setQdEnrich(e.target.checked); setDirty(true) } }),
|
|
1532
1603
|
h('span', { style: C.muted }, qdEnrich ? '已开启' : '已关闭(默认关)'),
|
|
1533
|
-
h('button', {
|
|
1534
|
-
h('button', {
|
|
1604
|
+
h('button', { className: 'rs-btn', disabled: busy, onClick: function () { setBusy(true); jpost('/qidianEnrich').then(function (r) { setNote((r && r.note) || '起点补全完成'); return load() }).catch(function (e) { setNote(String(e)) }).then(function () { setBusy(false) }) } }, '补全起点收藏'),
|
|
1605
|
+
h('button', { className: 'rs-btn', disabled: busy, onClick: function () { setBusy(true); jpost('/qidianCache', { clear: true }).then(function (r) { setNote((r && r.note) || '缓存已清'); return load() }).catch(function (e) { setNote(String(e)) }).then(function () { setBusy(false) }) } }, '清空书页缓存')),
|
|
1535
1606
|
h('div', { style: C.muted }, '起点书页缓存 ' + (qdCache && qdCache.cache ? qdCache.cache.books : 0) + ' 本 · 有效期 ' + ((qdCache && qdCache.ttlDays) || 7) + ' 天' +
|
|
1536
1607
|
(cat.bookCache ? ' · 通用书页缓存 ' + ((cat.bookCache.stat && cat.bookCache.stat.entries) || 0) + ' 本 · 有效期 ' + (cat.bookCache.ttlDays || 7) + ' 天' : '')),
|
|
1537
1608
|
h(Section, { title: '高级:请求间隔', defaultOpen: false, summary: '当前 ' + fmtIntervalText(intervalMs) },
|
|
@@ -1543,14 +1614,14 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1543
1614
|
},
|
|
1544
1615
|
[200, 500, 1000, 2000, 5000].map(function (v) { return h('option', { key: v, value: String(v) }, v + ' ms' + (v === 1000 ? '(默认)' : '')) }),
|
|
1545
1616
|
h('option', { key: 0, value: '0' }, '不限速(仅本地测试)')),
|
|
1546
|
-
h('button', {
|
|
1617
|
+
h('button', { className: 'rs-btn', disabled: busy, onClick: function () { setBusy(true); jpost('/select', { requestIntervalMs: intervalMs }).then(function () { setNote('请求间隔已改为 ' + (intervalMs === 0 ? '不限速' : intervalMs + 'ms')); return load() }).catch(function (e) { setNote(String(e)) }).then(function () { setBusy(false) }) } }, '应用'),
|
|
1547
1618
|
h('span', { style: C.muted }, '1s 是本项目自定的保守值(不是站点要求);调小更快,也更容易被站点注意到')))),
|
|
1548
1619
|
h(Section, { title: '关于与诊断', defaultOpen: false, summary: (sv.webServer ? '服务正常' : 'webServer 未注册') + ' · 自动扫描' + (sv.timerArmed ? '已生效' : '未生效') },
|
|
1549
1620
|
h(VersionRow, { setNote: setNote }),
|
|
1550
1621
|
h('div', { style: C.muted }, '服务:webServer ' + (sv.webServer ? '✓' : '✗') + ' · timer ' + (sv.timerService ? '✓' : '✗') + ' · 定时任务' + (sv.timerArmed ? '已启用' : '未启用')),
|
|
1551
1622
|
note ? h('div', { style: C.muted }, '最近提示:' + String(note).slice(0, 160)) : null,
|
|
1552
1623
|
h('div', { style: C.row },
|
|
1553
|
-
h('button', {
|
|
1624
|
+
h('button', { className: 'rs-btn', onClick: function () { try { navigator.clipboard.writeText(diag()); setNote('诊断信息已复制(不含凭证)') } catch (e) { setNote('复制失败:' + e) } } }, '复制诊断信息'))), saveBar)
|
|
1554
1625
|
}
|
|
1555
1626
|
/**
|
|
1556
1627
|
* ★ 版本区(2026-10-16):显示当前版本 + 「一键更新」。
|
|
@@ -1622,13 +1693,13 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1622
1693
|
? '当前 ' + chk.current + ':未发布到 npm,请用 Release 附件或仓库链接更新'
|
|
1623
1694
|
: '当前 ' + chk.current + '(' + (chk.reason || '更新检查不可用') + ')' + (chk.latest ? ';registry 最新 ' + chk.latest : '')
|
|
1624
1695
|
const canClick = !!(chk && (chk.canUpdateInPlace || chk.action === 'refresh' || chk.action === 'restart'))
|
|
1625
|
-
return h('div', { style: { margin: '8px 0', padding: '7px 9px'
|
|
1696
|
+
return h('div', { style: { ...C.card, margin: '8px 0', padding: '7px 9px' } },
|
|
1626
1697
|
h('div', { style: { fontWeight: 600, marginBottom: '4px' } }, '版本'),
|
|
1627
1698
|
h('div', { style: C.muted }, line),
|
|
1628
1699
|
(info && info.name && info.version) ? h('div', { style: C.muted }, info.name + ' v' + info.version) : null,
|
|
1629
1700
|
h('div', { style: C.row },
|
|
1630
1701
|
h('button', {
|
|
1631
|
-
|
|
1702
|
+
className: 'rs-btn',
|
|
1632
1703
|
disabled: busy !== '' || !canClick,
|
|
1633
1704
|
onClick: function () {
|
|
1634
1705
|
if (!chk) return
|
|
@@ -1644,7 +1715,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1644
1715
|
else refresh()
|
|
1645
1716
|
},
|
|
1646
1717
|
}, busy !== '' ? '处理中…' : (!chk ? '检查中…' : chk.buttonLabel)),
|
|
1647
|
-
h('button', {
|
|
1718
|
+
h('button', { className: 'rs-btn', disabled: busy !== '', onClick: function () { setNote(''); refresh() } }, '重新检查')),
|
|
1648
1719
|
note ? h('div', { style: C.muted }, note) : null)
|
|
1649
1720
|
}
|
|
1650
1721
|
|
|
@@ -1786,8 +1857,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1786
1857
|
h('div', { style: C.row },
|
|
1787
1858
|
h('span', { style: C.muted }, '书签夹'),
|
|
1788
1859
|
h('input', { style: { ...C.input, flex: 1, minWidth: '120px' }, value: folders, placeholder: '空格分隔,可属于多个夹', onChange: function (e) { setFolders(e.target.value) } }),
|
|
1789
|
-
h('button', {
|
|
1790
|
-
msg ? h('div', { style: { ...C.muted, color: String(msg).indexOf('失败') >= 0 ?
|
|
1860
|
+
h('button', { className: 'rs-btn is-primary', disabled: busy || !loaded, onClick: save }, busy ? '保存中…' : '保存')),
|
|
1861
|
+
msg ? h('div', { style: { ...C.muted, color: String(msg).indexOf('失败') >= 0 ? T.bad : null } }, msg) : null)
|
|
1791
1862
|
}
|
|
1792
1863
|
|
|
1793
1864
|
/**
|
|
@@ -1996,12 +2067,12 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
1996
2067
|
h('option', { value: '' }, '全部站'), sites.map(function (s) { return h('option', { key: s, value: s }, siteLabel(s)) })),
|
|
1997
2068
|
h('select', { style: C.input, value: f.folder, onChange: function (e) { setF({ folder: e.target.value }) } },
|
|
1998
2069
|
h('option', { value: '' }, '全部夹'), (store.folders || []).map(function (x) { return h('option', { key: x, value: x }, x) })),
|
|
1999
|
-
h('button', {
|
|
2070
|
+
h('button', { className: filtersOpen ? 'rs-btn is-on' : 'rs-btn', onClick: function () { setFiltersOpen(!filtersOpen) }, 'aria-expanded': filtersOpen ? 'true' : 'false' }, '筛选'),
|
|
2000
2071
|
h(PopMenu, { label: '更多', items: moreItems, width: 200 })),
|
|
2001
|
-
filtersOpen ? h('div', { style: { ...C.row, padding: '4px 6px', border: '1px solid
|
|
2072
|
+
filtersOpen ? h('div', { style: { ...C.row, padding: '4px 6px', border: '1px solid ' + T.border, borderRadius: '6px' } },
|
|
2002
2073
|
h('span', { style: C.muted }, '标签'),
|
|
2003
2074
|
h('input', { style: { ...C.input, width: '120px' }, placeholder: '#标签', value: f.tag || '', onChange: function (e) { setF({ tag: String(e.target.value).replace(/^#/, '') }) } }),
|
|
2004
|
-
(f.q || f.site || f.folder || f.tag) ? h('button', {
|
|
2075
|
+
(f.q || f.site || f.folder || f.tag) ? h('button', { className: 'rs-btn', onClick: function () { setF({ q: '', site: '', folder: '', tag: '' }) } }, '清除筛选') : null,
|
|
2005
2076
|
h('span', { style: C.muted }, '备注里写的 #标签 会自动出现在这里')) : null,
|
|
2006
2077
|
addOpen ? h('div', { style: { ...C.card, marginTop: '4px' } },
|
|
2007
2078
|
h('div', { style: C.row },
|
|
@@ -2010,22 +2081,22 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2010
2081
|
h('select', { style: C.input, value: manualSite, onChange: function (e) { setManualSite(e.target.value) } },
|
|
2011
2082
|
h('option', { value: '' }, '(URL 可自动识别)'),
|
|
2012
2083
|
h('option', { value: 'qidian' }, '起点'), h('option', { value: 'qidiantu' }, '起点图'), h('option', { value: 'ciweimao' }, '刺猬猫'), h('option', { value: 'sfacg' }, '菠萝包'), h('option', { value: 'fanqie' }, '番茄')),
|
|
2013
|
-
h('button', {
|
|
2014
|
-
h('button', {
|
|
2015
|
-
switchAsk ? h(
|
|
2016
|
-
h('div', { style: { fontWeight: 600 } }, '「' + (switchAsk.label || switchAsk.bookKey) + '」还开着没保存的备注/夹'),
|
|
2084
|
+
h('button', { className: 'rs-btn', disabled: !String(manual || '').trim(), onClick: addManual }, '加入书签'),
|
|
2085
|
+
h('button', { className: 'rs-btn', onClick: function () { setAddOpen(false) } }, '收起'))) : null,
|
|
2086
|
+
switchAsk ? h(Banner, { tone: 'warn' },
|
|
2087
|
+
h('div', { style: { fontWeight: 600, flex: '1 1 100%' } }, '「' + (switchAsk.label || switchAsk.bookKey) + '」还开着没保存的备注/夹'),
|
|
2017
2088
|
h('div', { style: C.row },
|
|
2018
|
-
h('button', {
|
|
2019
|
-
h('button', {
|
|
2089
|
+
h('button', { className: 'rs-btn is-primary', onClick: function () { setSwitchAsk(null) } }, '继续编辑'),
|
|
2090
|
+
h('button', { className: 'rs-btn', onClick: function () { applyEdit(switchAsk) } }, '放弃并切换')),
|
|
2020
2091
|
h('div', { style: C.muted }, '继续编辑:刚才写的内容还在。放弃并切换:只丢当前这条的未保存改动。')) : null,
|
|
2021
2092
|
h('div', { style: C.muted }, (store.list === null ? '加载中…' : '共 ' + list.length + ' 条' + (store.total && store.total !== list.length ? '(全部 ' + store.total + ' 条,已按筛选)' : '') + ' · 不含回收站')),
|
|
2022
|
-
store.health && store.health.error ? h('div', { style: { ...C.muted, color:
|
|
2023
|
-
selectMode ? h('div', { style: { ...C.row, padding: '4px 6px', border: '1px solid
|
|
2093
|
+
store.health && store.health.error ? h('div', { style: { ...C.muted, color: T.bad } }, '⚠ ' + store.health.error) : null,
|
|
2094
|
+
selectMode ? h('div', { style: { ...C.row, padding: '4px 6px', border: '1px solid ' + T.border, borderRadius: '6px', background: T.subtle } },
|
|
2024
2095
|
h('span', null, '已选 ' + sel.length + ' 条'),
|
|
2025
|
-
h('button', {
|
|
2026
|
-
h('button', {
|
|
2027
|
-
h('button', {
|
|
2028
|
-
h('button', {
|
|
2096
|
+
h('button', { className: 'rs-btn', onClick: function () { setSel(list.map(function (b) { return b.bookKey })) } }, '全选当前筛选(' + list.length + ')'),
|
|
2097
|
+
h('button', { className: 'rs-btn', disabled: !sel.length, onClick: function () { setSel([]) } }, '取消选择'),
|
|
2098
|
+
h('button', { className: 'rs-btn', disabled: !sel.length, onClick: function () { setScope('selected'); setExportOpen(true) } }, '导出已选'),
|
|
2099
|
+
h('button', { className: 'rs-btn', onClick: function () { setSelectMode(false); setSel([]) } }, '退出批量选择')) : null,
|
|
2029
2100
|
exportOpen ? h('div', { style: { ...C.card, marginTop: '4px' } },
|
|
2030
2101
|
h('div', { style: { fontWeight: 600 } }, '导出书签'),
|
|
2031
2102
|
h('div', { style: C.row },
|
|
@@ -2038,9 +2109,9 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2038
2109
|
h('select', { style: C.input, value: fmt, onChange: function (e) { setFmt(e.target.value) } },
|
|
2039
2110
|
h('option', { value: 'csv' }, 'CSV'), h('option', { value: 'json' }, 'JSON'), h('option', { value: 'md' }, 'Markdown')),
|
|
2040
2111
|
h('input', { style: { ...C.input, flex: 1, minWidth: '150px' }, placeholder: '导出目录(留空 = 默认目录)', value: dest, onChange: function (e) { setDest(e.target.value) } }),
|
|
2041
|
-
h('button', {
|
|
2042
|
-
h('button', {
|
|
2043
|
-
h('button', {
|
|
2112
|
+
h('button', { className: 'rs-btn', disabled: exporting || scopeCount() === 0, title: scopeCount() === 0 ? '这个范围没有条目' : '', onClick: doExport }, exporting ? '导出中…' : '导出 ' + scopeCount() + ' 条'),
|
|
2113
|
+
h('button', { className: 'rs-btn', onClick: function () { jpost('/bookmark/open-folder', { path: String(dest || '').trim() || undefined }).then(function (r) { setExMsg('已打开 ' + ((r && r.opened) || '')) }).catch(function (e) { setExMsg('打不开:' + e) }) } }, '打开文件夹'),
|
|
2114
|
+
h('button', { className: 'rs-btn', onClick: function () { setExportOpen(false) } }, '收起')),
|
|
2044
2115
|
exMsg ? h('div', { style: C.muted }, String(exMsg).slice(0, 140)) : null) : null,
|
|
2045
2116
|
list.length === 0 ? h('div', { style: C.muted }, store.list === null ? '' : (f.q || f.site || f.folder || f.tag ? '没有符合筛选条件的书签' : '还没有书签:在「榜单」里点书名旁的 ☆ 就能加')) : null,
|
|
2046
2117
|
list.map(function (b) {
|
|
@@ -2061,11 +2132,11 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2061
2132
|
oldMetric != null ? h('span', { style: { ...C.chip, opacity: 0.8 }, title: '书签记录:最近一次自动更新时该榜的' + lab + '(与上面的实时值不是同一时点)' }, '书签记录 ' + fmtRead(oldMetric)) : null,
|
|
2062
2133
|
metricText ? h('span', { style: C.chip }, metricText) : null,
|
|
2063
2134
|
b.capturedAt ? h('span', { style: C.muted, title: '这张卡的数据截止到这一天' }, '截止 ' + mdOf(b.capturedAt) + (b.ageDays != null ? '(' + b.ageDays + ' 天前)' : '')) : null,
|
|
2064
|
-
b.ageDays != null && b.ageDays >= 7 ? h('span', { style: { ...C.chip, color:
|
|
2135
|
+
b.ageDays != null && b.ageDays >= 7 ? h('span', { style: { ...C.chip, color: T.warn }, title: '超过 7 天没有变新:点「更新本书数据」试试;仍不变则这个来源可能取不到数了' }, '数据已 ' + b.ageDays + ' 天未更新') : null,
|
|
2065
2136
|
b.valueFrom === 'manual' ? h('span', { style: C.chip }, '待补') : null),
|
|
2066
2137
|
h('div', { style: C.row },
|
|
2067
2138
|
h('button', {
|
|
2068
|
-
|
|
2139
|
+
className: 'rs-btn', style: { borderStyle: 'dashed', textAlign: 'left', maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' },
|
|
2069
2140
|
title: noteText ? '编辑备注' : '加备注',
|
|
2070
2141
|
onClick: function () { startEdit(b) },
|
|
2071
2142
|
}, noteText ? noteText.slice(0, 60) : '+ 备注'),
|
|
@@ -2086,15 +2157,15 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2086
2157
|
onChange: function (e) { setDraft({ ...draft, folders: e.target.value }) },
|
|
2087
2158
|
})),
|
|
2088
2159
|
h('div', { style: C.row },
|
|
2089
|
-
h('button', {
|
|
2090
|
-
h('button', {
|
|
2160
|
+
h('button', { className: switchAsk ? 'rs-btn' : 'rs-btn is-primary', disabled: editBusy, onClick: function () { saveEdit(b) } }, editBusy ? '保存中…' : '保存'),
|
|
2161
|
+
h('button', { className: 'rs-btn', disabled: editBusy, onClick: function () { cancelEdit(b) } }, '取消'),
|
|
2091
2162
|
discardAsk
|
|
2092
|
-
? h('span', { style: { ...C.row, color:
|
|
2163
|
+
? h('span', { style: { ...C.row, color: T.warn } },
|
|
2093
2164
|
h('span', null, '放弃这些改动?'),
|
|
2094
|
-
h('button', {
|
|
2095
|
-
h('button', {
|
|
2165
|
+
h('button', { className: 'rs-btn', onClick: function () { closeEdit() } }, '放弃'),
|
|
2166
|
+
h('button', { className: 'rs-btn', onClick: function () { setDiscardAsk(false) } }, '继续编辑'))
|
|
2096
2167
|
: null,
|
|
2097
|
-
editErr ? h('span', { style: { color:
|
|
2168
|
+
editErr ? h('span', { style: { color: T.bad } }, editErr) : null)) : null,
|
|
2098
2169
|
h('div', { style: C.row },
|
|
2099
2170
|
h('a', { href: b.url || '#', style: { color: 'inherit', padding: '3px 8px' }, title: '在 DSH 侧栏浏览器打开', onClick: function (e) { e.preventDefault(); (props.openLink || function (u) { window.open(u, '_blank', 'noopener,noreferrer') })(b.url) } }, '打开'),
|
|
2100
2171
|
h(PopMenu, { label: '更多', width: 190, items: [
|
|
@@ -2114,27 +2185,27 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2114
2185
|
: null,
|
|
2115
2186
|
h('div', { style: C.muted }, '备注与夹只由你改:任何自动更新都不会覆盖。')) : null)
|
|
2116
2187
|
}),
|
|
2117
|
-
undo ? h(
|
|
2188
|
+
undo ? h(Banner, { tone: 'warn' },
|
|
2118
2189
|
h('span', null, '已删除「' + undo.label + '」'),
|
|
2119
|
-
h('button', {
|
|
2190
|
+
h('button', { className: 'rs-btn', onClick: doUndo }, '撤销'),
|
|
2120
2191
|
h('span', { style: C.muted }, '(8 秒内;之后可在回收站找回)')) : null,
|
|
2121
|
-
showTrash ? h('div', { style: { marginTop: '8px', padding: '6px 8px', border: '1px solid
|
|
2192
|
+
showTrash ? h('div', { style: { marginTop: '8px', padding: '6px 8px', border: '1px solid ' + T.border, borderRadius: '8px' } },
|
|
2122
2193
|
h('div', { style: C.row },
|
|
2123
2194
|
h('span', { style: { fontWeight: 600 } }, '回收站(' + trash.length + ')'),
|
|
2124
2195
|
trash.length
|
|
2125
2196
|
? (confirmPurge
|
|
2126
2197
|
? h('span', { style: C.row },
|
|
2127
|
-
h('span', { style: { color:
|
|
2128
|
-
h('button', {
|
|
2129
|
-
h('button', {
|
|
2130
|
-
: h('button', {
|
|
2198
|
+
h('span', { style: { color: T.bad } }, '清空后不可恢复,确定?'),
|
|
2199
|
+
h('button', { className: 'rs-btn is-danger', onClick: function () { jpost('/bookmark', { action: 'purge', bookKeys: trash.map(function (b) { return b.bookKey }) }).then(function () { setConfirmPurge(false); load() }) } }, '确认清空'),
|
|
2200
|
+
h('button', { className: 'rs-btn', onClick: function () { setConfirmPurge(false) } }, '取消'))
|
|
2201
|
+
: h('button', { className: 'rs-btn', onClick: function () { setConfirmPurge(true) } }, '清空回收站'))
|
|
2131
2202
|
: null),
|
|
2132
2203
|
trash.length === 0 ? h('div', { style: C.muted }, '回收站是空的') : trash.map(function (b) {
|
|
2133
2204
|
return h('div', { key: 'tr' + b.bookKey, style: { ...C.card, opacity: 0.8 } },
|
|
2134
2205
|
h('div', { style: C.row },
|
|
2135
2206
|
h('span', { style: C.cardTitle }, b.label),
|
|
2136
2207
|
h('span', { style: C.muted }, '删除于 ' + String(b.deletedAt).slice(0, 10) + ' 还可找回 ' + b.daysLeft + ' 天'),
|
|
2137
|
-
h('button', {
|
|
2208
|
+
h('button', { className: 'rs-btn', onClick: function () { store.act({ action: 'restore', bookKey: b.bookKey }).then(function () { load() }).catch(function () {}) } }, '恢复')))
|
|
2138
2209
|
})) : null,
|
|
2139
2210
|
exMsg && !exportOpen ? h('div', { style: C.muted }, String(exMsg).slice(0, 140)) : null,
|
|
2140
2211
|
store.msg ? h('div', { style: C.muted }, store.msg) : null,
|
|
@@ -2249,7 +2320,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2249
2320
|
}, [props.rev, reloadBoard, directQ])
|
|
2250
2321
|
const selXS = function (label, value, options, onChange) {
|
|
2251
2322
|
return h('label', { style: C.row }, h('span', { style: C.muted }, label),
|
|
2252
|
-
h('select', { value: value, onChange: function (e) { onChange(e.target.value) }, style: C.
|
|
2323
|
+
h('select', { value: value, onChange: function (e) { onChange(e.target.value) }, style: C.input },
|
|
2253
2324
|
options.map(function (o) { return h('option', { key: o.value, value: o.value }, o.label) })))
|
|
2254
2325
|
}
|
|
2255
2326
|
const pickBoard = function (v) { sel.set({ board: v }); setBt(v); setSd(sel.pref(v, 'date')); setSs(sel.pref(v, 'sort')); setPick(null) }
|
|
@@ -2407,8 +2478,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2407
2478
|
style: { width: '58px', fontSize: '12px', padding: '2px 4px' },
|
|
2408
2479
|
}),
|
|
2409
2480
|
h('span', { style: C.muted }, info.can ? '条(上限 ' + info.max + ')' : '条 · ' + info.hint),
|
|
2410
|
-
h('button', {
|
|
2411
|
-
h('button', {
|
|
2481
|
+
h('button', { className: 'rs-btn', disabled: !info.can || busy, onClick: function () { saveDepth(false) }, title: '只保存,下次扫描生效' }, '保存'),
|
|
2482
|
+
h('button', { className: 'rs-btn', disabled: !info.can || busy, onClick: function () { saveDepth(true) }, title: '保存后立刻抓一次这一榜(会联网)' }, '保存并扫描本榜'))),
|
|
2412
2483
|
},
|
|
2413
2484
|
{ sep: true },
|
|
2414
2485
|
{
|
|
@@ -2427,8 +2498,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2427
2498
|
h('div', { style: { ...C.muted, marginBottom: '3px' } }, '按上架日回看(仅本榜支持核对)'),
|
|
2428
2499
|
h('div', { style: C.row },
|
|
2429
2500
|
h('input', { type: 'date', value: qDate, onChange: function (e) { setQDate(e.target.value) }, style: { fontSize: '12px', padding: '2px 4px' } }),
|
|
2430
|
-
h('button', {
|
|
2431
|
-
h('button', {
|
|
2501
|
+
h('button', { className: 'rs-btn', disabled: busy || !qDate, onClick: function () { queryDay(false) } }, '查看'),
|
|
2502
|
+
h('button', { className: 'rs-btn', disabled: busy || !qDate, onClick: function () { queryDay(true) }, title: '抓取该上架日并存为本地快照(已有快照不覆盖)' }, '存入本地')),
|
|
2432
2503
|
h('div', { style: { ...C.muted, marginTop: '2px' } }, '首订按 n-1 锚:选上架日 X ⇒ 请求数据日期 X+1(页面内容日期就是 X);保存后快照记在 X+1 名下。站点给的日期对不上会被拒绝,不写任何文件。')),
|
|
2433
2504
|
})
|
|
2434
2505
|
}
|
|
@@ -2480,14 +2551,14 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2480
2551
|
h('div', { style: C.row },
|
|
2481
2552
|
h(BookmarkStar, { bookKey: bookKeyOf(curBoard, r.key), row: r, boardId: curBoard, dataDate: data && data.dataDate }),
|
|
2482
2553
|
h(DetailBookmarkEditor, { bookKey: bookKeyOf(curBoard, r.key) }),
|
|
2483
|
-
h('button', {
|
|
2554
|
+
h('button', { className: 'rs-btn', onClick: function (e) { e.stopPropagation(); if (props.openLink) props.openLink(r.url); else window.open(r.url, '_blank', 'noopener,noreferrer') } }, '在 DSH 侧栏浏览器打开'),
|
|
2484
2555
|
h('a', { href: r.url || '#', target: '_blank', rel: 'noreferrer', style: { color: 'inherit', padding: '3px 8px' }, onClick: function (e) { e.stopPropagation() } }, '新标签打开'),
|
|
2485
|
-
h('button', {
|
|
2486
|
-
h('button', {
|
|
2556
|
+
h('button', { className: 'rs-btn', onClick: function (e) { e.stopPropagation(); try { navigator.clipboard.writeText(r.url || '') } catch (err) {} } }, '复制链接'),
|
|
2557
|
+
h('button', { className: 'rs-btn', onClick: function (e) { e.stopPropagation(); setPick(null) } }, '关闭')),
|
|
2487
2558
|
ex.qidiantuUrl || ex.sourceUrl
|
|
2488
2559
|
? h('div', { style: C.row },
|
|
2489
|
-
(ex.qidiantuUrl ? h('button', {
|
|
2490
|
-
(ex.sourceUrl ? h('button', {
|
|
2560
|
+
(ex.qidiantuUrl ? h('button', { className: 'rs-btn', onClick: function (e) { e.stopPropagation(); (props.openLink || window.open)(ex.qidiantuUrl) } }, '看起点图原始页') : null),
|
|
2561
|
+
(ex.sourceUrl ? h('button', { className: 'rs-btn', onClick: function (e) { e.stopPropagation(); (props.openLink || window.open)(ex.sourceUrl) } }, '看原数据来源页') : null),
|
|
2491
2562
|
h('span', { style: C.muted }, '(数据口径以来源页为准)'))
|
|
2492
2563
|
: null)
|
|
2493
2564
|
}
|
|
@@ -2508,8 +2579,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2508
2579
|
key: r.key || ('row' + i),
|
|
2509
2580
|
tabIndex: 0,
|
|
2510
2581
|
style: { ...C.card, padding: '5px 8px', margin: '5px 0', cursor: 'pointer',
|
|
2511
|
-
borderColor: open ?
|
|
2512
|
-
background: open ?
|
|
2582
|
+
borderColor: open ? T.border : undefined,
|
|
2583
|
+
background: open ? T.subtle : undefined },
|
|
2513
2584
|
onClick: function () { setPick(open ? null : r) },
|
|
2514
2585
|
onKeyDown: function (e) { if (e && (e.key === 'Enter' || e.key === ' ')) { e.preventDefault(); setPick(open ? null : r) } },
|
|
2515
2586
|
},
|
|
@@ -2534,10 +2605,10 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2534
2605
|
band ? h('div', { style: { ...C.muted, marginTop: '2px' } }, band) : null,
|
|
2535
2606
|
/* Spec 4.2:补全缺多少条要**就近可见**,别只藏在「更多」菜单里 */
|
|
2536
2607
|
enrichMissing ? h('div', { style: { ...C.row, marginTop: '2px' } },
|
|
2537
|
-
h('span', { style: { color:
|
|
2538
|
-
h('button', {
|
|
2608
|
+
h('span', { style: { color: T.warn } }, '补全未完成:还缺 ' + enrichMissing + ' 条字段'),
|
|
2609
|
+
h('button', { className: 'rs-btn', disabled: busy, onClick: doEnrich }, '补全'),
|
|
2539
2610
|
h('span', { style: C.muted }, '(榜页没给收藏/字数,要进书页取;1 秒/本)')) : null,
|
|
2540
|
-
viewDate ? h(
|
|
2611
|
+
viewDate ? h(Banner, { tone: 'warn' },
|
|
2541
2612
|
h('span', { style: { fontWeight: 600 } }, '正在查看历史:' + viewDate),
|
|
2542
2613
|
h('span', { style: C.muted }, data && data._queryDate ? '(直查站点,未落盘)' : '(本地快照)'),
|
|
2543
2614
|
/**
|
|
@@ -2546,7 +2617,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2546
2617
|
* 现在显式清直查视图 + 清本地日期偏好 + 递增 nonce ⇒ **一定**重发一次无 date 的 GET。
|
|
2547
2618
|
*/
|
|
2548
2619
|
h('button', {
|
|
2549
|
-
|
|
2620
|
+
className: 'rs-btn',
|
|
2550
2621
|
onClick: function () {
|
|
2551
2622
|
setSs('')
|
|
2552
2623
|
setSd('')
|
|
@@ -2558,9 +2629,9 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2558
2629
|
}, '回到最新')) : null,
|
|
2559
2630
|
data && data.fallbackFrom ? h('div', { style: C.muted }, '当天(' + data.requestedDate + ')没有快照 ⇒ 回落到 ' + data.fallbackFrom) : null,
|
|
2560
2631
|
data && data.source ? h('div', { style: C.muted }, '来源:' + data.source) : null,
|
|
2561
|
-
err ? h('div', { style: { ...C.row, color:
|
|
2632
|
+
err ? h('div', { style: { ...C.row, color: T.bad } },
|
|
2562
2633
|
h('span', null, '⚠ 读取失败:' + String(err).slice(0, 120)),
|
|
2563
|
-
h('button', {
|
|
2634
|
+
h('button', { className: 'rs-btn', onClick: function () { reloadBoard(false) } }, '重试')) : null,
|
|
2564
2635
|
note ? h('div', { style: C.muted }, note) : null,
|
|
2565
2636
|
data && data.rows && data.rows.length
|
|
2566
2637
|
? (cards
|
|
@@ -2806,7 +2877,7 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2806
2877
|
if (!open) return null
|
|
2807
2878
|
const narrow = rect.w < 720
|
|
2808
2879
|
const rev = revOf(ov)
|
|
2809
|
-
return h('div', { 'data-rank-scan-win': '1', style: { ...C.win, left: rect.x + 'px', top: rect.y + 'px', width: rect.w + 'px', height: rect.h + 'px'
|
|
2880
|
+
return h('div', { 'data-rank-scan-win': '1', style: { ...C.win, left: rect.x + 'px', top: rect.y + 'px', width: rect.w + 'px', height: rect.h + 'px' } },
|
|
2810
2881
|
h(DragBar, {
|
|
2811
2882
|
rect: rect, setRect: setRect,
|
|
2812
2883
|
onCollapse: function () {
|
|
@@ -2821,11 +2892,11 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2821
2892
|
h('button', { style: C.tab(tab === 'bm'), onClick: function () { switchTab('bm') } }, '书签'),
|
|
2822
2893
|
h('button', { style: C.tab(tab === 'pick'), onClick: function () { switchTab('pick') } }, '设置')),
|
|
2823
2894
|
msg ? h('div', { style: C.muted }, msg) : null,
|
|
2824
|
-
leaveAsk ? h(
|
|
2895
|
+
leaveAsk ? h(Banner, { tone: 'warn' },
|
|
2825
2896
|
h('span', null, '有未保存的改动(' + (leaveAsk.keys || []).map(function (k) { return LEAVE_LABEL[k] || k }).join('、') + ')'),
|
|
2826
2897
|
h('span', { style: C.muted }, '草稿会保留,下次进来还在'),
|
|
2827
|
-
h('button', {
|
|
2828
|
-
h('button', {
|
|
2898
|
+
h('button', { className: 'rs-btn', onClick: doLeave }, '仍然离开'),
|
|
2899
|
+
h('button', { className: 'rs-btn is-primary', onClick: function () { setLeaveAsk(null) } }, '继续编辑')) : null,
|
|
2829
2900
|
h(TabBoundary, { name: tab },
|
|
2830
2901
|
tab === 'ov' ? h(Overview, {
|
|
2831
2902
|
ov: ov, busy: busy || scanActBusy, act: act, reload: reload, narrow: narrow, width: rect.w, rev: rev,
|
|
@@ -2888,6 +2959,8 @@ const LS_OPEN = 'rank-scan-panel:open:v1'
|
|
|
2888
2959
|
|
|
2889
2960
|
const inject = ['slots']
|
|
2890
2961
|
function apply(ctx) {
|
|
2962
|
+
// 样式表只注入一次;选择器都带 rs- 前缀(见 ensureStyle)
|
|
2963
|
+
ensureStyle()
|
|
2891
2964
|
// ★ 首次安装自动弹一次:认领点从「模块求值期」移到这里(apply 真的跑到了才算数)
|
|
2892
2965
|
if (claimAutoOpen()) panelOpen.set(true)
|
|
2893
2966
|
// 可选依赖晚绑定:侧栏浏览器服务可用后捕获(不在 inject 列表里,避免服务缺失时整个面板挂不上)
|