0.11.0 Multi LW

This commit is contained in:
michael committed 2026-03-17 19:58:32 +00:00
1 parent 16443c8a45
commit 16c783e1aa
25 files changed
+811 -960

No files matched your search

+31 -1
View File
@@ -110,6 +110,7 @@ function App() {
const [pipeline, setPipeline] = useState({ state: 'IDLE', progress: 0, context: {} });
const [hardwareMonitoring, setHardwareMonitoring] = useState(null);
const [lastDiscEvent, setLastDiscEvent] = useState(null);
const [expertMode, setExpertMode] = useState(false);
const [audiobookUpload, setAudiobookUpload] = useState(() => createInitialAudiobookUploadState());
const [dashboardJobsRefreshToken, setDashboardJobsRefreshToken] = useState(0);
const [historyJobsRefreshToken, setHistoryJobsRefreshToken] = useState(0);
@@ -232,6 +233,13 @@ function App() {
setDownloadSummary(response?.summary || null);
})
.catch(() => null);
api.getSettings()
.then((response) => {
const allSettings = (response?.categories || []).flatMap((c) => c.settings || []);
const val = allSettings.find((s) => s.key === 'ui_expert_mode')?.value;
setExpertMode(val === 'true' || val === true);
})
.catch(() => null);
}, []);
useWebSocket({
@@ -307,6 +315,27 @@ function App() {
setHardwareMonitoring(message.payload || null);
}
if (message.type === 'SETTINGS_UPDATED') {
const setting = message.payload;
if (setting?.key === 'ui_expert_mode') {
const val = setting?.value;
setExpertMode(val === 'true' || val === true);
}
}
if (message.type === 'SETTINGS_BULK_UPDATED') {
const keys = message.payload?.keys || [];
if (keys.includes('ui_expert_mode')) {
api.getSettings({ forceRefresh: true })
.then((response) => {
const allSettings = (response?.categories || []).flatMap((c) => c.settings || []);
const val = allSettings.find((s) => s.key === 'ui_expert_mode')?.value;
setExpertMode(val === 'true' || val === true);
})
.catch(() => null);
}
}
if (message.type === 'DOWNLOADS_UPDATED') {
const summary = message.payload?.summary && typeof message.payload.summary === 'object'
? message.payload.summary
@@ -346,7 +375,8 @@ function App() {
{ label: 'Dashboard', path: '/' },
{ label: 'Settings', path: '/settings' },
{ label: 'Historie', path: '/history' },
{ label: 'Downloads', path: '/downloads' }
{ label: 'Downloads', path: '/downloads' },
...(expertMode ? [{ label: 'Database', path: '/database' }] : [])
];
const uploadPhase = String(audiobookUpload?.phase || 'idle').trim().toLowerCase();
const showAudiobookUploadBanner = uploadPhase !== 'idle';