feat(web): 设置页按新分类重排,加搜索、缓存分区与旧锚点跳转
- 左栏三组分区 + 当前分区的节;窄屏为搜索框、分组下拉和节的横排胶囊 - 搜索框按分区、节、节别名和字段名定位,选中字段时滚到该字段并聚焦 - 旧 hash(#automation/cache、#api-keys、#library/scrape 等)replace 到新位置 - 下载器分区放下载盘水位与保种缺省值,名字与实例抽屉统一(暂停线 / 恢复线 / 保种天数) - 新增获取、整理与刮削、系统、缓存分区;API Key 并入账户与安全,快捷键移到界面 - 补上缺的入口:最小视频体积、子会话并发与层数、搜索站点;日志保留天数(已废弃)不再显示 - 缓存分区按区列出条数、占用、最近写入,单区清空二次确认;TMDB 与图片缓存并入 - 保存提示统一为「已保存「节名」」;按入库口径把相关文案改成「整理」 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
93a6c8a910
commit
8071ad33f9
23 files changed
+1499
-642
No files matched your search
@@ -6,12 +6,12 @@ import { BrowserProvidersBlock } from "./browser-providers.tsx";
|
||||
import { num, str } from "./resource-section.tsx";
|
||||
import { type CardSpec, n, SettingsCard, SettingsGate } from "./settings-card.tsx";
|
||||
|
||||
// 站点默认(site-center §8):站点没单独设置时用的限流、快照周期、UA、代理;浏览器服务(BR-1)。
|
||||
// 站点、凭证、账号在「站点」页管理;站点级覆盖在站点的"编辑"里。
|
||||
// 站点与网络(site-center §8):站点没单独设置时用的限流、抓取周期等缺省值;UA 与代理;浏览器服务(BR-1)。
|
||||
// 站点、凭证、账号、Cloudflare 处理在「站点」页管理;站点级覆盖在站点的「编辑」里。
|
||||
|
||||
const DEFAULTS_CARD: CardSpec = {
|
||||
export const DEFAULTS_CARD: CardSpec = {
|
||||
anchor: "defaults",
|
||||
title: "默认值",
|
||||
title: "站点缺省值",
|
||||
description: "站点没有单独设置时使用。限流不会比站点定义自带的更快。",
|
||||
fields: [
|
||||
{
|
||||
@@ -51,22 +51,6 @@ const DEFAULTS_CARD: CardSpec = {
|
||||
kind: "number",
|
||||
hint: "拉取用户数据时最多翻几页做种列表;1–50",
|
||||
},
|
||||
{
|
||||
name: "sites.userAgent",
|
||||
label: "User-Agent",
|
||||
kind: "text",
|
||||
placeholder: "跟随浏览器",
|
||||
hint: "留空跟随浏览器(推荐),站点请求和浏览器用同一个 UA。填了则账号没单独填 UA 时都用它,和浏览器不一致",
|
||||
wide: true,
|
||||
},
|
||||
{
|
||||
name: "sites.proxyUrl",
|
||||
label: "代理地址",
|
||||
kind: "url",
|
||||
placeholder: "http://127.0.0.1:7890",
|
||||
hint: "只对开了「使用代理」的站点生效;留空不用代理",
|
||||
wide: true,
|
||||
},
|
||||
],
|
||||
fromSettings: (s) => ({
|
||||
"sites.defaultRateLimit.requestsPerMinute": n(s.sites.defaultRateLimit.requestsPerMinute),
|
||||
@@ -76,8 +60,6 @@ const DEFAULTS_CARD: CardSpec = {
|
||||
"sites.defaultSnapshotMaxPages": n(s.sites.defaultSnapshotMaxPages),
|
||||
"sites.defaultHealthCheckIntervalSec": n(s.sites.defaultHealthCheckIntervalSec / 3600),
|
||||
"sites.defaultDetailCacheSec": n(s.sites.defaultDetailCacheSec / 3600),
|
||||
"sites.userAgent": s.sites.userAgent,
|
||||
"sites.proxyUrl": s.sites.proxyUrl ?? "",
|
||||
}),
|
||||
toPatch: (v, s) => {
|
||||
const min = num(v["sites.defaultSnapshotIntervalSec"]);
|
||||
@@ -97,20 +79,52 @@ const DEFAULTS_CARD: CardSpec = {
|
||||
defaultSnapshotMaxPages: num(v["sites.defaultSnapshotMaxPages"]),
|
||||
defaultHealthCheckIntervalSec: healthH === undefined ? undefined : Math.round(healthH * 3600),
|
||||
defaultDetailCacheSec: detailH === undefined ? undefined : Math.round(detailH * 3600),
|
||||
// 空串 = 跟随浏览器(要能清空,不能用 undefined 表示"不改")
|
||||
userAgent: str(v["sites.userAgent"]),
|
||||
proxyUrl: str(v["sites.proxyUrl"]) || null,
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export const NETWORK_CARD: CardSpec = {
|
||||
anchor: "network",
|
||||
title: "UA 与代理",
|
||||
description: "站点请求用的 User-Agent 和代理。单个站点在「编辑」里决定用不用代理。",
|
||||
fields: [
|
||||
{
|
||||
name: "sites.userAgent",
|
||||
label: "User-Agent",
|
||||
kind: "text",
|
||||
placeholder: "跟随浏览器",
|
||||
hint: "留空跟随浏览器(推荐),站点请求和浏览器用同一个 UA。填了则账号没单独填 UA 时都用它,和浏览器不一致",
|
||||
wide: true,
|
||||
},
|
||||
{
|
||||
name: "sites.proxyUrl",
|
||||
label: "代理地址",
|
||||
kind: "url",
|
||||
placeholder: "http://127.0.0.1:7890",
|
||||
hint: "只对开了「使用代理」的站点生效;留空不用代理",
|
||||
wide: true,
|
||||
},
|
||||
],
|
||||
fromSettings: (s) => ({
|
||||
"sites.userAgent": s.sites.userAgent,
|
||||
"sites.proxyUrl": s.sites.proxyUrl ?? "",
|
||||
}),
|
||||
toPatch: (v) => ({
|
||||
sites: {
|
||||
// 空串 = 跟随浏览器(要能清空,不能用 undefined 表示"不改")
|
||||
userAgent: str(v["sites.userAgent"]),
|
||||
proxyUrl: str(v["sites.proxyUrl"]) || null,
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
export function SitesSection() {
|
||||
return (
|
||||
<div className="grid grid-cols-1 gap-8">
|
||||
<div className="pg-slab flex flex-wrap items-center justify-between gap-3 rounded-xl px-4 py-3">
|
||||
<p className="text-caption text-muted-foreground">
|
||||
站点和凭证在「站点」页管理;单个站点的限流、周期、代理在站点的"编辑"里改。
|
||||
站点、凭证和 Cloudflare 验证在「站点」页管理;单个站点的限流、周期、代理在站点的「编辑」里改。
|
||||
</p>
|
||||
<Button asChild size="sm" variant="outline">
|
||||
<Link to={consolePath("sites")}>
|
||||
@@ -119,7 +133,14 @@ export function SitesSection() {
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
<SettingsGate>{(s) => <SettingsCard section="sites" spec={DEFAULTS_CARD} settings={s} />}</SettingsGate>
|
||||
<SettingsGate>
|
||||
{(s) => (
|
||||
<>
|
||||
<SettingsCard section="sites" spec={DEFAULTS_CARD} settings={s} />
|
||||
<SettingsCard section="sites" spec={NETWORK_CARD} settings={s} />
|
||||
</>
|
||||
)}
|
||||
</SettingsGate>
|
||||
<BrowserProvidersBlock />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user