From 3064328aa8dd79387f42e5472eedf326c00ba179 Mon Sep 17 00:00:00 2001 From: librelad Date: Mon, 25 May 2026 18:13:55 +0100 Subject: [PATCH] fix(webui): populate admin sidebar on cold visit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The admin landing (overview) and the tools pages (ssh-access, system) call populateSidebar() without first loading window.configData. On a cold admin visit — e.g. navigating straight from the dashboard — configData is undefined, so populateSidebar() bails early and the sidebar renders empty. Visiting Backups happened to set window.configData, which is why returning to admin afterward showed the sidebar. Load (cached) config data up front in renderConfig before any branch renders so the sidebar always has its categories. The config-category path's later loadConfig is now a cache hit. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- .../frontend/js/components/config/config-manager.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/containers/libreportal/frontend/js/components/config/config-manager.js b/containers/libreportal/frontend/js/components/config/config-manager.js index 5589a35..689ebc5 100755 --- a/containers/libreportal/frontend/js/components/config/config-manager.js +++ b/containers/libreportal/frontend/js/components/config/config-manager.js @@ -25,6 +25,13 @@ if (typeof window.ConfigManager === 'undefined') { return; } + // The sidebar and page headers read window.configData. Load it up front so + // populateSidebar() has categories on a cold admin visit (e.g. straight + // from the dashboard); otherwise the overview/tools branches below render + // an empty sidebar until something else populates configData. Cached after + // the first call, so the config-category path below is a cache hit. + try { await this.core.loadConfig(category); } catch (e) {} + // Overview is the Admin landing — an ops/health board, not a config form. if (category === 'overview') { try { this.sidebar.populateSidebar(); } catch (e) {}