Frontend Service: Pass static config needed for login to index bootData (#110829)

add almost all config needed for login
This commit is contained in:
Ashley Harrison
2025-09-11 12:05:39 +01:00
committed by GitHub
parent d0ab6d08e6
commit 2e0fdb2a60
2 changed files with 53 additions and 5 deletions
+12 -3
View File
@@ -249,13 +249,22 @@
}
async function initGrafana() {
const rawBootData = await loadBootData();
// global config
window.grafanaBootData = {
_femt: true, // isFrontendService() needs this
...rawBootData,
assets: [[.Assets]],
navTree: [],
settings: [[.Settings]],
user: [[.DefaultUser]],
}
// tenant-specific config
// TODO split this into separate API calls
const { navTree, settings, user } = await loadBootData();
window.grafanaBootData.settings = settings;
window.grafanaBootData.navTree = navTree;
window.grafanaBootData.user = user;
// The per-theme CSS still contains some global styles needed
// to render the page correctly.
const cssLink = document.createElement("link");