Peach: Local-first video metadata scraper and media manager.
feat(setup): 首次设置保存 Peach 代理并说明采集工具自动准备
longmeidaoa8702651d317
diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.mdindex 5e9f3920e..e45d163cb 100644--- a/docs/OPERATIONS.md+++ b/docs/OPERATIONS.md@@ -545,6 +545,8 @@ Peach 配置「媒体库与入库 → 视频预览」中的「抽帧解码方式### 首次设置的内部流程+- 首次设置的「Peach 代理」支持跟随环境、直连和自定义 HTTP/SOCKS 代理。自定义地址与端口沿用配置页校验,凭据存于所选数据目录的本机 secrets;读题接口只返回连接方式和是否已保存地址。Docker 中填写回环代理地址时提示改用容器可访问的宿主机地址。配置页「网络与访问」可随时修改。+- `GET /api/setup/questions` 的 `peach_proxy` 包含 `mode`、`proxy_saved`、`needs_selection`;`docker` 表示部署是否为 Docker。`POST /api/setup` 的 `peach_proxy` 接收 `{mode, proxy}`,`mode` 为 `environment`、`direct` 或 `proxy`,缺省为 `environment`。校验错误放在 `errors.peach_proxy`。代理先于 `config.toml` 和首扫请求落盘,保证托盘切换后使用所选连接方式。- 托盘启动时读一次设置文件,由 `tray.needs_setup()` 判断:**没有 `config.toml` 且没有数据库**才算需要首次设置。不用 `PeachConfig.configured` 判断:托盘的单实例锁一启动就会在 Peach 数据目录下建出 `state/`,一次失败的启动就可能让下一次误判成已配置;反过来,没有 `config.toml` 的老部署数据库还在,不能被拖进首次设置。- 需要设置时,托盘不构建正常的服务规格(全新机器上 `build_service_specs()` 会因为缺 TLS 材料抛 `FileNotFoundError`),而是启动 `peach serve --setup --host 127.0.0.1 --port <设置里的端口,默认 8900> --no-mdns --no-ledger-sync`,再把浏览器打开到 `http://127.0.0.1:<端口>/`。这条引导服务没有 TLS,口令强制为空,安全边界就是回环绑定地址。- 首页是首次设置表单:`GET /` 回一张薄壳(`routes_pages.setup_shell()`),表单由页面包 `/dist/peach-pages.js` 画出,题目与提交都走下面两条 JSON 接口。完成态的入口带 `/?onboarding=1`;选了导入浏览器历史则先去 `/taste?onboarding=1`。安装教程通过专用状态接口读取各项的实际状态。diff --git a/frontend/e2e/setup.test.ts b/frontend/e2e/setup.test.tsindex 9527c50bc..373281fd1 100644--- a/frontend/e2e/setup.test.ts+++ b/frontend/e2e/setup.test.ts@@ -58,6 +58,15 @@ describe('首次运行页', { skip: origin && media && dataRoot ? false : '只await page.getByRole('button', { name: '选择数据目录' }).waitFor({ state: 'visible' });assert.deepEqual((await layout(page)).offenders, []);+ await page.locator('[aria-labelledby="setup-proxy-title"] button[aria-haspopup="listbox"]').click();+ await page.getByRole('option', { name: '自定义', exact: true }).click();+ const proxy = page.getByLabel('代理地址', { exact: true });+ await proxy.fill('http://proxy.invalid');+ const mobileForm = VIEWPORTS.find((candidate) => candidate.name === 'mobile')!;+ await page.setViewportSize({ width: mobileForm.width, height: mobileForm.height });+ assert.deepEqual((await layout(page)).offenders, []);+ await page.setViewportSize({ width: viewport.width, height: viewport.height });+// React Aria 的原生 input 是视觉隐藏的,点击落在外面那层画出来的开关上,所以按状态设值。await page.getByRole('switch', { name: '访问密码' }).setChecked(false, { force: true });await page.getByRole('checkbox', { name: /^完成设置后扫描/ }).setChecked(false, { force: true });@@ -86,6 +95,9 @@ describe('首次运行页', { skip: origin && media && dataRoot ? false : '只await port.waitFor({ state: 'visible' });assert.equal(await port.getAttribute('aria-invalid'), 'true');assert.equal(await port.inputValue(), '70000');+ assert.equal(await proxy.getAttribute('aria-invalid'), 'true');+ assert.equal(await proxy.inputValue(), 'http://proxy.invalid');+ await page.getByText('请填写带端口的 HTTP 或 SOCKS 代理地址', { exact: true }).waitFor({ state: 'visible' });await page.getByText(/目录不存在/).first().waitFor({ state: 'visible' });await page.getByText('端口要是 1 到 65535 之间的整数').waitFor({ state: 'visible' });await page.waitForFunction(() => document.activeElement?.getAttribute('aria-label') === '媒体库 1');@@ -93,6 +105,7 @@ describe('首次运行页', { skip: origin && media && dataRoot ? false : '只// 改对:已有目录、默认端口,不扫描。await folder.fill(media);await port.fill(defaultPort);+ await proxy.fill('socks5h://user:[email protected]:17890');const selectedData = join(dataRoot, 'custom-data');await page.locator('#f-data_root').fill(selectedData);const accepted = page.waitForResponse((response) => response.url().endsWith('/api/setup')@@ -100,9 +113,13 @@ describe('首次运行页', { skip: origin && media && dataRoot ? false : '只await page.getByRole('button', { name: '完成设置' }).click();const acceptedResponse = await accepted;assert.equal(acceptedResponse.status(), 200, await acceptedResponse.text());+ assert.deepEqual(JSON.parse(await readFile(join(selectedData, 'secrets/follow/peach-proxy.json'), 'utf8')), {+ mode: 'proxy', proxy: 'socks5h://user:[email protected]:17890',+ });// 完成态:入口链接拿到焦点,扫描没有排队,运行信息收起,口令不在页面上。await page.getByRole('heading', { name: '设置完成' }).waitFor({ state: 'visible' });+ assert.equal((await page.content()).includes('private-proxy'), false);const entry = page.getByRole('link', { name: '进入 Peach' });await entry.waitFor({ state: 'visible' });assert.ok(await entry.evaluate((element) => element === document.activeElement), '入口链接拿到焦点');diff --git a/frontend/src/react/pages/setup/setup-api.ts b/frontend/src/react/pages/setup/setup-api.tsindex 5efcd01a6..b9dc529b8 100644--- a/frontend/src/react/pages/setup/setup-api.ts+++ b/frontend/src/react/pages/setup/setup-api.ts@@ -27,6 +27,8 @@ export interface SetupQuestion {export interface MountDependency { name: string; message: string; download_url: string; download_label: string }export interface SetupQuestions {+ peach_proxy?: import('../../bundle').PeachProxyState;+ docker?: boolean;remote_reporting?: import('../../settings/remote-reporting-settings').RemoteReportingState;windows: boolean;standalone: boolean;diff --git a/frontend/src/react/pages/setup/setup-form.tsx b/frontend/src/react/pages/setup/setup-form.tsxindex 9938794c2..4c7bcf527 100644--- a/frontend/src/react/pages/setup/setup-form.tsx+++ b/frontend/src/react/pages/setup/setup-form.tsx@@ -17,6 +17,7 @@ import { Switch } from '@/components/base/switch/switch';import { Select, SelectItem } from '@/components/base/select/select';import { randomId } from '../../../core/random-id';+import { Note } from '../../components/note';import { SEGMENT, SEGMENTED_TRACK, SegmentedRadioGroup } from '../../components/segmented';import { busyProps } from '../../settings/busy-props';import {@@ -25,6 +26,7 @@ import {} from '../../settings/folder-rows';import { libraryAutoChoice } from '../../settings/library-icon-picker';import { PasswordPair } from '../../settings/password-pair';+import { isLoopbackProxy, ProxyAddressField, ProxyModeSelect } from '../../settings/peach-proxy-fields';import { ReportingChoices } from '../../settings/remote-reporting-settings';import { Disclosure, ErrorText, ExternalLink, Help, SourceMark } from '../../settings/section';import { CardGroup, GroupTitle } from '../auth-card';@@ -73,6 +75,8 @@ export function SetupForm({ setup, onDone }: { setup: SetupQuestions; onDone: (dconst [scanNow, setScanNow] = useState(setup.scan_now);const [historyGuide, setHistoryGuide] = useState(setup.history_guide);const [reporting, setReporting] = useState(setup.remote_reporting);+ const [proxyMode, setProxyMode] = useState(setup.peach_proxy?.mode ?? 'environment');+ const [proxyAddress, setProxyAddress] = useState('');const [errors, setErrors] = useState<SetupErrors>({});const [tableError, setTableError] = useState('');const [failure, setFailure] = useState('');@@ -111,6 +115,7 @@ export function SetupForm({ setup, onDone }: { setup: SetupQuestions; onDone: (dsetFailure('');const submission: SetupSubmission = {media_dir: folders.rows, access_enabled: accessOn, scan_now: scanNow, history_guide: historyGuide,+ peach_proxy: { mode: proxyMode, proxy: proxyMode === 'proxy' ? proxyAddress : '' },...(reporting ? { remote_reporting: { usage: reporting.usage, errors: reporting.errors } } : {}),};// 隐藏的题不提交,服务端按题目默认值补上。@@ -285,6 +290,25 @@ export function SetupForm({ setup, onDone }: { setup: SetupQuestions; onDone: (d: null}</CardGroup>+ <CardGroup labelledBy="setup-proxy-title">+ <GroupTitle id="setup-proxy-title">Peach 代理</GroupTitle>+ <Help>用于资料采集、封面和工具下载,可在配置页修改。</Help>+ <div className="flex flex-col items-start gap-1.5">+ <Label elementType="span" id="setup-proxy-mode-label">连接方式</Label>+ <ProxyModeSelect mode={proxyMode} onChange={setProxyMode} labelledBy="setup-proxy-mode-label" />+ </div>+ {proxyMode === 'proxy'+ ? <ProxyAddressField id="setupProxyAddress" value={proxyAddress} onChange={setProxyAddress}+ saved={setup.peach_proxy?.proxy_saved} error={announce(text(errors.peach_proxy))} />+ : errors.peach_proxy ? <ErrorText key={errorRound}>{text(errors.peach_proxy)}</ErrorText> : null}+ {setup.docker && proxyMode === 'proxy' && isLoopbackProxy(proxyAddress)+ ? <Note tone="warning" title="请填写容器可访问的代理地址">回环地址指向容器自身;宿主机代理需使用容器可访问的宿主机地址。</Note>+ : null}+ {setup.peach_proxy?.needs_selection+ ? <Note tone="warning" title="需要选择连接方式">已有来源的代理地址不同,请选择公共连接方式。</Note>+ : null}+ </CardGroup>+<CardGroup><Disclosure key={advancedOpenings} summary="高级设置" defaultOpen={advancedOpenings > 0}><div className="flex flex-col gap-4">{others.filter(visible).map(field)}</div>diff --git a/frontend/src/react/scraping/scraping-page.tsx b/frontend/src/react/scraping/scraping-page.tsxindex 608568ee7..bf0cb748f 100644--- a/frontend/src/react/scraping/scraping-page.tsx+++ b/frontend/src/react/scraping/scraping-page.tsx@@ -325,8 +325,8 @@ function AmaneBridgeCard({ toast }: ScrapingProps) {{data.problem? <Note tone="error">{data.problem}</Note>: <Help>- 已安装版本:{data.installed_version || '未安装'}。amane({data.license})提供这些内置站点的解析能力。- 重新安装会使用 Peach 内置的 {data.version} 版本,不随上游自动升级。+ amane({data.license})提供这些内置站点的解析能力。首次需要时,Peach 会自动准备锁定的 {data.version} 版本;安装包内已有可用环境时直接使用。+ 手动安装也使用此版本,不随上游自动升级。</Help>}{running ? <LoadingDots label="正在重建运行环境" /> : null}{problem ? <Note tone="error">{problem}</Note> : null}diff --git a/frontend/src/react/settings/network-settings.tsx b/frontend/src/react/settings/network-settings.tsxindex 4ddf021fb..724768158 100644--- a/frontend/src/react/settings/network-settings.tsx+++ b/frontend/src/react/settings/network-settings.tsx@@ -3,8 +3,6 @@ import { useState, type FormEvent } from 'react';import { SettingsRow } from '@/components/application/settings/settings-rows';import { Button } from '@/components/base/buttons/button';-import { Input } from '@/components/base/input/input';-import { Select, SelectItem } from '@/components/base/select/select';import { apiSend } from '../../api';import type { ConfigurationGroupProps, PeachProxyState } from '../bundle';@@ -12,12 +10,11 @@ import { Note } from '../components/note';import { AccessSettings } from './access-settings';import { groupRoot } from './configuration-panel';import { PortSettings } from './port-settings';+import { ProxyAddressField, ProxyModeSelect } from './peach-proxy-fields';import { TunnelSettings } from './tunnel-settings';import { ErrorText, Footer, Rows, Section, Stack } from './section';import { busyProps, useAction } from './use-action';-const PROXY_MODES = [['environment', '系统代理'], ['direct', '直连'], ['proxy', '自定义']] as const;-export function NetworkSettings({ data, receipt, panel }: ConfigurationGroupProps) {return (<div {...groupRoot(panel)}>@@ -45,16 +42,13 @@ export function PeachProxy({ initial, receipt }: { initial: PeachProxyState; rec<Section id="peachProxy" title="Peach 代理" onSubmit={submit}><Rows><SettingsRow label="连接方式">- <Select aria-label="连接方式" selectedKey={mode} onSelectionChange={(key) => { if (key !== null) setMode(String(key)); }}>- {PROXY_MODES.map(([key, name]) => <SelectItem key={key} id={key}>{name}</SelectItem>)}- </Select>+ <ProxyModeSelect mode={mode} onChange={setMode} /></SettingsRow></Rows>{mode === 'proxy' || saved.needs_selection || action.error ? (<Stack divided>{mode === 'proxy'- ? <Input id="peachProxyAddress" type="password" label="代理地址" autoComplete="off" value={address} onChange={setAddress}- placeholder={saved.proxy_saved ? '已保存,留空保留' : 'http://127.0.0.1:7890'} />+ ? <ProxyAddressField id="peachProxyAddress" value={address} onChange={setAddress} saved={saved.proxy_saved} />: null}{saved.needs_selection ? <Note tone="warning" title="需要选择连接方式">已有来源的代理地址不同,请选择公共连接方式。</Note> : null}{action.error ? <ErrorText>{action.error}</ErrorText> : null}diff --git a/frontend/src/react/settings/peach-proxy-fields.tsx b/frontend/src/react/settings/peach-proxy-fields.tsxnew file mode 100644index 000000000..bd0273449--- /dev/null+++ b/frontend/src/react/settings/peach-proxy-fields.tsx@@ -0,0 +1,33 @@+/* 首次设置与配置页共用的代理输入。地址只由用户输入,服务端状态不回传凭据。 */+import type { ReactNode } from 'react';++import { Input } from '@/components/base/input/input';+import { Select, SelectItem } from '@/components/base/select/select';++const PROXY_MODES = [['environment', '跟随环境'], ['direct', '直连'], ['proxy', '自定义']] as const;++export function ProxyModeSelect({ mode, onChange, labelledBy }: {+ mode: string; onChange(mode: string): void; labelledBy?: string;+}) {+ return <Select aria-label={labelledBy ? undefined : '连接方式'} aria-labelledby={labelledBy} selectedKey={mode}+ onSelectionChange={(key) => { if (key !== null) onChange(String(key)); }}>+ {PROXY_MODES.map(([key, name]) => <SelectItem key={key} id={key}>{name}</SelectItem>)}+ </Select>;+}++export function ProxyAddressField({ id, value, onChange, saved = false, error }: {+ id: string; value: string; onChange(value: string): void; saved?: boolean; error?: ReactNode;+}) {+ return <Input id={id} type="password" label="代理地址" autoComplete="off" spellCheck="false"+ value={value} onChange={onChange} placeholder={saved ? '已保存,留空保留' : 'http://127.0.0.1:7890'}+ validationBehavior="aria" isInvalid={Boolean(error)} hint={error} />;+}++export function isLoopbackProxy(address: string): boolean {+ try {+ const hostname = new URL(address).hostname;+ return ['localhost', '[::1]', '::1'].includes(hostname) || /^127\./.test(hostname);+ } catch {+ return false;+ }+}diff --git a/frontend/test/react/scraping.test.tsx b/frontend/test/react/scraping.test.tsxindex 3e3f61487..7b574e39e 100644--- a/frontend/test/react/scraping.test.tsx+++ b/frontend/test/react/scraping.test.tsx@@ -112,6 +112,8 @@ it('首屏用 prefetch 缓存画出来源与任务,挂载时不重复请求',expect(bridge).not.toBeNull();expect(bridge?.textContent).toContain('已安装版本0.16.1');expect(bridge?.textContent).toContain('FC2PPVDB、AVSOX');+ expect(bridge?.textContent).toContain('首次需要时,Peach 会自动准备锁定的 0.16.1 版本');+ expect(bridge?.textContent).toContain('安装包内已有可用环境时直接使用');expect(buttonNamed('重新安装', bridge!)).not.toBeNull();// 连接方式是 BoardUI 的 Select,画出来的是按钮;原生 select 是 React Aria 藏在后面// 供表单取值的那一个,不是这一行的长相。diff --git a/frontend/test/react/setup-page.test.tsx b/frontend/test/react/setup-page.test.tsxindex 27afec15b..57a9c464a 100644--- a/frontend/test/react/setup-page.test.tsx+++ b/frontend/test/react/setup-page.test.tsx@@ -32,6 +32,8 @@ const questions = (over: Partial<SetupQuestions> = {}): SetupQuestions => ({access_enabled: true,scan_now: true,history_guide: false,+ peach_proxy: { mode: 'environment', proxy_saved: false, needs_selection: false },+ docker: false,...over,});@@ -148,6 +150,53 @@ describe('访问密码', () => {});});+describe('Peach 代理', () => {+ const proxyMode = (host: ParentNode) => host.querySelector('[aria-labelledby="setup-proxy-title"] [aria-haspopup="listbox"]');++ it('跟随环境为初始值,自定义地址随设置提交,直连不携带隐藏地址', async () => {+ const { host, sent } = await open({}, { [SETUP_URL]: { status: 400, body: { error: '稍后重试' } } });+ expect(proxyMode(host)?.textContent).toContain('跟随环境');+ expect(host.querySelector('#setupProxyAddress')).toBeNull();+ await submitForm(host);+ expect(sent(SETUP_URL).peach_proxy).toEqual({ mode: 'environment', proxy: '' });+ await choose(proxyMode(host), '自定义');+ const address = host.querySelector<HTMLInputElement>('#setupProxyAddress');+ expect(address?.type).toBe('password');+ await type(address, 'socks5h://user:[email protected]:7890');+ await submitForm(host);+ expect(sent(SETUP_URL, 1).peach_proxy).toEqual({ mode: 'proxy', proxy: 'socks5h://user:[email protected]:7890' });+ await choose(proxyMode(host), '直连');+ expect(host.querySelector('#setupProxyAddress')).toBeNull();+ await submitForm(host);+ expect(sent(SETUP_URL, 2).peach_proxy).toEqual({ mode: 'direct', proxy: '' });+ });++ it('代理地址校验原位报错并保留输入', async () => {+ const message = '请填写带端口的 HTTP 或 SOCKS 代理地址';+ const { host } = await open({ peach_proxy: { mode: 'proxy', proxy_saved: true, needs_selection: false } },+ { [SETUP_URL]: { status: 400, body: { error: '有几项需要修改', errors: { peach_proxy: message } } } });+ const address = host.querySelector<HTMLInputElement>('#setupProxyAddress');+ expect(address?.placeholder).toBe('已保存,留空保留');+ await type(address, 'http://proxy.invalid');+ await submitForm(host);+ expect(address?.value).toBe('http://proxy.invalid');+ expectAnnounced(host, address, message);+ expect(document.activeElement).toBe(address);+ });++ it.each([true, false])('Docker 回环提示只适用于容器中的自定义回环地址:%s', async (docker) => {+ const { host } = await open({ docker });+ await choose(proxyMode(host), '自定义');+ const address = host.querySelector<HTMLInputElement>('#setupProxyAddress');+ await type(address, 'http://127.0.0.1:7890');+ expect(host.textContent?.includes('回环地址指向容器自身')).toBe(docker);+ await type(address, 'http://host.docker.internal:7890');+ expect(host.textContent).not.toContain('回环地址指向容器自身');+ await choose(proxyMode(host), '跟随环境');+ expect(host.textContent).not.toContain('回环地址指向容器自身');+ });+});+describe('媒体库', () => {it('首次设置网盘时必须明确选择读取策略', async () => {const { host, sent } = await open({}, { [SETUP_URL]: { status: 200, body: done() } });diff --git a/src/peach/onboarding.py b/src/peach/onboarding.pyindex c362eaacf..6c4468335 100644--- a/src/peach/onboarding.py+++ b/src/peach/onboarding.py@@ -445,7 +445,7 @@ def create_data_tree(config: PeachConfig) -> DataTree:def apply(config: PeachConfig, answers: Answers, *, windows: bool, force: bool = False,- access_password: str = "",+ access_password: str = "", peach_proxy_values: dict | None = None,) -> Applied:"""把答案变成一台可以直接起服务的机器:目录、账本、CA、口令、设置文件。@@ -458,6 +458,9 @@ def apply(access_path = prepared.directory("secrets") / "access.json"if not config.present and not access_path.exists():access.save(access_path, access_password)+ if peach_proxy_values is not None:+ from . import peach_proxy+ peach_proxy.save(prepared.directory("secrets"), peach_proxy_values)path = settings_file.write(prepared, force=force)return Applied(config=prepared, settings_path=path, tree=tree)diff --git a/src/peach/peach_proxy.py b/src/peach/peach_proxy.pyindex cb3747616..3dd96a4b2 100644--- a/src/peach/peach_proxy.py+++ b/src/peach/peach_proxy.py@@ -33,9 +33,12 @@ def describe(root: Path) -> dict:"needs_selection": bool(saved.get("conflict"))}-def save(root: Path, body: dict) -> dict:+def validate(root: Path, body: object) -> dict:+ """校验连接方式与地址;凭据只留在返回给保存流程的值中。"""+ if not isinstance(body, dict):+ raise ValueError("请选择 Peach 代理的连接方式")mode = body.get("mode")- if mode not in {"environment", "direct", "proxy"}:+ if not isinstance(mode, str) or mode not in {"environment", "direct", "proxy"}:raise ValueError("请选择 Peach 代理的连接方式")address = body.get("proxy") or values(root).get("proxy", "")if not isinstance(address, str):@@ -50,8 +53,13 @@ def save(root: Path, body: dict) -> dict:valid = Falseif not valid or any(char.isspace() for char in address):raise ValueError("请填写带端口的 HTTP 或 SOCKS 代理地址")+ return {"mode": mode, "proxy": address if mode == "proxy" else ""}+++def save(root: Path, body: dict) -> dict:+ checked = validate(root, body)path = CredentialStore(root).path_for("peach-proxy")- atomic_write_text(path, json.dumps({"mode": mode, "proxy": address if mode == "proxy" else ""}), mode=0o600)+ atomic_write_text(path, json.dumps(checked), mode=0o600)return describe(root)diff --git a/src/peach/routes_pages.py b/src/peach/routes_pages.pyindex 46bd22b98..75de90e9a 100644--- a/src/peach/routes_pages.py+++ b/src/peach/routes_pages.py@@ -297,7 +297,10 @@ def index(request: Request, args: dict[str, str] = Depends(require_page_auth)):return responseif not settings.configured:# 未配置不是错误状态:服务照常起,首页(和任何前端路由的深链)变成首次运行页。- response = HTMLResponse(setup_shell())+ html = setup_shell()+ if "edit" in request.query_params and _copy_editor_available():+ html = _with_copy_editor(html)+ response = HTMLResponse(html)response.headers["Cache-Control"] = "no-store"return responseif not settings.page_path.is_file():@@ -311,8 +314,7 @@ def index(request: Request, args: dict[str, str] = Depends(require_page_auth)):script = f'<script type="application/json" id="peach-entity-shape">{payload}</script>'html = html.replace("</head>", script + "</head>", 1) if "</head>" in html else html + scriptif editor:- html = html.replace("<body", '<body data-peach-copy-mode="source"', 1)- html = html.replace("</body>", '<script src="/dev/copy-editor-core.js" defer></script><script src="/dev/copy-editor.js" defer></script></body>')+ html = _with_copy_editor(html)response = HTMLResponse(html)else:response = FileResponse(settings.page_path, media_type="text/html")@@ -326,6 +328,11 @@ def _copy_editor_available() -> bool:"scripts/dev/copy-editor.js", "frontend/src/copy-editor-core.js"))+def _with_copy_editor(html: str) -> str:+ html = html.replace("<body", '<body data-peach-copy-mode="source"', 1)+ return html.replace("</body>", '<script src="/dev/copy-editor-core.js" defer></script><script src="/dev/copy-editor.js" defer></script></body>')++def _require_copy_editor():if not _copy_editor_available():raise HTTPException(404, "missing")@@ -428,7 +435,7 @@ def setup_questions(request: Request):只是不看 Origin:配置完成后这里 404,运行事实不再对外。"""_setup_guard(request, submit=False)- from . import remote_reporting+ from . import peach_proxy, remote_reportingwindows = os.name == "nt"asked = onboarding.questions(settings_file.active(), windows=windows)host_labels = dict(onboarding.HOST_OPTIONS)@@ -466,6 +473,8 @@ def setup_questions(request: Request):"access_enabled": _access_on_by_default(asked),"scan_now": True,"history_guide": False,+ "peach_proxy": peach_proxy.describe(settings_file.active().directory("secrets")),+ "docker": os.environ.get("PEACH_DISTRIBUTION") == "docker","remote_reporting": remote_reporting.snapshot(),})@@ -531,6 +540,16 @@ async def setup_submit_json(request: Request):except ValueError as exc:errors["access_password"] = str(exc)standalone = distribution.standalone()+ from . import peach_proxy+ proxy_values = None+ proxy_root = settings_file.active().directory("secrets")+ if answers is not None:+ resolved, _broken = onboarding.resolve_config(answers.data_root)+ proxy_root = resolved.directory("secrets")+ try:+ proxy_values = peach_proxy.validate(proxy_root, body.get("peach_proxy", {"mode": "environment"}))+ except ValueError as exc:+ errors["peach_proxy"] = str(exc)if standalone and answers is not None:try:onboarding.check_available_port(answers.port, request.url.port or 80)@@ -543,7 +562,8 @@ async def setup_submit_json(request: Request):if resolved.path.exists():raise HTTPException(status_code=409, detail="settings file already exists")try:- applied = onboarding.apply(resolved, answers, windows=windows, access_password=password)+ applied = onboarding.apply(resolved, answers, windows=windows, access_password=password,+ peach_proxy_values=proxy_values)settings_file.remember_data_root(settings_file.active(), applied.config)except (OSError, RuntimeError) as exc:errors = {"data_root": str(exc)}diff --git a/tests/test_onboarding.py b/tests/test_onboarding.pyindex 7b20fe526..6e00bf0a1 100644--- a/tests/test_onboarding.py+++ b/tests/test_onboarding.py@@ -505,6 +505,70 @@ class SetupJsonContractTests(_SetupHttpCase):self.assertEqual(response.status_code, 400)self.assertFalse((self.data_root / "config.toml").exists())+ def test_proxy_questions_expose_status_without_credentials_and_detect_docker(self):+ from peach import peach_proxy+ peach_proxy.save(self.config.directory("secrets"), {+ "mode": "proxy", "proxy": "http://user:[email protected]:7890"})+ with mock.patch.dict(os.environ, {"PEACH_DISTRIBUTION": "docker"}):+ response = self._send("GET", self.QUESTIONS)+ self.assertEqual(response.json()["peach_proxy"], {+ "mode": "proxy", "proxy_saved": True, "needs_selection": False})+ self.assertTrue(response.json()["docker"])+ self.assertNotIn("private-password", response.text)+ with mock.patch.dict(os.environ, {"PEACH_DISTRIBUTION": "source"}):+ self.assertFalse(self._send("GET", self.QUESTIONS).json()["docker"])++ def test_proxy_validation_collects_field_errors_without_creating_data(self):+ for proxy in ([], {"mode": []}, {"mode": "unknown"}, {"mode": "proxy", "proxy": "http://user:secret@host"},+ {"mode": "proxy", "proxy": "ftp://host:1234"}):+ with self.subTest(proxy=proxy):+ errors = self._errors(self._body(peach_proxy=proxy, port="0"))+ self.assertEqual(set(errors), {"peach_proxy", "port"})+ self.assertNotIn("secret", str(errors))+ self.assertFalse(self.data_root.exists())++ def test_proxy_is_saved_in_the_selected_data_root_before_settings_and_first_scan(self):+ from peach import peach_proxy+ selected = self.root / "selected-data"+ address = "socks5h://user:[email protected]:7890"+ original_write = settings_file.write+ original_scan = onboarding.request_first_scan+ seen = []++ def write(config, **kwargs):+ self.assertEqual(peach_proxy.client_options(config.directory("secrets")), {+ "trust_env": False, "proxy": address})+ seen.append("settings")+ return original_write(config, **kwargs)++ def scan(config, location):+ self.assertEqual(peach_proxy.client_options(config.directory("secrets")), {+ "trust_env": False, "proxy": address})+ seen.append("scan")+ return original_scan(config, location)++ with mock.patch.object(settings_file, "write", side_effect=write), \+ mock.patch.object(onboarding, "request_first_scan", side_effect=scan):+ result = self._submit(data_root=str(selected), peach_proxy={"mode": "proxy", "proxy": address})+ self.assertEqual(seen, ["settings", "scan"])+ self.assertNotIn("private-password", str(result))+ self.assertFalse((self.config.directory("secrets") / "follow/peach-proxy.json").exists())++ def test_proxy_modes_and_omitted_choice_are_saved_without_an_address(self):+ from peach import peach_proxy+ for mode in ("environment", "direct", None):+ with self.subTest(mode=mode):+ selected = self.root / str(mode)+ self._submit(data_root=str(selected), scan_now=False,+ peach_proxy={"mode": mode, "proxy": "http://user:[email protected]:7890"} if mode else None)+ self.assertEqual(peach_proxy.values(selected / "secrets"), {"mode": mode or "environment", "proxy": ""})++ def test_proxy_save_failure_does_not_publish_settings_or_scan_request(self):+ with mock.patch("peach.peach_proxy.save", side_effect=OSError("代理配置写入失败")):+ self.assertEqual(self._errors(self._body(peach_proxy={"mode": "direct"})), {+ "data_root": "代理配置写入失败"})+ self.assertFalse((self.data_root / "state" / onboarding.SCAN_REQUEST_NAME).exists())+def test_the_first_run_page_is_a_shell_around_the_standalone_page_bundle(self):"""首次运行页由独立页面包画:薄壳只带主题预读、样式、脚本、借来的字形与挂载点。"""response = self._get("/")@@ -523,6 +587,15 @@ class SetupJsonContractTests(_SetupHttpCase):with self.subTest(path):self.assertEqual(self._get(path).status_code, 200)+ def test_the_setup_edit_preview_uses_the_shared_source_editor(self):+ plain = self._get("/").text+ editable = self._get("/?edit").text+ self.assertNotIn('data-peach-copy-mode="source"', plain)+ self.assertIn('data-peach-copy-mode="source"', editable)+ for path in ("/dev/copy-editor.js", "/dev/copy-editor-core.js"):+ self.assertIn(path, editable)+ self.assertEqual(self._get(path).status_code, 200)+def test_invalid_values_are_reported_without_creating_anything(self):missing = self.root / "nope"errors = self._errors(self._body(media_dir=self._rows(missing), port="0"))diff --git a/web/dist/peach-app.configuration-page-Bxq5ZZc_.js b/web/dist/peach-app.configuration-page-HbZ3QpMI.jssimilarity index 97%rename from web/dist/peach-app.configuration-page-Bxq5ZZc_.jsrename to web/dist/peach-app.configuration-page-HbZ3QpMI.jsindex 40de2e171..21bbf5b8f 100644--- a/web/dist/peach-app.configuration-page-Bxq5ZZc_.js+++ b/web/dist/peach-app.configuration-page-HbZ3QpMI.js@@ -1,7 +1,7 @@(function() {try {var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "78aa664a-ede9-4231-94fa-85a243e03341", e._sentryDebugIdIdentifier = "sentry-dbid-78aa664a-ede9-4231-94fa-85a243e03341");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "8e3938fd-656e-4cc3-a400-8dcdc5460af2", e._sentryDebugIdIdentifier = "sentry-dbid-8e3938fd-656e-4cc3-a400-8dcdc5460af2");} catch {}})();import { $2ec61d1d4f780267$export$a8a3e93435678ff9 as e, $3a442827418ebe87$export$eb2fcfdbd7ba97d4 as t, $542a13ca2fa5b484$export$5b6b19405a83ff9d as n, $72abaeab4d80592f$export$78efe591171d7d45 as r, $bd263d78e9bf3c56$export$f5c9f3c2c4054eec as i, $ea3928288112382f$export$439d29a4e110a164 as a, $f2ff30fde7b014be$export$3ddf2d174ce01153 as o, $fe21c36db05242bb$export$a98f0dcb43a68a25 as s, $fe21c36db05242bb$export$d7b12c4107be0d61 as c, ACCENT_CHOICES as l, ApiError as u, Button as d, ButtonLink as f, CLOUD_LOCATIONS as p, CLOUD_PROXY_HELP as m, CONFIGURATION_KEY as h, CONFIGURATION_URL as g, CREDENTIAL_STATE as _, Checkbox as v, Chip as y, Disclosure as b, ENTRY_LINKS_HELP as x, ENTRY_LINKS_HINT as S, EmptyState as ee, ErrorText as C, ExternalLink as w, FEED_SCHEDULE_KEY as T, FOLLOW_CREDENTIALS_KEY as E, FOLLOW_INITIAL_RANGE_OPTIONS as te, FOLLOW_SCHEDULE_KEY as ne, Fact as D, FactList as O, FieldLabel as k, Footer as A, Help as j, HintText as re, Input as M, LIBRARY_FOLDER_HELP as ie, LIBRARY_PROCESSING_KEY as ae, Label as oe, LinkButton as se, LoadingDots as ce, M6 as le, MEDIA_PROCESSING_KEY as ue, MEDIA_PROCESSING_URL as de, MEDIA_SOURCE_ICONS as fe, MENU_POPOVER_SURFACE as pe, Note as N, PICK_FOLDER_URL as me, POLICY_COLUMNS as he, POLICY_COVER_NOTE as ge, POLICY_MATRIX as _e, POLICY_SUMMARY as ve, PathLine as ye, PillTabList as be, Progress as xe, Rows as P, SEGMENT as Se, SEGMENTED_TRACK as Ce, SETTINGS_KEY as we, SETTINGS_URL as Te, Section as F, SectionSkeleton as Ee, SegmentedRadioGroup as De, Select as Oe, Select$1 as I, SelectItem as L, SettingsCard as ke, SettingsRow as R, SiteLabel as Ae, SourceLabel as z, SourceMark as je, Stack as B, StatusLabel as V, Switch as H, THUMBNAIL_JOBS_KEY as Me, TextField as Ne, TextFieldContext as Pe, __toESM as Fe, apiGet as U, apiSend as W, appSettingsStore as Ie, boundedPreference as Le, busyProps as G, cardClass as Re, cloudProxySkeleton as ze, cn as Be, confirmModal as Ve, credentialDone as He, credentialsSkeleton as Ue, cx as We, errorMessage as K, fetchConfiguration as Ge, fetchCredentials as Ke, fetchFeedSchedule as qe, fetchFollowSchedule as Je, fetchMediaProcessing as Ye, fetchSettings as Xe, fetchThumbnailJobs as Ze, fmtSize as Qe, indexersSkeleton as $e, javBrowserSkeleton as et, momentText as tt, overlayHost as nt, peachHistory$1 as rt, previewLibraryColor as it, providerIcon as at, queryClient as q, randomId as ot, rememberShape as J, require_jsx_runtime as st, require_react as ct, saveCredential as lt, schedulePollInterval as ut, settingsPath as dt, shellNavigate as ft, sortCx as pt, sourceDefaultCost as mt, useAction as Y, useLibraryTints as ht, useMutation as gt, useQuery as X, useRunSchedule as _t, useSaveFollowSchedule as vt, useSaveSettings as yt, useSaveThumbnailMode as bt } from "./peach-app.js";@@ -3192,12 +3192,48 @@ function xr({ data: e, receipt: t }) {});}//#endregion+//#region src/react/settings/peach-proxy-fields.tsx+var Sr = [+ ["environment", "跟随环境"],+ ["direct", "直连"],+ ["proxy", "自定义"]+];+function Cr({ mode: e, onChange: t, labelledBy: n }) {+ return /* @__PURE__ */ (0, $.jsx)(I, {+ "aria-label": n ? void 0 : "连接方式",+ "aria-labelledby": n,+ selectedKey: e,+ onSelectionChange: (e) => {+ e !== null && t(String(e));+ },+ children: Sr.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(L, {+ id: e,+ children: t+ }, e))+ });+}+function wr({ id: e, value: t, onChange: n, saved: r = !1, error: i }) {+ return /* @__PURE__ */ (0, $.jsx)(M, {+ id: e,+ type: "password",+ label: "代理地址",+ autoComplete: "off",+ spellCheck: "false",+ value: t,+ onChange: n,+ placeholder: r ? "已保存,留空保留" : "http://127.0.0.1:7890",+ validationBehavior: "aria",+ isInvalid: !!i,+ hint: i+ });+}+//#endregion//#region src/react/settings/tunnel-settings.tsx-var Sr = 2e3, Cr = [["quick", "临时链接"], ["named", "命名隧道"]], wr = {+var Tr = 2e3, Er = [["quick", "临时链接"], ["named", "命名隧道"]], Dr = {quick: "临时预览用,地址随机,重启后会变。启动前要先设置访问密码。",named: "使用你在 Cloudflare 绑定的固定域名。启动前要先设置访问密码。"};-function Tr({ revision: e, initial: t, receipt: n }) {+function Or({ revision: e, initial: t, receipt: n }) {let [r, i] = (0, Z.useState)(t), [a, o] = (0, Z.useState)(e), [s, l] = (0, Z.useState)(t.mode), [f, p] = (0, Z.useState)(t.hostname), [m, g] = (0, Z.useState)(""), [_, v] = (0, Z.useState)({}), y = Y(), b = r.state === "starting" || r.state === "running", x = r.named_available && s === "named";(0, Z.useEffect)(() => {if (r.state !== "starting") return;@@ -3205,7 +3241,7 @@ function Tr({ revision: e, initial: t, receipt: n }) {Ge(e.signal).then((t) => {!e.signal.aborted && t.tunnel && (q.setQueryData(h, t), i(t.tunnel), o(t.revision));}).catch(() => void 0);- }, Sr);+ }, Tr);return () => {e.abort(), window.clearInterval(t);};@@ -3241,13 +3277,13 @@ function Tr({ revision: e, initial: t, receipt: n }) {isDisabled: b,onChange: (e) => l(e),className: Ce,- children: Cr.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(c, {+ children: Er.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(c, {value: e,className: Se,children: t}, e))}) : null,- /* @__PURE__ */ (0, $.jsx)(j, { children: wr[x ? "named" : "quick"] }),+ /* @__PURE__ */ (0, $.jsx)(j, { children: Dr[x ? "named" : "quick"] }),x ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(M, {id: "tunnel-hostname",label: "公开主机名",@@ -3308,12 +3344,7 @@ function Tr({ revision: e, initial: t, receipt: n }) {}//#endregion//#region src/react/settings/network-settings.tsx-var Er = [- ["environment", "系统代理"],- ["direct", "直连"],- ["proxy", "自定义"]-];-function Dr({ data: e, receipt: t, panel: n }) {+function kr({ data: e, receipt: t, panel: n }) {return /* @__PURE__ */ (0, $.jsxs)("div", {...Q(n),children: [@@ -3321,7 +3352,7 @@ function Dr({ data: e, receipt: t, panel: n }) {data: e,receipt: t}) : null,- e.peach_proxy ? /* @__PURE__ */ (0, $.jsx)(Or, {+ e.peach_proxy ? /* @__PURE__ */ (0, $.jsx)(Ar, {initial: e.peach_proxy,receipt: t}) : null,@@ -3329,7 +3360,7 @@ function Dr({ data: e, receipt: t, panel: n }) {initial: e.access,receipt: t}) : null,- e.tunnel ? /* @__PURE__ */ (0, $.jsx)(Tr, {+ e.tunnel ? /* @__PURE__ */ (0, $.jsx)(Or, {revision: e.revision,initial: e.tunnel,receipt: t@@ -3337,7 +3368,7 @@ function Dr({ data: e, receipt: t, panel: n }) {]});}-function Or({ initial: e, receipt: t }) {+function Ar({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e), [i, a] = (0, Z.useState)(e.mode), [o, s] = (0, Z.useState)(""), c = Y();return /* @__PURE__ */ (0, $.jsxs)(F, {id: "peachProxy",@@ -3353,29 +3384,19 @@ function Or({ initial: e, receipt: t }) {children: [/* @__PURE__ */ (0, $.jsx)(P, { children: /* @__PURE__ */ (0, $.jsx)(R, {label: "连接方式",- children: /* @__PURE__ */ (0, $.jsx)(I, {- "aria-label": "连接方式",- selectedKey: i,- onSelectionChange: (e) => {- e !== null && a(String(e));- },- children: Er.map(([e, t]) => /* @__PURE__ */ (0, $.jsx)(L, {- id: e,- children: t- }, e))+ children: /* @__PURE__ */ (0, $.jsx)(Cr, {+ mode: i,+ onChange: a})}) }),i === "proxy" || n.needs_selection || c.error ? /* @__PURE__ */ (0, $.jsxs)(B, {divided: !0,children: [- i === "proxy" ? /* @__PURE__ */ (0, $.jsx)(M, {+ i === "proxy" ? /* @__PURE__ */ (0, $.jsx)(wr, {id: "peachProxyAddress",- type: "password",- label: "代理地址",- autoComplete: "off",value: o,onChange: s,- placeholder: n.proxy_saved ? "已保存,留空保留" : "http://127.0.0.1:7890"+ saved: n.proxy_saved}) : null,n.needs_selection ? /* @__PURE__ */ (0, $.jsx)(N, {tone: "warning",@@ -3395,11 +3416,11 @@ function Or({ initial: e, receipt: t }) {}//#endregion//#region src/react/follow-manage/credentials.tsx-var kr = "将清除这个来源在本机和共享副本中的登录凭据。", Ar = "其他系统用户可以读取此凭据文件。请在运行 Peach 的 Mac 或 Linux 电脑上,将文件权限设为仅当前用户可读写(0600)。";-function jr(e, t) {+var jr = "将清除这个来源在本机和共享副本中的登录凭据。", Mr = "其他系统用户可以读取此凭据文件。请在运行 Peach 的 Mac 或 Linux 电脑上,将文件权限设为仅当前用户可读写(0600)。";+function Nr(e, t) {return (e.shared_fields || []).includes(t) ? "来自共享,留空表示不改" : e.fields.includes(t) ? "已保存,留空表示不改" : "未填写";}-function Mr({ row: e }) {+function Pr({ row: e }) {if (He(e)) return /* @__PURE__ */ (0, $.jsx)(y, {variant: "caption",color: "lime",@@ -3412,7 +3433,7 @@ function Mr({ row: e }) {children: _[e.requirement] || ""});}-function Nr({ row: e, readOnly: t, toast: n }) {+function Fr({ row: e, readOnly: t, toast: n }) {let [r, i] = (0, Z.useState)({}), [a, o] = (0, Z.useState)(""), s = He(e), c = gt({mutationFn: (t) => lt(e.provider, t),onSuccess: (e, t) => {@@ -3439,7 +3460,7 @@ function Nr({ row: e, readOnly: t, toast: n }) {children: (e.needs || []).map((n) => /* @__PURE__ */ (0, $.jsx)(M, {type: "password",label: n,- placeholder: jr(e, n),+ placeholder: Nr(e, n),autoComplete: "off",spellCheck: "false",isDisabled: t,@@ -3459,7 +3480,7 @@ function Nr({ row: e, readOnly: t, toast: n }) {...G(c.isPending),onClick: () => void Ve({title: "清除来源凭据",- body: kr,+ body: jr,confirmLabel: "清除来源凭据",danger: !0,onConfirm: () => c.mutateAsync({})@@ -3486,7 +3507,7 @@ function Nr({ row: e, readOnly: t, toast: n }) {]});}-function Pr({ row: e, readOnly: t, toast: n }) {+function Ir({ row: e, readOnly: t, toast: n }) {let r = /* @__PURE__ */ (0, $.jsxs)("span", {className: "flex min-w-0 flex-wrap items-center gap-2",children: [@@ -3498,7 +3519,7 @@ function Pr({ row: e, readOnly: t, toast: n }) {className: "min-w-0 text-body-medium wrap-anywhere text-text-primary",children: e.provider_label}),- /* @__PURE__ */ (0, $.jsx)(Mr, { row: e }),+ /* @__PURE__ */ (0, $.jsx)(Pr, { row: e }),e.missing.map((e) => /* @__PURE__ */ (0, $.jsx)(y, {variant: "caption",color: "rose",@@ -3516,7 +3537,7 @@ function Pr({ row: e, readOnly: t, toast: n }) {/* @__PURE__ */ (0, $.jsx)(b, {summary: He(e) ? "修改凭据" : "填写凭据",defaultOpen: e.requirement === "required" && !He(e),- children: /* @__PURE__ */ (0, $.jsx)(Nr, {+ children: /* @__PURE__ */ (0, $.jsx)(Fr, {row: e,readOnly: t,toast: n@@ -3525,12 +3546,12 @@ function Pr({ row: e, readOnly: t, toast: n }) {e.world_readable ? /* @__PURE__ */ (0, $.jsx)(N, {tone: "error",title: "凭据文件权限过宽",- children: Ar+ children: Mr}) : null]});}-function Fr({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {+function Lr({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {let i = e.providers || [], a = i.filter((e) => e.requirement === "required" && !He(e));if ((0, Z.useEffect)(() => {J("credentials", { done: i.filter(He).map((e) => e.provider) });@@ -3568,7 +3589,7 @@ function Fr({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {padding: "none",className: "flex flex-col overflow-hidden"}),- children: e.rows.map((e) => /* @__PURE__ */ (0, $.jsx)(Pr, {+ children: e.rows.map((e) => /* @__PURE__ */ (0, $.jsx)(Ir, {row: e,readOnly: t,toast: n@@ -3598,7 +3619,7 @@ function Fr({ data: e, readOnly: t, toast: n, embedded: r = !1 }) {}//#endregion//#region src/react/settings/entry-links-settings.tsx-function Ir({ initial: e, receipt: t }) {+function Rr({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e.sites), i = Y(), a = (e, t) => r((n) => n.map((n) => n.key === e ? {...n,host: t@@ -3638,31 +3659,31 @@ function Ir({ initial: e, receipt: t }) {}//#endregion//#region src/react/settings/indexer-settings.tsx-var Lr = "/api/configuration/indexers";-function Rr({ receipt: e }) {+var zr = "/api/configuration/indexers";+function Br({ receipt: e }) {let t = X({queryKey: ["indexers"],- queryFn: ({ signal: e }) => U(Lr, e),+ queryFn: ({ signal: e }) => U(zr, e),refetchOnMount: "always"});return t.error ? /* @__PURE__ */ (0, $.jsx)(C, { children: K(t.error) }) : t.isFetching ? /* @__PURE__ */ (0, $.jsx)(Ee, {label: "正在读取资源搜索设置",html: $e- }) : t.data ? /* @__PURE__ */ (0, $.jsx)(Vr, {+ }) : t.data ? /* @__PURE__ */ (0, $.jsx)(Ur, {initial: t.data,receipt: e}) : null;}-function zr(e) {+function Vr(e) {try {return new globalThis.URL(e).host;} catch {return e;}}-function Br({ row: e, index: t }) {+function Hr({ row: e, index: t }) {let n = [- e.url ? zr(e.url) : "未填地址",+ e.url ? Vr(e.url) : "未填地址",e.enabled ? "已启用" : "已停用",e.api_key_set && !e.clear_api_key ? "已保存 API key" : e.api_key ? "API key 待保存" : "没有 API key"];@@ -3677,7 +3698,7 @@ function Br({ row: e, index: t }) {})]});}-function Vr({ initial: e, receipt: t }) {+function Ur({ initial: e, receipt: t }) {let [n, r] = (0, Z.useState)(e.indexers), i = Y();(0, Z.useEffect)(() => {J("indexers", { open: e.indexers.map((e) => !e.url) });@@ -3689,7 +3710,7 @@ function Vr({ initial: e, receipt: t }) {return /* @__PURE__ */ (0, $.jsxs)(F, {title: "资源搜索",onSubmit: (e) => {- e.preventDefault(), i.run("save", (e) => W(Lr, { indexers: n }, "POST", e), (e) => {+ e.preventDefault(), i.run("save", (e) => W(zr, { indexers: n }, "POST", e), (e) => {r(e.indexers), t("已保存索引器");});},@@ -3709,7 +3730,7 @@ function Vr({ initial: e, receipt: t }) {className: "min-w-0 border-t border-separator-border pt-2",children: /* @__PURE__ */ (0, $.jsx)(b, {defaultOpen: !e.url,- summary: /* @__PURE__ */ (0, $.jsx)(Br, {+ summary: /* @__PURE__ */ (0, $.jsx)(Hr, {row: e,index: t}),@@ -3795,7 +3816,7 @@ function Vr({ initial: e, receipt: t }) {}//#endregion//#region src/react/settings/source-settings.tsx-function Hr({ data: e, receipt: t, panel: n }) {+function Wr({ data: e, receipt: t, panel: n }) {let r = X({queryKey: E,queryFn: ({ signal: e }) => Ke(e),@@ -3810,7 +3831,7 @@ function Hr({ data: e, receipt: t, panel: n }) {variant: "secondary",children: "采集来源与登录状态"}) }),- r.data ? /* @__PURE__ */ (0, $.jsx)(Fr, {+ r.data ? /* @__PURE__ */ (0, $.jsx)(Lr, {data: r.data,readOnly: !!e.ledger_read_only,toast: t,@@ -3824,8 +3845,8 @@ function Hr({ data: e, receipt: t, panel: n }) {html: Ue}),/* @__PURE__ */ (0, $.jsx)(or, { receipt: t }),- /* @__PURE__ */ (0, $.jsx)(Rr, { receipt: t }),- e.entry_links ? /* @__PURE__ */ (0, $.jsx)(Ir, {+ /* @__PURE__ */ (0, $.jsx)(Br, { receipt: t }),+ e.entry_links ? /* @__PURE__ */ (0, $.jsx)(Rr, {initial: e.entry_links,receipt: t}) : null@@ -3834,7 +3855,7 @@ function Hr({ data: e, receipt: t, panel: n }) {}//#endregion//#region src/react/settings/configuration-shape.ts-function Ur(e) {+function Gr(e) {let t = e.downloads;if (!t) return null;let n = t.media_sources ?? [];@@ -3847,7 +3868,7 @@ function Ur(e) {browserLogin: t.pikpak_browser.available};}-function Wr(e) {+function Kr(e) {let t = e.tunnel;return {port: !!(e.editable && e.port_editable !== !1),@@ -3858,7 +3879,7 @@ function Wr(e) {tunnelNote: !!(t && (!t.available || t.state === "starting" || t.state === "running" && t.url))};}-function Gr(e) {+function qr(e) {let t = e.updates, n = e.update_job?.state ?? "idle", r = !t || t.state === "unchecked" && !t.checked_at && n === "idle", i = +!!t?.package_kind + (r ? 0 : +!!t?.checked_at + (t?.state === "unchecked" ? 0 : 1) + (n === "idle" ? 0 : 1)), a = e.automatic_updates, o = e.storage;return {releaseFacts: t?.package_kind ? 5 : 4,@@ -3880,12 +3901,12 @@ function Gr(e) {}//#endregion//#region src/react/settings/configuration-page.tsx-function Kr({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r }) {+function Jr({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r }) {let i = X({queryKey: h,queryFn: ({ signal: e }) => Ge(e)}), a = i.data;- return a ? /* @__PURE__ */ (0, $.jsx)(Jr, {+ return a ? /* @__PURE__ */ (0, $.jsx)(Xr, {data: a,receipt: e,reopenTutorial: t,@@ -3900,14 +3921,14 @@ function Kr({ receipt: e, reopenTutorial: t, section: n = "", diagnostics: r })})});}-var qr = 0;-function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i }) {- let [a] = (0, Z.useState)(() => `board-tabs-${++qr}`), [o, s] = (0, Z.useState)(r), c = (0, Z.useRef)(null), l = (0, Z.useRef)(o);+var Yr = 0;+function Xr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i }) {+ let [a] = (0, Z.useState)(() => `board-tabs-${++Yr}`), [o, s] = (0, Z.useState)(r), c = (0, Z.useRef)(null), l = (0, Z.useRef)(o);(0, Z.useEffect)(() => {s(r);}, [r]), (0, Z.useEffect)(() => {- let t = Ur(e);- t && J("downloads", t), J("network", Wr(e)), J("maintenance", Gr(e));+ let t = Gr(e);+ t && J("downloads", t), J("network", Kr(e)), J("maintenance", qr(e));}, [e]), (0, Z.useLayoutEffect)(() => {if (l.current === o) return;l.current = o;@@ -3945,7 +3966,7 @@ function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i},{title: "来源与订阅",- body: (e) => /* @__PURE__ */ (0, $.jsx)(Hr, {+ body: (e) => /* @__PURE__ */ (0, $.jsx)(Wr, {...m,panel: e})@@ -3960,7 +3981,7 @@ function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i}] : [],...h ? [{title: "网络与访问",- body: (e) => /* @__PURE__ */ (0, $.jsx)(Dr, {+ body: (e) => /* @__PURE__ */ (0, $.jsx)(kr, {...m,panel: e})@@ -4034,6 +4055,6 @@ function Jr({ data: e, receipt: t, reopenTutorial: n, section: r, diagnostics: i});}//#endregion-export { Kr as ConfigurationPage };+export { Jr as ConfigurationPage };-//# debugId=78aa664a-ede9-4231-94fa-85a243e03341\ No newline at end of file+//# debugId=8e3938fd-656e-4cc3-a400-8dcdc5460af2\ No newline at end of filediff --git a/web/dist/peach-app.js b/web/dist/peach-app.jsindex 0f5ab4441..ed50f1e81 100644--- a/web/dist/peach-app.js+++ b/web/dist/peach-app.js@@ -2,7 +2,7 @@(function() {try {var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "99032ff4-87c0-4448-9107-37f6c03224b8", e._sentryDebugIdIdentifier = "sentry-dbid-99032ff4-87c0-4448-9107-37f6c03224b8");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "f49564b0-afcf-495a-a92b-3b2351008fbe", e._sentryDebugIdIdentifier = "sentry-dbid-f49564b0-afcf-495a-a92b-3b2351008fbe");} catch {}})();var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {@@ -74743,8 +74743,8 @@ async function _6(e, t) {if (r.status === "rejected") throw r.reason;if (n.status === "rejected") throw n.reason;}-var v6 = g6(() => import("./peach-app.jav-page-BylXQgrV.js")), y6 = g6(() => import("./peach-app.stats-page-Dl0lm7Yt.js")), b6 = g6(() => import("./peach-app.taste-page-CidGJvZ7.js")), x6 = g6(() => import("./peach-app.review-page-CPsgIxd6.js")), S6 = g6(() => import("./peach-app.data-cleanup-page-DPCNx1GU.js")), C6 = g6(() => import("./peach-app.duplicates-page-CoHPntSW.js")), w6 = g6(() => import("./peach-app.quality-goals-page-CjcBIXAC.js")), T6 = g6(() => import("./peach-app.scraping-page-DM0a_K9-.js")), E6 = g6(async () => {- let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-Bxq5ZZc_.js"), import("./peach-app.diagnostics-page-bdA2qUuj.js")]);+var v6 = g6(() => import("./peach-app.jav-page-BylXQgrV.js")), y6 = g6(() => import("./peach-app.stats-page-Dl0lm7Yt.js")), b6 = g6(() => import("./peach-app.taste-page-CidGJvZ7.js")), x6 = g6(() => import("./peach-app.review-page-CPsgIxd6.js")), S6 = g6(() => import("./peach-app.data-cleanup-page-DPCNx1GU.js")), C6 = g6(() => import("./peach-app.duplicates-page-CoHPntSW.js")), w6 = g6(() => import("./peach-app.quality-goals-page-CjcBIXAC.js")), T6 = g6(() => import("./peach-app.scraping-page-eYjMETgJ.js")), E6 = g6(async () => {+ let [{ ConfigurationPage: e }, { DiagnosticsPage: t }] = await Promise.all([import("./peach-app.configuration-page-HbZ3QpMI.js"), import("./peach-app.diagnostics-page-bdA2qUuj.js")]);return {ConfigurationPage: e,DiagnosticsPage: t@@ -79996,4 +79996,4 @@ jNe($9);//#endregionexport { xI as $2ec61d1d4f780267$export$a8a3e93435678ff9, PI as $3a442827418ebe87$export$eb2fcfdbd7ba97d4, rR as $542a13ca2fa5b484$export$5b6b19405a83ff9d, CT as $72abaeab4d80592f$export$78efe591171d7d45, YR as $76d00c5a4edb230a$export$76ccd210b9029917, KR as $76d00c5a4edb230a$export$816b5d811295e6bc, QR as $76d00c5a4edb230a$export$b59bdbef9ce70de2, ez as $76d00c5a4edb230a$export$f6f0c3fe4ec306ea, GR as $76d00c5a4edb230a$export$f850895b287ef28e, Mde as $b4f18e3395fe64d7$export$3d96ec278d3efce4, jde as $b4f18e3395fe64d7$export$3e41faf802a29e71, Ode as $b4f18e3395fe64d7$export$b2539bed5023c21c, iz as $b4f18e3395fe64d7$export$e51a686c67fdaa2d, Fde as $bd263d78e9bf3c56$export$f5c9f3c2c4054eec, uw as $ea3928288112382f$export$439d29a4e110a164, gR as $f2ff30fde7b014be$export$3ddf2d174ce01153, CR as $fe21c36db05242bb$export$a98f0dcb43a68a25, wR as $fe21c36db05242bb$export$d7b12c4107be0d61, _fe as $l, BA as ACCENT_CHOICES, fwe as AMANE_BRIDGE_CHECK_URL, Z$ as AMANE_BRIDGE_KEY, pwe as AMANE_BRIDGE_REBUILD_URL, On as ApiError, dW as ArtSlot, J as Button, JF as ButtonLink, Efe as Bx, Bt as CLOUD_LOCATIONS, Z1 as CLOUD_PROXY_HELP, pr as COLUMN_SORT, l1 as CONFIGURATION_KEY, tX as CONFIGURATION_URL, mwe as COOKIE_TEXT_LIMIT, X$ as COVER_JOB_KEY, gi as CREDENTIAL_STATE, K$ as CUSTOM_SOURCES_KEY, G$ as CUSTOM_SOURCES_URL, rV as Checkbox, nV as CheckboxGlyph, qB as ChevronSortDown, hZ as Chip, q2 as CloudDownloadDialog, zH as CollapseChevron, RH as CollapseRegion, p$ as CollectionSummary, Gve as DEFAULT_CATEGORY, Mn as DEFAULT_SORT, LQ as DIAGNOSTICS_KEY, Hye as DIRECTORY_TEMPLATE_ERROR, M0 as DISCOVERY_SORTS, V2 as DOWNLOADS_KEY, B2 as DOWNLOADS_URL, TY as DUPLICATES_KEY, cY as DataTableFooter, iY as DataTableFrame, sY as DataTableSort, KH as Disclosure, SDe as DownloadsPanel, cfe as E3, Kve as ENTITY_REVIEW_KINDS, Y1 as ENTRY_LINKS_HELP, X1 as ENTRY_LINKS_HINT, bfe as Ea, Lfe as EmptyFocusButton, Iz as EmptyState, WH as ErrorText, ghe as ExternalLink, cr as FEEDS_KEY, lX as FEED_SCHEDULE_KEY, xke as FLOW_LABEL_X, L3 as FLOW_VIEWBOX, or as FOLLOW_CHECK_KEY, ar as FOLLOW_CREDENTIALS_KEY, M8 as FOLLOW_INITIAL_RANGE_OPTIONS, ir as FOLLOW_MANAGE_KEY, sr as FOLLOW_RESOLVE_KEY, cX as FOLLOW_SCHEDULE_KEY, vhe as Fact, _he as FactList, GH as FieldLabel, R$ as Fieldset, L$ as FieldsetTitle, RF as FilterGlass, zF as FilterGlassRows, LF as FilterIconButton, VF as FilterPill, hhe as Footer, bz as Gg, UF as GlassPill, UH as Help, Dz as HintText, pke as IDLE_POLL_MS, Pve as IDLE_REPAIR, MF as IconButton, Mz as Input, jz as InputBase, dA as JAV_LAYOUTS, P0 as JAV_RECOMMENDATION_GRID, MX as JUNK_KEY, X3 as JavHeader, Ove as KEEP_LABELS, ur as LAYOUTS, J1 as LIBRARY_FOLDER_HELP, uH as LIBRARY_PROCESSING_KEY, qY as LINKS_KEY, JY as LINK_CHECK_KEY, mye as LINK_KINDS, YY as LINK_PRUNE_KEY, Cn as LOC, Ez as Label, V$ as LibraryProcessingCard, $z as LibraryShortcuts, xH as LinkButton, NH as LoadingDots, ufe as M6, yye as MEDIA_PROCESSING_KEY, dX as MEDIA_PROCESSING_URL, AY as MEDIA_REPAIR_KEY, kY as MEDIA_REPAIR_URL, Bn as MEDIA_SOURCES_KEY, No as MEDIA_SOURCE_ICONS, Rt as MEDIA_SOURCE_OPTIONS, ZB as MENU_ITEM, QB as MENU_ITEM_INTERACTIVE, XB as MENU_POPOVER_SURFACE, CH as MenuDialog, sG as MixCard, Nz as ModalFrame, Ev as MotionConfigContext, Tz as NR, Fz as Note, Nfe as OA, mX as ORGANIZE_KEY, _X as ORPHAN_RECORDS_KEY, yz as OV, fz as P7, ACe as PHASES, nX as PICK_FOLDER_URL, U$ as PLAYLISTS_KEY, mTe as POLICY_COLUMNS, gTe as POLICY_COVER_NOTE, hTe as POLICY_MATRIX, q1 as POLICY_SUMMARY, oY as Pagination, B$ as PathLine, rF as PillTabList, FH as Progress, FY as QUALITY_GOALS_KEY, j$ as REPAIR_CARD_TEXT, jY as REPAIR_LIBRARIES_KEY, SX as RESOURCE_APPLY_KEY, xX as RESOURCE_SCAN_KEY, UCe as RESULT_PANEL, WCe as RESULT_SECTION, Wve as REVIEW_CATEGORIES, jX as REVIEW_COUNTS_KEY, RY as REVIEW_KEY, zY as REVIEW_LABELS, uW as RetryNote, Mfe as Rf, phe as Rows, uwe as SCRAPING_CHECK_URL, J$ as SCRAPING_COVER_URL, Y$ as SCRAPING_KEY, lwe as SCRAPING_SETTINGS_URL, bU as SEGMENT, yU as SEGMENTED_TRACK, sX as SETTINGS_KEY, rX as SETTINGS_URL, Nn as SORT_DEFAULT_DIR, jn as SORT_OPTIONS, Vt as SOURCE_LABELS, c3 as STATS_KEY, fhe as Section, mhe as SectionSkeleton, vU as SegmentedRadioGroup, nge as SegmentedTabList, KU as Segments, aY as Select, dU as Select$1, p1 as SelectField, fU as SelectItem, Ck as SelectionDock, BH as SettingsCard, dhe as SettingsRow, VH as SettingsSectionLabel, She as SiteLabel, TU as SortDirectionIcon, JU as SortKeys, bQ as SourceAvatar, XH as SourceLabel, qH as SourceMark, HH as Stack, z$ as StatusLabel, P2 as Switch, dF as TASKS_KEY, nke as TASTE_REFRESH_KEY, rke as TASTE_WINDOWS, uX as THUMBNAIL_JOBS_KEY, PX as TRASH_KEY, Ile as TRIGGER_LABELS, YJ as Table, hY as TableColumnControls, gY as TableColumnResizer, vY as TableSelectionHeader, IH as TaskProgress, kz as TextField, Oz as TextFieldContext, vz as Un, _$ as WANTS_KEY, r4 as WantMagnets, Jf as WithPromise, pz as Wt, _z as Xc, wz as Xf, ffe as Xt, lfe as _8, o as __commonJSMin, s as __exportAll, l as __toESM, jfe as aB, qr as addAlias, Kr as addSource, y$ as addWant, V as apiGet, H as apiSend, iA as appSettingsStore, sbe as applyConfirmText, AX as applyLeftovers, obe as applyPlanText, lbe as applyText, cA as applyTheme, Zg as asNumber, Yye as attachOrphan, kr as authorAvatar, jr as authorGroups, Or as authorInitial, Dr as authorName, wq as autoResetPageIndex, La as avatarInner, m3 as bandRows, Uye as baseName, Nve as batchOperate, Ok as boundedPreference, Ave as bulkCloudPreferences, Bz as busyProps, Afe as cB, MDe as cachedMagnetStates, Rf as calcGeneratorVelocity, Qve as canApprove, lf as cancelFrame, ebe as candidateText, MH as cardClass, wA as cardRatio, gz as cc, fi as checkEvidenceGap, di as checkFailures, ni as checkFeeds, vye as checkLine, li as checkReceipt, ui as checkSummary, gwe as checkText, pi as checkedText, NW as clickedBlank, Sve as cloudLocations, O0 as cloudProxySkeleton, Dx as clsx, Cfe as cn, Wm as collectMotionValues, rJ as columnVisibilityFeature, WJ as column_getCanSort, BJ as column_getSortFn, Xve as commonReviewSources, sV as configurationSection, ske as configureTasteBrowser, xc as confirmModal, qK as copyInstancePropertiesWithoutMemos, Aa as coverUrl, Jq as createColumnHelper, rwe as createPlaylist, _i as credentialDone, w0 as credentialsSkeleton, sye as currentReviewRow, eF as cx, Sz as dZ, iye as decisionPayload, aye as decisionReceipt, rye as defaultChoice, awe as deletePlaylist, K1 as diagnosticsSkeleton, RCe as discoveryArtwork, w$ as discoveryKey, BTe as discoveryScore, Eve as distinctName, uye as dropReviewRows, si as dropSources, kfe as du, jve as duplicateVictims, vF as elapsedText, Ia as entityFaceImg, en as entityPath, Sr as errorHeadline, An as errorMessage, B as esc, Sq as expandRowModel, lz as f1, xr as feedIntervalText, e1 as fetchAmaneBridge, zr as fetchCheckJob, u1 as fetchConfiguration, $$ as fetchCoverJob, Rr as fetchCredentials, q$ as fetchCustomSources, RQ as fetchDiagnostics, T$ as fetchDiscoveries, DY as fetchDuplicates, jle as fetchEarlier, Sye as fetchFeedSchedule, $r as fetchFeeds, Lr as fetchFollow, xye as fetchFollowSchedule, IX as fetchJunkSummary, QY as fetchLinkCheck, $Y as fetchLinkPrune, ZY as fetchLinkStats, bye as fetchMediaProcessing, MY as fetchMediaRepair, Vn as fetchMediaSources, hX as fetchOrganize, Fye as fetchOrganizeExample, vX as fetchOrphanRecords, Qr as fetchPending, W$ as fetchPlaylists, IY as fetchQualityGoals, NY as fetchRepairLibraries, Br as fetchResolveJob, wX as fetchResourceApply, CX as fetchResourceScan, WY as fetchReview, FX as fetchReviewCounts, fX as fetchSettings, Q$ as fetchSources, l3 as fetchStats, Vr as fetchSuggestions, pF as fetchTasks, P3 as fetchTaste, cke as fetchTasteJob, Cye as fetchThumbnailJobs, LX as fetchTrashSummary, v$ as fetchWants, Jve as filterReviewRows, xn as firstGrapheme, pK as flexRender, Cke as flowGraph, wke as flowLabel, SOe as fmtCount, hn as fmtDur, _n as fmtSize, Gle as foldRoutine, ii as followFeedByName, lr as followSuggestKey, qle as followupDetail, cf as frame, $de as g4, oJ as getDefaultPaginationState, CA as gridLayout, Ar as groupByAuthor, Wle as groupFollowups, VY as groupReviewRows, ibe as hasChanges, TX as hasResourceRoots, hF as hasResultProblems, mke as historySpan, uz as i2, fke as importTasteExport, T0 as indexersSkeleton, Af as interpolate, x$ as invalidateWants, _F as isActive, br as isBroken, mr as isLayout, hh as isMotionValue, BY as isReviewCategory, Kle as isRoutine, E0 as javBrowserSkeleton, I0 as javContentSkeleton, gA as javLayout, F0 as javTagSkeleton, mbe as junkBreakdown, owe as keepPlaylist, _e as keepPreviousData, Pr as keepSelected, u3 as known, rfe as l7, Ule as latestOfKind, POe as lengthRows, Wn as localTime, ri as lookupFeedActor, ofe as m7, xz as mM, qt as mapLimit, Zr as markItem, h3 as max, MOe as mediumRows, Mle as mergeFinished, g3 as min, fye as mirrorText, Lve as missingToolText, OY as mixedCloudPreferences, EF as momentText, Ry as motion, Km as motionValue, Gye as organizeOutcome, Q0 as overlayHost, hr as pageSizeOf, Nr as pageWindow, In as paginationRange, oi as patchSource, YV as peachHistory, YV as peachHistory$1, nye as pendingGenres, wOe as percentText, Rye as pickOrganizeFolder, Wye as planSummary, d3 as playedFor, EOe as playedItemUrl, fF as pollInterval, ds as popCount, nwe as posterUrl, kW as previewLibraryColor, Lye as previewOrganize, Bve as previewUrl, Hle as problemDestination, yF as progressText, YH as providerIcon, _ye as pruneText, DX as purgeCount, Xye as purgeOrphan, Cz as pv, Ofe as qE, U as queryClient, dz as r2, bke as radarRows, kOe as radialArc, AOe as radialBarSize, OOe as radialCeiling, DOe as radialSlices, Bj as randomId, vke as rankDetail, yke as rankShares, p3 as reachedShare, xF as readableErrorHeadline, VTe as recommendationScore, cye as recordGenre, Qye as recordsText, swe as recreatePlaylist, ewe as refreshPlaylists, tl as relayoutCovers, ci as reloadFollowManage, dye as reloadReview, yTe as rememberShape, Bye as rememberTemplates, Jr as removeAlias, ti as removeFeed, Gr as removeSource, dke as removeTasteSource, b$ as removeWants, Yr as renameAliasGroup, iwe as renamePlaylist, IOe as replayRows, E as require_jsx_runtime, v as require_react, S as require_react_dom, IK as require_with_selector, NCe as resetWants, Fn as resolveFollowSort, Wf as resolveStartTime, twe as resumeAssetId, qve as reviewGroupingOptions, pbe as reviewSummary, Yve as reviewWindow, eye as rowEvidence, UY as rowFieldName, pJ as rowPaginationFeature, PJ as rowSelectionFeature, qJ as rowSortingFeature, HY as rowSubject, tye as rowTags, $ve as rowTitle, efe as s5, Xr as saveCredential, abe as scanLine, Oye as schedulePollInterval, FCe as searchNote, Zve as selectReviewRange, Fr as selectionState, ei as setFeedEnabled, Wr as setSourceEnabled, dV as settingsPath, Tve as sharedNamePrefix, XV as shellNavigate, y8 as showToast, sn as siteMarkUrl, oq as skipFirstRun, tF as sortCx, _r as sortLabel, Ht as sourceDefaultCost, hi as sourceIconUrl, cbe as sourceMeta, ns as spinnerHtml, Df as spring, Rz as spriteGlyph, Hr as startCheck, hye as startLinkCheck, gye as startLinkPrune, zye as startOrganize, Ur as startResolve, nbe as startResourceApply, tbe as startResourceScan, uke as startTasteRefresh, Rle as statusLabel, Ive as statusLine, yr as statusText, TA as storeJavLayout, oye as submitDecision, OF as summaryItems, Yq as tableFeatures, sq as tableMemo, Mr as tableRows, Vle as taskIssues, F3 as tasteDate, gke as tasteDimensions, hke as tasteHours, N3 as tasteKey, ake as tasteRefetchInterval, oke as tasteTime, Uu as time, gfe as tl, Ir as toggleGroup, I3 as topScores, yfe as uo, AH as useAction, RZ as useBackgroundJob, tu as useConstant, FF as useHorizontalScroller, nu as useIsomorphicLayoutEffect, jW as useLibraryTints, Ct as useMutation, iV as useOverlayScrollbar, St as useQuery, A as useQueryClient, Ay as useReducedMotion, Dye as useRunSchedule, Tye as useSaveFollowSchedule, pX as useSaveSettings, kye as useSaveThumbnailMode, JJ as useTable, dY as useTablePreferences, Mve as victimBytes, PCe as wantName, TOe as watchNote, f3 as watchedShare, Hs as wireHorizontalScroller, Vye as withOrganizeJob };-//# debugId=99032ff4-87c0-4448-9107-37f6c03224b8\ No newline at end of file+//# debugId=f49564b0-afcf-495a-a92b-3b2351008fbe\ No newline at end of filediff --git a/web/dist/peach-app.scraping-page-DM0a_K9-.js b/web/dist/peach-app.scraping-page-eYjMETgJ.jssimilarity index 98%rename from web/dist/peach-app.scraping-page-DM0a_K9-.jsrename to web/dist/peach-app.scraping-page-eYjMETgJ.jsindex 0097b96dd..91400e8e7 100644--- a/web/dist/peach-app.scraping-page-DM0a_K9-.js+++ b/web/dist/peach-app.scraping-page-eYjMETgJ.js@@ -1,7 +1,7 @@(function() {try {var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "daaf4ee8-3af3-47e9-ac67-d3b9a7c2692e", e._sentryDebugIdIdentifier = "sentry-dbid-daaf4ee8-3af3-47e9-ac67-d3b9a7c2692e");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "c85d4030-96e3-4a13-b134-db65a7bb63d5", e._sentryDebugIdIdentifier = "sentry-dbid-c85d4030-96e3-4a13-b134-db65a7bb63d5");} catch {}})();import { $fe21c36db05242bb$export$d7b12c4107be0d61 as e, AMANE_BRIDGE_CHECK_URL as t, AMANE_BRIDGE_KEY as n, AMANE_BRIDGE_REBUILD_URL as r, Button as i, COVER_JOB_KEY as a, CUSTOM_SOURCES_KEY as o, CUSTOM_SOURCES_URL as s, Checkbox as c, Disclosure as l, ErrorText as u, ExternalLink as d, Fact as f, FactList as p, FieldLabel as m, Footer as h, Help as g, Input as _, LinkButton as v, LoadingDots as y, Note as b, Rows as ee, SCRAPING_CHECK_URL as te, SCRAPING_COVER_URL as x, SCRAPING_KEY as S, SCRAPING_SETTINGS_URL as ne, SEGMENT as re, SEGMENTED_TRACK as ie, Section as C, SegmentedRadioGroup as ae, Select$1 as oe, SelectField as w, SelectItem as se, SettingsRow as ce, Stack as T, StatusLabel as E, __toESM as D, apiSend as O, busyProps as k, checkText as le, confirmModal as A, errorMessage as j, esc as M, fetchAmaneBridge as N, fetchCoverJob as P, fetchCustomSources as F, fetchSources as I, i2 as ue, queryClient as L, require_jsx_runtime as R, require_react as z, spinnerHtml as B, useAction as V, useBackgroundJob as H, useMutation as U, useQuery as W } from "./peach-app.js";@@ -556,13 +556,11 @@ function be({ toast: e }) {tone: "error",children: m.problem}) : /* @__PURE__ */ (0, J.jsxs)(g, { children: [- "已安装版本:",- m.installed_version || "未安装",- "。amane(",+ "amane(",m.license,- ")提供这些内置站点的解析能力。 重新安装会使用 Peach 内置的 ",+ ")提供这些内置站点的解析能力。首次需要时,Peach 会自动准备锁定的 ",m.version,- " 版本,不随上游自动升级。"+ " 版本;安装包内已有可用环境时直接使用。 手动安装也使用此版本,不随上游自动升级。"] }),o ? /* @__PURE__ */ (0, J.jsx)(y, { label: "正在重建运行环境" }) : null,v ? /* @__PURE__ */ (0, J.jsx)(b, {@@ -619,4 +617,4 @@ function xe({ toast: e }) {//#endregionexport { xe as ScrapingPage, Q as linkHost, Z as networkOptions };-//# debugId=daaf4ee8-3af3-47e9-ac67-d3b9a7c2692e\ No newline at end of file+//# debugId=c85d4030-96e3-4a13-b134-db65a7bb63d5\ No newline at end of filediff --git a/web/dist/peach-pages.js b/web/dist/peach-pages.jsindex 355238e1a..95b5114c8 100644--- a/web/dist/peach-pages.js+++ b/web/dist/peach-pages.js@@ -2,7 +2,7 @@(function() {try {var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;- t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "dc5896a3-4b3d-442d-8d1d-89106f5ea16c", e._sentryDebugIdIdentifier = "sentry-dbid-dc5896a3-4b3d-442d-8d1d-89106f5ea16c");+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "09a4a8f3-a34b-4be4-ba4c-29b73db498f1", e._sentryDebugIdIdentifier = "sentry-dbid-09a4a8f3-a34b-4be4-ba4c-29b73db498f1");} catch {}})();var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {@@ -21010,8 +21010,56 @@ function Mg({ label: e, password: t, confirmation: n, onPassword: r, onConfirmat})] });}//#endregion+//#region src/react/settings/peach-proxy-fields.tsx+var Ng = [+ ["environment", "跟随环境"],+ ["direct", "直连"],+ ["proxy", "自定义"]+];+function Pg({ mode: e, onChange: t, labelledBy: n }) {+ return /* @__PURE__ */ (0, z.jsx)(Gm, {+ "aria-label": n ? void 0 : "连接方式",+ "aria-labelledby": n,+ selectedKey: e,+ onSelectionChange: (e) => {+ e !== null && t(String(e));+ },+ children: Ng.map(([e, t]) => /* @__PURE__ */ (0, z.jsx)(Km, {+ id: e,+ children: t+ }, e))+ });+}+function Fg({ id: e, value: t, onChange: n, saved: r = !1, error: i }) {+ return /* @__PURE__ */ (0, z.jsx)(Kp, {+ id: e,+ type: "password",+ label: "代理地址",+ autoComplete: "off",+ spellCheck: "false",+ value: t,+ onChange: n,+ placeholder: r ? "已保存,留空保留" : "http://127.0.0.1:7890",+ validationBehavior: "aria",+ isInvalid: !!i,+ hint: i+ });+}+function Ig(e) {+ try {+ let t = new URL(e).hostname;+ return [+ "localhost",+ "[::1]",+ "::1"+ ].includes(t) || /^127\./.test(t);+ } catch {+ return !1;+ }+}+//#endregion//#region src/react/boardui/components/base/badges/chip.tsx-var Ng = wt({+var Lg = wt({base: "inline-flex items-center justify-center rounded-md px-1.5 whitespace-nowrap transition-[padding,font-size] duration-200 ease",variant: {bold: "py-0.5 text-body-medium",@@ -21030,33 +21078,33 @@ var Ng = wt({soft: "bg-background-secondary-default text-text-secondary"}});-function Pg({ variant: e = "bold", color: t = "neutral", className: n, ref: r, ...i }) {+function Rg({ variant: e = "bold", color: t = "neutral", className: n, ref: r, ...i }) {return /* @__PURE__ */ (0, z.jsx)("span", {ref: r,- className: R(Ng.base, Ng.variant[e], Ng.color[t], n),+ className: R(Lg.base, Lg.variant[e], Lg.color[t], n),...i});}//#endregion//#region src/react/components/status-label.tsx-var Fg = {+var zg = {success: "lime",progress: "blue",warning: "yellow",error: "rose",neutral: "neutral"};-function Ig({ tone: e = "neutral", ...t }) {- return /* @__PURE__ */ (0, z.jsx)(Pg, {+function Bg({ tone: e = "neutral", ...t }) {+ return /* @__PURE__ */ (0, z.jsx)(Rg, {"data-status-tone": e,variant: "caption",- color: Fg[e],+ color: zg[e],...t});}//#endregion//#region src/react/settings/remote-reporting-settings.tsx-function Lg({ value: e, onChange: t, busy: n = !1 }) {+function Vg({ value: e, onChange: t, busy: n = !1 }) {return /* @__PURE__ */ (0, z.jsxs)(z.Fragment, { children: [/* @__PURE__ */ (0, z.jsx)(xm, { children: /* @__PURE__ */ (0, z.jsx)(vm, {label: "发送版本统计与错误诊断(推荐)",description: "上传版本、系统信息、故障类型、代码位置与发生次数。",@@ -21074,18 +21122,18 @@ function Lg({ value: e, onChange: t, busy: n = !1 }) {divided: !0,children: /* @__PURE__ */ (0, z.jsx)("span", {className: "self-start",- children: /* @__PURE__ */ (0, z.jsx)(Ig, { children: "上传服务未配置" })+ children: /* @__PURE__ */ (0, z.jsx)(Bg, { children: "上传服务未配置" })})})] });}//#endregion//#region src/react/pages/setup/setup-form.tsx-var Rg = [+var Hg = ["host","port","mdns_name"];-function zg(e, t) {+function Ug(e, t) {return Array.isArray(e) ? e.length === t ? {rows: e,table: ""@@ -21097,11 +21145,11 @@ function zg(e, t) {table: e ?? ""};}-function Bg(e) {+function Wg(e) {return e.length ? e.length === 1 ? `完成设置后扫描并补全资料:${e[0]}` : `完成设置后扫描这 ${e.length} 个文件夹并补全资料` : "完成设置后扫描并补全资料";}-var Vg = (e) => Array.isArray(e) ? e.filter(Boolean).join(" ") : e ?? "";-function Hg({ setup: e, onDone: t }) {+var Gg = (e) => Array.isArray(e) ? e.filter(Boolean).join(" ") : e ?? "";+function Kg({ setup: e, onDone: t }) {let n = e.questions.find((e) => e.input === "folders"), r = e.questions.find((e) => e.input === "folder"), i = e.questions.filter((e) => e.input !== "folders"), a = i.filter((e) => e.input !== "folder"), o = e.media_sources.map(({ value: e, label: t }) => [e, t]), s = (t = "") => ({path: t,location: e.media_source_default,@@ -21115,35 +21163,39 @@ function Hg({ setup: e, onDone: t }) {pickFolder: rm,describe: im,focusAfterPick: !0- }), [l, u] = (0, w.useState)(() => Object.fromEntries(i.map((e) => [e.key, e.default]))), [d, f] = (0, w.useState)(!1), [p, m] = (0, w.useState)(""), [h, g] = (0, w.useState)(e.access_enabled), [_, v] = (0, w.useState)(""), [y, b] = (0, w.useState)(""), [x, S] = (0, w.useState)(e.scan_now), [C, T] = (0, w.useState)(e.history_guide), [E, D] = (0, w.useState)(e.remote_reporting), [O, k] = (0, w.useState)({}), [A, j] = (0, w.useState)(""), [M, ee] = (0, w.useState)(""), [te, ne] = (0, w.useState)(!1), [N, re] = (0, w.useState)(!1), [ie, ae] = (0, w.useState)(0), oe = (0, w.useRef)(null), se = (0, w.useRef)(null), [ce, le] = (0, w.useState)(0);+ }), [l, u] = (0, w.useState)(() => Object.fromEntries(i.map((e) => [e.key, e.default]))), [d, f] = (0, w.useState)(!1), [p, m] = (0, w.useState)(""), [h, g] = (0, w.useState)(e.access_enabled), [_, v] = (0, w.useState)(""), [y, b] = (0, w.useState)(""), [x, S] = (0, w.useState)(e.scan_now), [C, T] = (0, w.useState)(e.history_guide), [E, D] = (0, w.useState)(e.remote_reporting), [O, k] = (0, w.useState)(e.peach_proxy?.mode ?? "environment"), [A, j] = (0, w.useState)(""), [M, ee] = (0, w.useState)({}), [te, ne] = (0, w.useState)(""), [N, re] = (0, w.useState)(""), [ie, ae] = (0, w.useState)(!1), [oe, se] = (0, w.useState)(!1), [ce, le] = (0, w.useState)(0), ue = (0, w.useRef)(null), de = (0, w.useRef)(null), [fe, pe] = (0, w.useState)(0);(0, w.useEffect)(() => {- ce && oe.current?.querySelector("input[aria-invalid=\"true\"]")?.focus();- }, [ce]);- let ue = (e) => e ? /* @__PURE__ */ (0, z.jsx)("span", {+ fe && ue.current?.querySelector("input[aria-invalid=\"true\"]")?.focus();+ }, [fe]);+ let me = (e) => e ? /* @__PURE__ */ (0, z.jsx)("span", {role: "alert",children: e- }, ce) : void 0, de = (e) => !e.visible_when || Object.entries(e.visible_when).every(([e, t]) => l[e] === t), fe = (e, t) => u((n) => ({+ }, fe) : void 0, he = (e) => !e.visible_when || Object.entries(e.visible_when).every(([e, t]) => l[e] === t), ge = (e, t) => u((n) => ({...n,[e]: t- })), pe = async (e) => {- if (e.preventDefault(), te) return;+ })), P = async (e) => {+ if (e.preventDefault(), ie) return;let n = c.rows.findIndex((e) => !e.cost);if (n >= 0) {- re(!0), requestAnimationFrame(() => oe.current?.querySelector(`[data-media-read-policy="${n}"] button`)?.focus());+ se(!0), requestAnimationFrame(() => ue.current?.querySelector(`[data-media-read-policy="${n}"] button`)?.focus());return;}- ne(!0), ee("");+ ae(!0), re("");let r = {media_dir: c.rows,access_enabled: h,scan_now: x,history_guide: C,+ peach_proxy: {+ mode: O,+ proxy: O === "proxy" ? A : ""+ },...E ? { remote_reporting: {usage: E.usage,errors: E.errors} } : {}};- for (let e of i) de(e) && (r[e.key] = l[e.key] ?? "");+ for (let e of i) he(e) && (r[e.key] = l[e.key] ?? "");h && Object.assign(r, {access_password: _,access_confirm: y@@ -21152,14 +21204,14 @@ function Hg({ setup: e, onDone: t }) {t(await tm(r));} catch (e) {if (e instanceof Qp && e.status === 400 && e.errors) {- let t = e.errors, { rows: n, table: r } = zg(t.media_dir, c.rows.length);- c.setErrors(n), j(r), k(t), Rg.some((e) => t[e]) && ae((e) => e + 1), t.access_password && g(!0), le((e) => e + 1);- } else ee(im(e));+ let t = e.errors, { rows: n, table: r } = Ug(t.media_dir, c.rows.length);+ c.setErrors(n), ne(r), ee(t), Hg.some((e) => t[e]) && le((e) => e + 1), t.access_password && g(!0), pe((e) => e + 1);+ } else re(im(e));} finally {- ne(!1);+ ae(!1);}- }, me = (e) => {- let t = Vg(O[e.key]), n = e.help.join("");+ }, _e = (e) => {+ let t = Gg(M[e.key]), n = e.help.join("");if (e.input === "choice") {let r = `setup-${e.key}-label`;return /* @__PURE__ */ (0, z.jsxs)("div", {@@ -21175,7 +21227,7 @@ function Hg({ setup: e, onDone: t }) {orientation: "horizontal",className: _g,value: l[e.key] ?? e.default,- onChange: (t) => fe(e.key, t),+ onChange: (t) => ge(e.key, t),children: (e.options ?? []).map((e) => /* @__PURE__ */ (0, z.jsx)(op, {value: e.value,className: vg,@@ -21183,7 +21235,7 @@ function Hg({ setup: e, onDone: t }) {}, e.value))}),n ? /* @__PURE__ */ (0, z.jsx)(Cm, { children: n }) : null,- t ? /* @__PURE__ */ (0, z.jsx)(wm, { children: t }, ce) : null+ t ? /* @__PURE__ */ (0, z.jsx)(wm, { children: t }, fe) : null]}, e.key);}@@ -21195,7 +21247,7 @@ function Hg({ setup: e, onDone: t }) {autoComplete: "off",spellCheck: "false",value: l[e.key] ?? "",- onChange: (t) => fe(e.key, t),+ onChange: (t) => ge(e.key, t),leadingAddon: e.prefix ? /* @__PURE__ */ (0, z.jsx)("span", {className: "shrink-0 pl-1 text-body-regular text-text-secondary",children: e.prefix@@ -21206,25 +21258,25 @@ function Hg({ setup: e, onDone: t }) {}) : void 0,validationBehavior: "aria",isInvalid: !!t,- hint: ue(t) ?? (n || void 0)+ hint: me(t) ?? (n || void 0)}, e.key);- }, he = async () => {+ }, ve = async () => {if (r && !d) {f(!0), m("");try {let e = await rm(l[r.key] ?? "");- e && fe(r.key, e);+ e && ge(r.key, e);} catch (e) {m(im(e));} finally {f(!1);}}- }, ge = r ? Vg(O[r.key]) || p : "", P = c.rows.map((e) => e.path.trim()).filter(Boolean), _e = c.rows.some((e) => Cg(e.location));+ }, ye = r ? Gg(M[r.key]) || p : "", be = c.rows.map((e) => e.path.trim()).filter(Boolean), xe = c.rows.some((e) => Cg(e.location));return /* @__PURE__ */ (0, z.jsxs)("form", {- ref: oe,+ ref: ue,noValidate: !0,- onSubmit: (e) => void pe(e),+ onSubmit: (e) => void P(e),"aria-labelledby": "auth-card-title",className: "flex flex-col gap-6",children: [@@ -21240,7 +21292,7 @@ function Hg({ setup: e, onDone: t }) {children: "*"})]}),- A ? /* @__PURE__ */ (0, z.jsx)(wm, { children: A }, ce) : null,+ te ? /* @__PURE__ */ (0, z.jsx)(wm, { children: te }, fe) : null,/* @__PURE__ */ (0, z.jsx)("div", {role: "group","aria-labelledby": "setup-media-title",@@ -21249,12 +21301,12 @@ function Hg({ setup: e, onDone: t }) {label: `${n.label} ${t + 1}`,path: e.path,onPath: (e) => c.edit(t, { path: e }),- error: ue(c.errors[t]),+ error: me(c.errors[t]),inputRef: c.inputRef(t),picking: c.picking === t,onPick: () => void c.pick(t),onRemove: c.rows.length > 1 ? () => {- c.remove(t), se.current?.focus();+ c.remove(t), de.current?.focus();} : void 0,children: [/* @__PURE__ */ (0, z.jsxs)(Tg, { children: [/* @__PURE__ */ (0, z.jsx)(Ag, {index: t,@@ -21267,7 +21319,7 @@ function Hg({ setup: e, onDone: t }) {}), /* @__PURE__ */ (0, z.jsx)(Eg, {index: t,cost: e.cost ?? "",- error: N && !e.cost ? "请选择媒体读取策略" : void 0,+ error: oe && !e.cost ? "请选择媒体读取策略" : void 0,onChange: (e) => c.edit(t, { cost: e })})] }), /* @__PURE__ */ (0, z.jsxs)(Tg, { children: [/* @__PURE__ */ (0, z.jsx)(wg, {label: "所属媒体库",@@ -21315,14 +21367,14 @@ function Hg({ setup: e, onDone: t }) {}, t))}),/* @__PURE__ */ (0, z.jsx)(Dt, {- ref: se,+ ref: de,variant: "secondary",leadingIcon: Fp,className: "self-start",onClick: c.add,children: "添加文件夹"}),- _e ? /* @__PURE__ */ (0, z.jsxs)(z.Fragment, { children: [+ xe ? /* @__PURE__ */ (0, z.jsxs)(z.Fragment, { children: [/* @__PURE__ */ (0, z.jsx)(Dg, {}),/* @__PURE__ */ (0, z.jsxs)(Cm, { children: [e.cloud.help, /* @__PURE__ */ (0, z.jsx)(Tm, {href: e.cloud.link.url,@@ -21357,14 +21409,14 @@ function Hg({ setup: e, onDone: t }) {autoComplete: "off",spellCheck: "false",value: l[r.key] ?? "",- onChange: (e) => fe(r.key, e),+ onChange: (e) => ge(r.key, e),validationBehavior: "aria",- isInvalid: !!ge,- hint: ue(ge)+ isInvalid: !!ye,+ hint: me(ye)}), /* @__PURE__ */ (0, z.jsx)(Nm, {icon: bg,"aria-label": "选择数据目录",- onClick: () => void he(),+ onClick: () => void ve(),...yg(d)})]}),@@ -21400,20 +21452,59 @@ function Hg({ setup: e, onDone: t }) {confirmation: y,onPassword: v,onConfirmation: b,- passwordError: ue(Vg(O.access_password)),+ passwordError: me(Gg(M.access_password)),passwordHint: "请输入 8–256 个字符。",- confirmationInvalid: !!O.access_password+ confirmationInvalid: !!M.access_password+ }) : null+ ]+ }),+ /* @__PURE__ */ (0, z.jsxs)(At, {+ labelledBy: "setup-proxy-title",+ children: [+ /* @__PURE__ */ (0, z.jsx)(jt, {+ id: "setup-proxy-title",+ children: "Peach 代理"+ }),+ /* @__PURE__ */ (0, z.jsx)(Cm, { children: "用于资料采集、封面和工具下载,可在配置页修改。" }),+ /* @__PURE__ */ (0, z.jsxs)("div", {+ className: "flex flex-col items-start gap-1.5",+ children: [/* @__PURE__ */ (0, z.jsx)(Bp, {+ elementType: "span",+ id: "setup-proxy-mode-label",+ children: "连接方式"+ }), /* @__PURE__ */ (0, z.jsx)(Pg, {+ mode: O,+ onChange: k,+ labelledBy: "setup-proxy-mode-label"+ })]+ }),+ O === "proxy" ? /* @__PURE__ */ (0, z.jsx)(Fg, {+ id: "setupProxyAddress",+ value: A,+ onChange: j,+ saved: e.peach_proxy?.proxy_saved,+ error: me(Gg(M.peach_proxy))+ }) : M.peach_proxy ? /* @__PURE__ */ (0, z.jsx)(wm, { children: Gg(M.peach_proxy) }, fe) : null,+ e.docker && O === "proxy" && Ig(A) ? /* @__PURE__ */ (0, z.jsx)(Jp, {+ tone: "warning",+ title: "请填写容器可访问的代理地址",+ children: "回环地址指向容器自身;宿主机代理需使用容器可访问的宿主机地址。"+ }) : null,+ e.peach_proxy?.needs_selection ? /* @__PURE__ */ (0, z.jsx)(Jp, {+ tone: "warning",+ title: "需要选择连接方式",+ children: "已有来源的代理地址不同,请选择公共连接方式。"}) : null]}),/* @__PURE__ */ (0, z.jsx)(At, { children: /* @__PURE__ */ (0, z.jsx)(Om, {summary: "高级设置",- defaultOpen: ie > 0,+ defaultOpen: ce > 0,children: /* @__PURE__ */ (0, z.jsx)("div", {className: "flex flex-col gap-4",- children: a.filter(de).map(me)+ children: a.filter(he).map(_e)})- }, ie) }),+ }, ce) }),/* @__PURE__ */ (0, z.jsxs)(At, {labelledBy: "setup-options-title",children: [@@ -21426,7 +21517,7 @@ function Hg({ setup: e, onDone: t }) {children: [/* @__PURE__ */ (0, z.jsx)(Pp, {isSelected: x,onChange: S,- children: Bg(P)+ children: Wg(be)}), /* @__PURE__ */ (0, z.jsx)(Cm, { children: "读取已有 NFO 和封面,采集缺失资料。符合自动规则的资料会在处理完成后保存到数据库,其余资料留待确认。" })]}),/* @__PURE__ */ (0, z.jsxs)("section", {@@ -21451,10 +21542,10 @@ function Hg({ setup: e, onDone: t }) {})]}),- M ? /* @__PURE__ */ (0, z.jsx)(wm, { children: M }) : null,+ N ? /* @__PURE__ */ (0, z.jsx)(wm, { children: N }) : null,E ? /* @__PURE__ */ (0, z.jsxs)(At, { children: [/* @__PURE__ */ (0, z.jsx)(jt, { children: "版本统计与错误诊断" }),- /* @__PURE__ */ (0, z.jsx)(Lg, {+ /* @__PURE__ */ (0, z.jsx)(Vg, {value: E,onChange: D}),@@ -21463,7 +21554,7 @@ function Hg({ setup: e, onDone: t }) {/* @__PURE__ */ (0, z.jsx)(Dt, {type: "submit",className: "self-start",- ...yg(te),+ ...yg(ie),children: "完成设置"})]@@ -21471,7 +21562,7 @@ function Hg({ setup: e, onDone: t }) {}//#endregion//#region src/react/pages/setup/setup-restore.tsx-function Ug({ onDone: e }) {+function qg({ onDone: e }) {let [t, n] = (0, w.useState)(""), [r, i] = (0, w.useState)(""), [a, o] = (0, w.useState)(!1);return /* @__PURE__ */ (0, z.jsxs)("form", {className: "flex flex-col gap-4",@@ -21512,7 +21603,7 @@ function Ug({ onDone: e }) {}//#endregion//#region src/react/pages/setup/setup-page.tsx-function Wg() {+function Jg() {let [e, t] = (0, w.useState)({ kind: "loading" }), [n, r] = (0, w.useState)(0), [i, a] = (0, w.useState)(!1);return (0, w.useEffect)(() => {let e = new AbortController();@@ -21550,10 +21641,10 @@ function Wg() {className: "self-start",onClick: () => a((e) => !e),children: i ? "返回首次设置" : "使用已有数据目录"- }), i ? /* @__PURE__ */ (0, z.jsx)(Ug, { onDone: (e) => t({+ }), i ? /* @__PURE__ */ (0, z.jsx)(qg, { onDone: (e) => t({kind: "done",done: e- }) }) : /* @__PURE__ */ (0, z.jsx)(Hg, {+ }) }) : /* @__PURE__ */ (0, z.jsx)(Kg, {setup: e.setup,onDone: (e) => t({kind: "done",@@ -21565,14 +21656,14 @@ function Wg() {}//#endregion//#region src/react/pages/index.tsx-var Gg = {- setup: Wg,+var Yg = {+ setup: Jg,login: qp,error: Pt};h();-var Kg = document.getElementById("peach-page"), qg = Kg ? Gg[Kg.dataset.page ?? ""] : void 0;-Kg && qg && (0, T.createRoot)(Kg).render(/* @__PURE__ */ (0, z.jsx)(qg, { data: { ...Kg.dataset } }));+var Xg = document.getElementById("peach-page"), Zg = Xg ? Yg[Xg.dataset.page ?? ""] : void 0;+Xg && Zg && (0, T.createRoot)(Xg).render(/* @__PURE__ */ (0, z.jsx)(Zg, { data: { ...Xg.dataset } }));//#endregion-//# debugId=dc5896a3-4b3d-442d-8d1d-89106f5ea16c\ No newline at end of file+//# debugId=09a4a8f3-a34b-4be4-ba4c-29b73db498f1\ No newline at end of file