Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(web): 外部入口只留两个地址框,默认值走占位符

longmeidaoafcd24d76be7
diff --git a/frontend/src/react/bundle.d.ts b/frontend/src/react/bundle.d.ts
index 8a617b548..5d7c05221 100644
--- a/frontend/src/react/bundle.d.ts
+++ b/frontend/src/react/bundle.d.ts
@@ -37,13 +37,12 @@ export interface UninstallState {
export interface PeachProxyState { mode: string; proxy_saved: boolean; needs_selection: boolean }
-/** 人物资料页上的一枚外部入口。只此一家的站点 `host` 与 `default_host` 都是 null。 */
+/** 一个能换镜像域名的外部入口站点。`host` 为空串就是没换过,走 `default_host`。 */
export interface EntryLinkSite {
key: string;
label: string;
- enabled: boolean;
- host: string | null;
- default_host: string | null;
+ host: string;
+ default_host: string;
}
export interface EntryLinksState { sites: EntryLinkSite[] }
diff --git a/frontend/src/react/settings/entry-links-settings.tsx b/frontend/src/react/settings/entry-links-settings.tsx
index 68b2f1ba2..fa5396ea7 100644
--- a/frontend/src/react/settings/entry-links-settings.tsx
+++ b/frontend/src/react/settings/entry-links-settings.tsx
@@ -1,20 +1,19 @@
-/* 「外部入口」:人物资料页上通向 みんなのAV、JavDB 与 MISSAV 的那三枚直达入口。
+/* 「外部入口」:人物资料页上通向 みんなのAV、JavDB 与 MISSAV 的那几枚直达入口。
*
- * 每站一个开关;JavDB 与 MISSAV 多一个镜像域名框,这两站主域名连不上时在这里换。地址
- * 由服务端拼(`peach.entry_links`),路径与占位符都在它那边——站点 id 与规范名都在账本
- * 里,前端拿不到也不该拿。`host` 是 null 的站点没有镜像可换,只画开关。
+ * 这里只有 JavDB 与 MISSAV 两个地址框,这两站主域名连不上时在这里换成能打开的镜像;
+ * みんなのAV 只此一家,没有可换的东西,它不出现在这一页上。框默认是空的,占位符写着
+ * 当前在用的那个域名——默认值不需要使用者先抄一遍,清空就回到它。
*
- * 校验也只在服务端:哪种地址算得上一条入口是它说了算,前端复制一份判定只会漂。 */
+ * 入口出不出现不由这里决定:地址由服务端拼(`peach.entry_links`),站点 id 缺席那一枚
+ * 就不在资料页上,所以这里没有开关。校验也只在服务端,前端复制一份判定只会漂。 */
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 { Switch } from '@/components/base/switch/switch';
import { apiSend } from '../../api';
import type { EntryLinkSite, EntryLinksState } from '../bundle';
-import { ErrorText, Footer, Help, Rows, Section, Stack } from './section';
+import { ErrorText, Footer, Help, Section, Stack } from './section';
import { busyProps, useAction } from './use-action';
export function EntryLinksForm({ initial, receipt }: {
@@ -24,16 +23,12 @@ export function EntryLinksForm({ initial, receipt }: {
const [sites, setSites] = useState<EntryLinkSite[]>(initial.sites);
const action = useAction();
- const change = (key: string, patch: Partial<EntryLinkSite>) =>
- setSites((rows) => rows.map((row) => (row.key === key ? { ...row, ...patch } : row)));
+ const change = (key: string, host: string) =>
+ setSites((rows) => rows.map((row) => (row.key === key ? { ...row, host } : row)));
const submit = (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
- const body = {
- sites: Object.fromEntries(sites.map((site) =>
- [site.key, site.host === null ? { enabled: site.enabled }
- : { enabled: site.enabled, host: site.host }])),
- };
+ const body = { sites: Object.fromEntries(sites.map((site) => [site.key, { host: site.host }])) };
void action.run('save', (signal) =>
apiSend<EntryLinksState>('/api/configuration/entry-links', body, 'POST', signal),
(next) => {
@@ -44,26 +39,17 @@ export function EntryLinksForm({ initial, receipt }: {
return (
<Section title="外部入口" onSubmit={submit}>
- <Rows>
- {sites.map((site) => (
- <SettingsRow key={site.key} label={site.label}
- description="在女优资料页给出这个站点的直达入口。">
- <Switch aria-label={`在资料页显示 ${site.label} 入口`} isSelected={site.enabled}
- onChange={(enabled) => change(site.key, { enabled })} />
- </SettingsRow>
- ))}
- </Rows>
<Stack divided>
<Help>账本里没有这个站点 id 的人物不显示它那一枚入口,地址不会退回站内搜索。
JavDB 与 MISSAV 只收 JAV 女优,这两枚还要账本里有哪个 JAV 目录站给过她 id 才出现;
FC2 个人摄那类创作者没有这种 id,资料页上也就没有这一行。
这两站的主域名连不上时,把能打开的那个镜像域名填在下面,后面的路径由 Peach 自己拼。</Help>
- {sites.filter((site) => site.host !== null).map((site) => (
- <Input key={site.key} id={`entry-link-${site.key}`} label={`${site.label} 镜像域名`}
- autoComplete="off" maxLength={100} value={site.host ?? ''}
- onChange={(host) => change(site.key, { host })}
- validationBehavior="aria"
- hint={`只写域名本身,默认 ${site.default_host}`} />
+ {sites.map((site) => (
+ <Input key={site.key} id={`entry-link-${site.key}`} label={`${site.label} 地址`}
+ autoComplete="off" maxLength={100} value={site.host}
+ placeholder={site.default_host}
+ onChange={(host) => change(site.key, host)}
+ validationBehavior="aria" hint="只写域名本身,留空就是默认" />
))}
{action.error ? <ErrorText>{action.error}</ErrorText> : null}
</Stack>
diff --git a/frontend/test/react/entry-links.test.tsx b/frontend/test/react/entry-links.test.tsx
index 8211b41bd..af6d3f8a0 100644
--- a/frontend/test/react/entry-links.test.tsx
+++ b/frontend/test/react/entry-links.test.tsx
@@ -2,7 +2,7 @@ import { expect, it, vi } from 'vitest';
import { GeneralSettings } from '../../src/react/settings/general-settings';
import type { ConfigurationData, EntryLinksState } from '../../src/react/bundle';
-import { buttonNamed, click, fetchMock, mount, sentBody, settle, submit, switches, type } from './render';
+import { buttonNamed, fetchMock, mount, sentBody, settle, submit, switches, type } from './render';
const data = (over: Partial<ConfigurationData> = {}): ConfigurationData => ({
editable: true, notice: '', revision: 'rev-1', media_dirs: [], port: 9123, facts: [], ...over,
@@ -10,35 +10,33 @@ const data = (over: Partial<ConfigurationData> = {}): ConfigurationData => ({
const state: EntryLinksState = {
sites: [
- { key: 'javdb', label: 'JavDB', enabled: true, host: 'javdb.com', default_host: 'javdb.com' },
- { key: 'minnano-av', label: 'minnano-av', enabled: true, host: null, default_host: null },
- { key: 'missav', label: 'MISSAV', enabled: false, host: 'missav.ws', default_host: 'missav.ws' },
+ { key: 'javdb', label: 'JavDB', host: '', default_host: 'javdb.com' },
+ { key: 'missav', label: 'MISSAV', host: 'missav.ai', default_host: 'missav.ws' },
],
};
-it('外部入口:三站各一颗开关,有镜像的两站各一个域名框,保存发出实际值', async () => {
+it('外部入口:能换镜像的两站各一个地址框,默认留空,保存发出框里的值', async () => {
const fetcher = fetchMock(200, state);
vi.stubGlobal('fetch', fetcher);
const receipt = vi.fn();
const host = await mount(<GeneralSettings data={data({ entry_links: state })} receipt={receipt} />);
- expect(switches(host).map((input) => input.getAttribute('aria-label')))
- .toEqual(['在资料页显示 JavDB 入口', '在资料页显示 minnano-av 入口', '在资料页显示 MISSAV 入口']);
- expect(switches(host).map((input) => input.checked)).toEqual([true, true, false]);
- // みんなのAV 只此一家,没有域名可换,那一行就不该出现一个填了也没用的框。
+ // 入口出不出现由账本里有没有站点 id 决定,三枚按钮自己就在资料页上,这里没有开关。
+ expect(switches(host)).toEqual([]);
+ // みんなのAV 只此一家,没有域名可换,它不出现在这一页上。
expect(host.querySelector('#entry-link-minnano-av')).toBeNull();
- expect(host.textContent).toContain('只写域名本身,默认 javdb.com');
- await click(switches(host)[2]);
- await type(host.querySelector('#entry-link-javdb'), 'javdb521.com');
+ const javdb = host.querySelector<HTMLInputElement>('#entry-link-javdb');
+ // 默认值不要人先抄一遍:框是空的,当前在用的那个域名写在占位符里。
+ expect(javdb?.value).toBe('');
+ expect(javdb?.placeholder).toBe('javdb.com');
+ expect(host.textContent).toContain('JavDB 地址');
+ expect(host.textContent).not.toContain('地址模板');
+ await type(javdb, 'javdb521.com');
expect(fetcher).not.toHaveBeenCalled();
await submit(host.querySelector('form'));
await settle();
expect(fetcher.mock.calls[0]?.[0]).toBe('/api/configuration/entry-links');
expect(sentBody(fetcher)).toEqual({
- sites: {
- javdb: { enabled: true, host: 'javdb521.com' },
- 'minnano-av': { enabled: true },
- missav: { enabled: true, host: 'missav.ws' },
- },
+ sites: { javdb: { host: 'javdb521.com' }, missav: { host: 'missav.ai' } },
});
expect(receipt).toHaveBeenCalledWith('已保存配置');
});
diff --git a/src/peach/entry_links.py b/src/peach/entry_links.py
index 4267d4661..6c17b496b 100644
--- a/src/peach/entry_links.py
+++ b/src/peach/entry_links.py
@@ -1,4 +1,4 @@
-"""人物资料页的外部入口:几个站点的直达地址,以及它们的本机开关与镜像域名。
+"""人物资料页的外部入口:几个站点的直达地址,以及其中两站可换的镜像域名。
入口只由后端拼:地址要用的东西都在服务端——`entity_external_ref` 里的站点 id、
`entity.canonical_name` 和 `entity_alias`。前端拿到的是一串带位置与标记的
@@ -31,10 +31,13 @@
**两种位置。** minnano-av 是一份资料页,和事务所官网、社媒是同一类东西,所以它排进上面
那排链接里。JavDB 与 MISSAV 是「去看片」的入口,另起一行,用两站自己的标识。
-**能改的只有域名。** JavDB 与 MISSAV 各有一排可换的镜像域名,主域名连不上时得跟着换,
-所以配置页给这两站各留一个域名框;路径与占位符都由这里定死。整条模板不交给使用者填:
-占位符写错换来的是一排看着正常、点开全是 404 的入口,而域名对不对点一次就知道。
-みんなのAV 只此一家,它那一行只有开关。
+**配置页只有两个域名框。** JavDB 与 MISSAV 各有一排可换的镜像域名,主域名连不上时得跟着
+换,所以这两站各留一个框,留空就是上面那个默认域名;路径与占位符由这里定死。整条模板不
+交给使用者填:占位符写错换来的是一排看着正常、点开全是 404 的入口,而域名对不对点一次
+就知道。みんなのAV 只此一家,没有可换的东西,它不出现在配置页上。
+
+**没有开关。** 入口本来就按账本里有没有 id 决定出不出现,三枚按钮自己就在资料页上;
+再给每站一个开关,是让人到设置里关掉一枚他在页面上根本没见到过的入口。
"""
from __future__ import annotations
@@ -112,24 +115,22 @@ _STAGE_NAME_SOURCES = ("avdb-actor-mapping", "javdb", "wiki")
def defaults() -> dict:
- """各站全开,域名即上面那几条。"""
- return {site.key: {"enabled": True, "host": site.host} for site in SITES}
+ """一个域名都没换过:能换的那两站留空,读的时候各自退回自己的默认域名。"""
+ return {site.key: {"host": ""} for site in SITES if site.mirrored}
def _clean(saved: object) -> dict:
- """把读到的内容收敛成已知站点。坏值退回默认,不让一个手改坏的文件关掉整行入口。"""
+ """把读到的内容收敛成已知站点。坏值退回默认,不让一个手改坏的文件废掉整行入口。"""
result = defaults()
if not isinstance(saved, dict):
return result
rows = saved.get("sites")
for key, value in (rows.items() if isinstance(rows, dict) else ()):
site = _BY_KEY.get(str(key))
- if site is None or not isinstance(value, dict):
+ if site is None or not site.mirrored or not isinstance(value, dict):
continue
- if isinstance(value.get("enabled"), bool):
- result[site.key]["enabled"] = value["enabled"]
host = _tidy_host(value.get("host"))
- if site.mirrored and _host_problem(site, host) == "":
+ if _host_problem(site, host) == "":
result[site.key]["host"] = host
return result
@@ -143,15 +144,14 @@ def read(root: Path) -> dict:
def snapshot(root: Path) -> dict:
- """配置页要的形状:每站一行;能换域名的多给当前域名和可恢复的默认值。"""
+ """配置页要的形状:只有能换域名的那几站,各带当前值和留空时用的默认域名。"""
saved = read(root)
return {"sites": [{
"key": site.key,
"label": site.title,
- "enabled": saved[site.key]["enabled"],
- "host": saved[site.key]["host"] if site.mirrored else None,
- "default_host": site.host if site.mirrored else None,
- } for site in SITES]}
+ "host": saved[site.key]["host"],
+ "default_host": site.host,
+ } for site in SITES if site.mirrored]}
def _tidy_host(written: object) -> str:
@@ -169,33 +169,34 @@ def _tidy_host(written: object) -> str:
def _host_problem(site: EntrySite, host: str) -> str:
- """域名不能用时的那一句原因;能用时是空串。"""
+ """域名不能用时的那一句原因;能用时是空串。
+
+ 空串本身可用——它就是「没换过,走默认域名」。要回到默认值,清空这个框就行;逼人去
+ 手抄一遍默认域名的话,抄错了还得他自己认。
+ """
if not host:
- return f"{site.title} 的镜像域名不能为空"
+ return ""
if len(host) > _HOST_LIMIT:
- return f"{site.title} 的镜像域名请控制在 {_HOST_LIMIT} 个字符以内"
+ return f"{site.title} 的地址请控制在 {_HOST_LIMIT} 个字符以内"
if not _HOST_SHAPE.fullmatch(host):
return f"{site.title} 这里只写域名本身,像 {site.host}"
return ""
def save(root: Path, body: dict) -> dict:
- """写回各站的开关与镜像域名。任一项不合规就整批不写。"""
+ """写回可换的那几站的域名。任一项不合规就整批不写。"""
rows = body.get("sites")
if not isinstance(rows, dict):
- raise ValueError("请提交每个站点的开关与镜像域名")
+ raise ValueError("请提交每个站点的地址")
result = defaults()
for site in SITES:
+ if not site.mirrored:
+ continue
row = rows.get(site.key)
if not isinstance(row, dict):
raise ValueError(f"缺少 {site.title} 的设置")
- if not isinstance(row.get("enabled"), bool):
- raise ValueError(f"{site.title} 的开关必须是 true 或 false")
- result[site.key]["enabled"] = row["enabled"]
- if not site.mirrored:
- continue
if not isinstance(row.get("host"), str):
- raise ValueError(f"{site.title} 的镜像域名必须是文字")
+ raise ValueError(f"{site.title} 的地址必须是文字")
host = _tidy_host(row["host"])
problem = _host_problem(site, host)
if problem:
@@ -276,11 +277,11 @@ def build(settings: dict, canonical_name: str, refs, aliases=()) -> list[dict]:
out: list[dict] = []
for site in SITES:
row = settings.get(site.key) or {}
- if not row.get("enabled", True) or (site.jav_only and not jav):
+ if site.jav_only and not jav:
continue
values = ids.get(site.provider, []) if site.provider else ([written] if written else [])
host = _tidy_host(row.get("host")) if site.mirrored else site.host
- if _host_problem(site, host):
+ if not host or _host_problem(site, host):
host = site.host
for index, value in enumerate(values):
ordinal = _ordinal(index)
diff --git a/tests/test_desktop_settings.py b/tests/test_desktop_settings.py
index 55c588fab..6cb204fff 100644
--- a/tests/test_desktop_settings.py
+++ b/tests/test_desktop_settings.py
@@ -152,9 +152,8 @@ class DesktopSettingsTests(unittest.TestCase):
self.assertEqual(client.post('/api/configuration/startup',json={'enabled':'false','silent':True}).status_code,400)
self.assertEqual(client.post('/api/configuration/peach-proxy',json={'mode':'proxy','proxy':'invalid'}).status_code,400)
# 外部入口:域名不成形时整批不写,落下去的会是一排点过去必然落空的入口。
- sites = {site.key: ({'enabled': True, 'host': site.host} if site.mirrored
- else {'enabled': True})
- for site in entry_links.SITES}
+ sites = {site.key: {'host': site.host}
+ for site in entry_links.SITES if site.mirrored}
self.assertEqual(client.post('/api/configuration/entry-links',json={'sites':sites}).status_code,200)
broken = {key: dict(row) for key, row in sites.items()}
broken['javdb']['host'] = 'javdb.com/actors'
diff --git a/tests/test_entry_links.py b/tests/test_entry_links.py
index 6116c4975..48e9c02e2 100644
--- a/tests/test_entry_links.py
+++ b/tests/test_entry_links.py
@@ -120,12 +120,6 @@ class EntryLinkAddressTests(unittest.TestCase):
[ref("minnano-av", "110", kind="production")])
self.assertEqual(rows, [])
- def test_a_closed_site_drops_out(self):
- settings = entry_links.defaults()
- settings["missav"]["enabled"] = False
- rows = entry_links.build(settings, "七沢みあ", [ref("javdb", "NPD3")])
- self.assertEqual([row["site"] for row in rows], ["javdb"])
-
def test_a_mirror_domain_replaces_only_the_host(self):
settings = entry_links.defaults()
settings["javdb"]["host"] = "javdb521.com"
@@ -139,6 +133,11 @@ class EntryLinkAddressTests(unittest.TestCase):
rows = entry_links.build(settings, "七沢みあ", [ref("javdb", "NPD3")])
self.assertEqual(rows[0]["url"], "https://javdb.com/actors/NPD3")
+ def test_an_empty_domain_means_the_default_one(self):
+ """配置页那个框默认就是空的:留空是「没换过」,不是「没有地址」。"""
+ rows = entry_links.build({"javdb": {"host": ""}}, "七沢みあ", [ref("javdb", "NPD3")])
+ self.assertEqual(rows[0]["url"], "https://javdb.com/actors/NPD3")
+
class EntryLinkSettingsFileTests(unittest.TestCase):
def setUp(self):
@@ -147,53 +146,48 @@ class EntryLinkSettingsFileTests(unittest.TestCase):
self.root = Path(temporary.name).resolve()
def body(self, **changed: dict) -> dict:
- """配置页提交的形状:每站一行,能换域名的带上域名。"""
- sites = {site.key: ({"enabled": True, "host": site.host} if site.mirrored
- else {"enabled": True})
- for site in entry_links.SITES}
+ """配置页提交的形状:能换域名的那几站各一行,值就是框里写的那串。"""
+ sites = {site.key: {"host": ""} for site in entry_links.SITES if site.mirrored}
sites.update(changed)
return {"sites": sites}
- def test_an_absent_file_reads_as_every_site_open(self):
+ def test_an_absent_file_reads_as_no_domain_changed(self):
+ """配置页只管能换域名的那两站;みんなのAV 只此一家,不在这份设置里。"""
saved = entry_links.read(self.root)
- self.assertEqual(sorted(saved), ["javdb", "minnano-av", "missav"])
- self.assertTrue(all(row["enabled"] for row in saved.values()))
+ self.assertEqual(sorted(saved), ["javdb", "missav"])
+ self.assertTrue(all(row["host"] == "" for row in saved.values()))
def test_saving_round_trips_through_the_snapshot(self):
- entry_links.save(self.root, self.body(javdb={"enabled": False,
- "host": "javdb521.com"}))
+ entry_links.save(self.root, self.body(javdb={"host": "javdb521.com"}))
rows = {row["key"]: row for row in entry_links.snapshot(self.root)["sites"]}
- self.assertFalse(rows["javdb"]["enabled"])
+ self.assertEqual(sorted(rows), ["javdb", "missav"])
self.assertEqual(rows["javdb"]["host"], "javdb521.com")
self.assertEqual(rows["javdb"]["default_host"], "javdb.com")
self.assertEqual(rows["javdb"]["label"], "JavDB")
- # みんなのAV 没有镜像可换,配置页据此只给它一个开关。
- self.assertIsNone(rows["minnano-av"]["host"])
- self.assertIsNone(rows["minnano-av"]["default_host"])
+ # 没动过的那一站留空:框里显示的是占位符,不是一串要人去认的默认值。
+ self.assertEqual(rows["missav"]["host"], "")
+ self.assertEqual(rows["missav"]["default_host"], "missav.ws")
def test_a_pasted_address_is_trimmed_down_to_its_domain(self):
"""镜像地址多半是整条复制过来的,前缀与末尾的斜杠不值得弹一条错误。"""
- entry_links.save(self.root, self.body(missav={"enabled": True,
- "host": "https://missav.ai/"}))
+ entry_links.save(self.root, self.body(missav={"host": "https://missav.ai/"}))
self.assertEqual(entry_links.read(self.root)["missav"]["host"], "missav.ai")
def test_an_address_with_a_path_is_refused(self):
with self.assertRaises(ValueError) as caught:
entry_links.save(self.root, self.body(
- javdb={"enabled": True, "host": "javdb.com/actors/{javdb_id}"}))
+ javdb={"host": "javdb.com/actors/{javdb_id}"}))
self.assertIn("只写域名本身", str(caught.exception))
- def test_an_empty_domain_is_refused(self):
- with self.assertRaises(ValueError) as caught:
- entry_links.save(self.root, self.body(missav={"enabled": True, "host": " "}))
- self.assertIn("不能为空", str(caught.exception))
+ def test_clearing_the_box_goes_back_to_the_default_domain(self):
+ entry_links.save(self.root, self.body(missav={"host": "missav.ai"}))
+ entry_links.save(self.root, self.body(missav={"host": " "}))
+ self.assertEqual(entry_links.read(self.root)["missav"]["host"], "")
def test_a_hand_broken_file_falls_back_instead_of_emptying_the_row(self):
(self.root / entry_links.FILENAME).write_text(
json.dumps({"sites": {"javdb": {"host": "not a domain"}}}), encoding="utf-8")
- saved = entry_links.read(self.root)
- self.assertEqual(saved["javdb"]["host"], "javdb.com")
- self.assertTrue(saved["javdb"]["enabled"])
+ self.assertEqual(entry_links.read(self.root)["javdb"]["host"], "")
if __name__ == "__main__":
diff --git a/web/dist/peach-react.js b/web/dist/peach-react.js
index cf7b23b25..deb5b45a7 100644
--- a/web/dist/peach-react.js
+++ b/web/dist/peach-react.js
@@ -31961,53 +31961,39 @@ async function vD(e) {
function yD({ initial: e, receipt: t }) {
let [n, r] = (0, C.useState)(e.sites), i = _b(), a = (e, t) => r((n) => n.map((n) => n.key === e ? {
...n,
- ...t
+ host: t
} : n));
return /* @__PURE__ */ (0, w.jsxs)(MS, {
title: "外部入口",
onSubmit: (e) => {
e.preventDefault();
- let a = { sites: Object.fromEntries(n.map((e) => [e.key, {
- enabled: e.enabled,
- template: e.template
- }])) };
+ let a = { sites: Object.fromEntries(n.map((e) => [e.key, { host: e.host }])) };
i.run("save", (e) => $m("/api/configuration/entry-links", a, "POST", e), (e) => {
r(e.sites), t("已保存配置");
});
},
- children: [
- /* @__PURE__ */ (0, w.jsx)(NS, { children: n.map((e) => /* @__PURE__ */ (0, w.jsx)(kS, {
- label: e.label,
- description: "在女优资料页给出这个站点的直达入口。",
- children: /* @__PURE__ */ (0, w.jsx)(Ib, {
- "aria-label": `在资料页显示 ${e.label} 入口`,
- isSelected: e.enabled,
- onChange: (t) => a(e.key, { enabled: t })
- })
- }, e.key)) }),
- /* @__PURE__ */ (0, w.jsxs)(PS, {
- divided: !0,
- children: [
- /* @__PURE__ */ (0, w.jsx)(IS, { children: "账本里没有这个站点 id 的人物不显示它那一枚入口,地址不会退回站内搜索。 JavDB 与 MISSAV 只收 JAV 女优,这两枚还要账本里有哪个 JAV 目录站给过她 id 才出现; FC2 个人摄那类创作者没有这种 id,资料页上也就没有这一行。" }),
- n.map((e) => /* @__PURE__ */ (0, w.jsx)(eb, {
- id: `entry-link-${e.key}`,
- label: `${e.label} 地址模板`,
- autoComplete: "off",
- maxLength: 300,
- value: e.template,
- onChange: (t) => a(e.key, { template: t }),
- validationBehavior: "aria",
- hint: `用 {${e.placeholder}} 占位,默认 ${e.default_template}`
- }, e.key)),
- i.error ? /* @__PURE__ */ (0, w.jsx)(LS, { children: i.error }) : null
- ]
- }),
- /* @__PURE__ */ (0, w.jsx)(FS, { children: /* @__PURE__ */ (0, w.jsx)(X, {
- type: "submit",
- ...Z(i.busy === "save"),
- children: "保存配置"
- }) })
- ]
+ children: [/* @__PURE__ */ (0, w.jsxs)(PS, {
+ divided: !0,
+ children: [
+ /* @__PURE__ */ (0, w.jsx)(IS, { children: "账本里没有这个站点 id 的人物不显示它那一枚入口,地址不会退回站内搜索。 JavDB 与 MISSAV 只收 JAV 女优,这两枚还要账本里有哪个 JAV 目录站给过她 id 才出现; FC2 个人摄那类创作者没有这种 id,资料页上也就没有这一行。 这两站的主域名连不上时,把能打开的那个镜像域名填在下面,后面的路径由 Peach 自己拼。" }),
+ n.map((e) => /* @__PURE__ */ (0, w.jsx)(eb, {
+ id: `entry-link-${e.key}`,
+ label: `${e.label} 地址`,
+ autoComplete: "off",
+ maxLength: 100,
+ value: e.host,
+ placeholder: e.default_host,
+ onChange: (t) => a(e.key, t),
+ validationBehavior: "aria",
+ hint: "只写域名本身,留空就是默认"
+ }, e.key)),
+ i.error ? /* @__PURE__ */ (0, w.jsx)(LS, { children: i.error }) : null
+ ]
+ }), /* @__PURE__ */ (0, w.jsx)(FS, { children: /* @__PURE__ */ (0, w.jsx)(X, {
+ type: "submit",
+ ...Z(i.busy === "save"),
+ children: "保存配置"
+ }) })]
});
}
//#endregion
@@ -32315,14 +32301,14 @@ function jD({ data: e, receipt: t, reopenTutorial: n }) {
}) : null,
/* @__PURE__ */ (0, w.jsx)(TD, {}),
/* @__PURE__ */ (0, w.jsx)(PD, { facts: e.facts }),
- e.uninstall ? /* @__PURE__ */ (0, w.jsx)(FD, {
- uninstall: e.uninstall,
- receipt: t
- }) : null,
/* @__PURE__ */ (0, w.jsx)(MD, {
receipt: t,
reopenTutorial: n
- })
+ }),
+ e.uninstall ? /* @__PURE__ */ (0, w.jsx)(FD, {
+ uninstall: e.uninstall,
+ receipt: t
+ }) : null
]
});
}