Add runtime configuration loader and styles for web application

This commit is contained in:
shuaiplus
2026-02-27 01:56:32 +08:00
committed by Shuai
parent b8c4bcef0c
commit 363aec1652
8 changed files with 49 additions and 58 deletions
+15
View File
@@ -0,0 +1,15 @@
import { startNodewardenApp } from './app.js';
async function loadRuntimeConfig() {
try {
const resp = await fetch('/api/web/config', { method: 'GET' });
if (!resp.ok) throw new Error('runtime config request failed');
return await resp.json();
} catch {
return { defaultKdfIterations: 600000 };
}
}
const cfg = await loadRuntimeConfig();
startNodewardenApp(cfg || { defaultKdfIterations: 600000 });