diff options
Diffstat (limited to 'static/app.js')
| -rw-r--r-- | static/app.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/static/app.js b/static/app.js index c296b90..79010bf 100644 --- a/static/app.js +++ b/static/app.js @@ -105,14 +105,17 @@ function mountTab(name, panel, section) { poll(name, panel.interval ?? 1, (st) => panel.update?.(st, wrap)); } +// Modules with no panel file: dashboard.js draws them. +const DRAWN = ["stats", "tablet", "llm", "actions"]; + async function boot() { const r = await fetch("/api/modules"); if (!r.ok) return; // Every panel's code at once; then mount in the server's order, so the // tabs do not shuffle with whichever import lands first. const names = (await r.json()).map(({ name }) => name); - const loaded = await Promise.all(names.map((name) => - import(`./modules/${name}.js`).then((m) => m.default, () => null))); + const loaded = await Promise.all(names.map((name) => (DRAWN.includes(name) ? null + : import(`./modules/${name}.js`).then((m) => m.default, () => null)))); names.forEach((name, i) => { const panel = loaded[i]; if (!panel?.tab) return; // no tab: drawn by the Dashboard, if at all |
