- /console/settings#<section>[/<anchor>]; legacy ?tab= redirected in clientLoader - SETTINGS_SECTIONS in contracts with field-ownership test - Agent section: upstream list, create wizard (provider -> credentials/model -> login/test/default), edit drawer with OAuth browser/device login, test, set default, delete - sites section with site registration, snapshot/rate-limit drawer and account credentials - path mappings moved into downloader / media-server drawers; metadata and account sections Co-Authored-By: Claude Opus 5.5 <[email protected]>
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import { LibraryRootsTable } from "./instances.tsx";
|
|
import { str } from "./resource-section.tsx";
|
|
import { SettingsBlock } from "./settings-block.tsx";
|
|
import { type CardSpec, SettingsCard, SettingsGate } from "./settings-card.tsx";
|
|
|
|
// 媒体库与目录:库根(含哨兵状态)+ 默认整理方式
|
|
|
|
const ORGANIZE_CARD: CardSpec = {
|
|
anchor: "organize",
|
|
title: "整理方式",
|
|
description: "复制入库时源文件留在缓存继续做种,保留天数在自动化分区设置。",
|
|
fields: [
|
|
{
|
|
name: "organize.defaultMode",
|
|
label: "默认整理方式",
|
|
kind: "select",
|
|
options: [
|
|
{ value: "copy", label: "复制(源文件继续做种)" },
|
|
{ value: "move", label: "移动(移走源文件)" },
|
|
],
|
|
},
|
|
{
|
|
name: "organize.allowCrossVolumeMove",
|
|
label: "允许跨卷移动",
|
|
kind: "switch",
|
|
hint: "跨卷时按复制 → 核验 → 删源执行",
|
|
},
|
|
],
|
|
fromSettings: (s) => ({
|
|
"organize.defaultMode": s.organize.defaultMode,
|
|
"organize.allowCrossVolumeMove": s.organize.allowCrossVolumeMove,
|
|
}),
|
|
toPatch: (v) => ({
|
|
organize: {
|
|
defaultMode: str(v["organize.defaultMode"]) as "copy" | "move",
|
|
allowCrossVolumeMove: v["organize.allowCrossVolumeMove"] === true,
|
|
},
|
|
}),
|
|
};
|
|
|
|
export function LibrarySection() {
|
|
return (
|
|
<div className="grid gap-8">
|
|
<SettingsBlock section="library" anchor="roots" title="库根" plain>
|
|
<LibraryRootsTable />
|
|
</SettingsBlock>
|
|
<SettingsGate>{(s) => <SettingsCard section="library" spec={ORGANIZE_CARD} settings={s} />}</SettingsGate>
|
|
</div>
|
|
);
|
|
}
|