// frontend/src/pages/SettingsPage.jsx import { useRef } from 'react'; import { CheckCircle2, Download, RefreshCw, Upload, XCircle } from 'lucide-react'; import useSettingsForm from '../hooks/useSettingsForm'; import CorePathsSection from '../components/settings/CorePathsSection'; import AdvancedStrategySection from '../components/settings/AdvancedStrategySection'; import ScheduleSection from '../components/settings/ScheduleSection'; import NotificationSection from '../components/settings/NotificationSection'; import MetadataServicesSection from '../components/settings/MetadataServicesSection'; import ConfigExportDialog from '../components/settings/ConfigExportDialog'; import ConfigImportDialog from '../components/settings/ConfigImportDialog'; export default function SettingsPage({ config, setConfig, setTaskState }) { const { localConfig, netStatus, toast, isSaving, isExportDialogOpen, isExporting, exportPassword, exportPasswordConfirm, importDialog, fileInputRef, updateField, handleSave, setExportPassword, setExportPasswordConfirm, handleOpenExportDialog, handleCloseExportDialog, handleExportConfig, handleImportButtonClick, handleImportFileChange, handleCloseImportDialog, handleImportDecrypt, handleImportConfirm } = useSettingsForm({ config, setConfig, setTaskState }); const updateNested = (section, value) => { // Create a new localConfig with the nested section updated // useSettingsForm doesn't have updateNestedField exposed directly, // so we use updateField for top-level fields, and for nested // sections we pass the merged object directly. // The section components call onUpdate with the section name and // the full merged object for that section. }; return (
{/* Header */}

系统运行配置

全局基础目录设定及核心入库引擎的高级策略配置。

{/* Hidden file input for import */} {/* Toast notification */} {toast && (
{toast.type === 'success' ? : } {toast.message}
)} {/* Configuration Sections */}
updateField(field, value)} /> updateField(section, value)} /> updateField(section, value)} /> updateField(section, value)} /> updateField(section, value)} />
{/* Dialogs */}
); }