Skip to content

armgit / peach

Public Imported from GitHub
0

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

fix(web): 外部入口的说明上面不画分隔线

longmeidaobb0fb17e3ebd
diff --git a/frontend/src/react/settings/entry-links-settings.tsx b/frontend/src/react/settings/entry-links-settings.tsx
index fa5396ea7..1d09fd4e9 100644
--- a/frontend/src/react/settings/entry-links-settings.tsx
+++ b/frontend/src/react/settings/entry-links-settings.tsx
@@ -39,7 +39,7 @@ export function EntryLinksForm({ initial, receipt }: {
return (
<Section title="外部入口" onSubmit={submit}>
- <Stack divided>
+ <Stack>
<Help>账本里没有这个站点 id 的人物不显示它那一枚入口,地址不会退回站内搜索。
JavDB 与 MISSAV 只收 JAV 女优,这两枚还要账本里有哪个 JAV 目录站给过她 id 才出现;
FC2 个人摄那类创作者没有这种 id,资料页上也就没有这一行。
diff --git a/frontend/test/react/entry-links.test.tsx b/frontend/test/react/entry-links.test.tsx
index af6d3f8a0..e253a2510 100644
--- a/frontend/test/react/entry-links.test.tsx
+++ b/frontend/test/react/entry-links.test.tsx
@@ -41,6 +41,17 @@ it('外部入口:能换镜像的两站各一个地址框,默认留空,保
expect(receipt).toHaveBeenCalledWith('已保存配置');
});
+it('外部入口:说明就是卡里的头一块,它上面不画线', async () => {
+ const host = await mount(<GeneralSettings data={data({ entry_links: state })} receipt={vi.fn()} />);
+ const help = [...host.querySelectorAll('p')]
+ .find((node) => node.textContent?.startsWith('账本里没有这个站点 id'));
+ const block = help?.parentElement;
+ // 那道线是给排在设置行后面的块用的,分隔的是它和上面那组行。这张卡里它自己就是头一块,
+ // 线画出来上面什么也没有,读成分区标题自带一条下边线。
+ expect(block?.previousElementSibling).toBeNull();
+ expect(block?.className).not.toContain('border-t');
+});
+
it('服务端没下发外部入口时通用组里不画这一节', async () => {
// 站点清单由服务端给。前端自己兜一份默认的话,那份迟早和 `peach.entry_links` 分叉。
const host = await mount(<GeneralSettings data={data()} receipt={vi.fn()} />);
diff --git a/web/dist/peach-react.js b/web/dist/peach-react.js
index b18119d7b..4cfe6e982 100644
--- a/web/dist/peach-react.js
+++ b/web/dist/peach-react.js
@@ -32210,24 +32210,21 @@ function DD({ initial: e, receipt: t }) {
r(e.sites), t("已保存配置");
});
},
- 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, {
+ children: [/* @__PURE__ */ (0, w.jsxs)(PS, { 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: "保存配置"