This commit is contained in:
@@ -10,6 +10,7 @@ const pageConfigEl = el("pageConfig");
|
||||
const pageMapsEl = el("pageMaps");
|
||||
const pageMissionsEl = el("pageMissions");
|
||||
const pageIntegrationsEl = el("pageIntegrations");
|
||||
const pageSettingsEl = el("pageSettings");
|
||||
const pageSoundsEl = el("pageSounds");
|
||||
const pageTransitionsEl = el("pageTransitions");
|
||||
const pageUsersEl = el("pageUsers");
|
||||
@@ -131,7 +132,7 @@ const state = {
|
||||
};
|
||||
|
||||
function setActivePage(page) {
|
||||
const valid = ["dashboard", "config", "maps", "missions", "sounds", "transitions", "user-groups", "io-modules", "paths", "path-guides", "users", "integrations", "monitoring", "help"];
|
||||
const valid = ["dashboard", "config", "maps", "missions", "sounds", "transitions", "user-groups", "io-modules", "paths", "path-guides", "users", "settings", "integrations", "monitoring", "help"];
|
||||
let p = valid.includes(page) ? page : "missions";
|
||||
if (window.AuthApp && !window.AuthApp.canAccessPage(p)) {
|
||||
const fallback = valid.find((v) => window.AuthApp.canAccessPage(v));
|
||||
@@ -149,6 +150,7 @@ function setActivePage(page) {
|
||||
if (pagePathsEl) pagePathsEl.hidden = p !== "paths";
|
||||
if (pagePathGuidesEl) pagePathGuidesEl.hidden = p !== "path-guides";
|
||||
if (pageUsersEl) pageUsersEl.hidden = p !== "users";
|
||||
if (pageSettingsEl) pageSettingsEl.hidden = p !== "settings";
|
||||
if (pageIntegrationsEl) pageIntegrationsEl.hidden = p !== "integrations";
|
||||
if (pageMonitoringEl) pageMonitoringEl.hidden = p !== "monitoring";
|
||||
if (pageHelpEl) pageHelpEl.hidden = p !== "help";
|
||||
@@ -166,6 +168,7 @@ function setActivePage(page) {
|
||||
contentEl.classList.toggle("content--paths", p === "paths");
|
||||
contentEl.classList.toggle("content--path-guides", p === "path-guides");
|
||||
contentEl.classList.toggle("content--users", p === "users");
|
||||
contentEl.classList.toggle("content--settings", p === "settings");
|
||||
contentEl.classList.toggle("content--integrations", p === "integrations");
|
||||
contentEl.classList.toggle("content--monitoring", p === "monitoring");
|
||||
contentEl.classList.toggle("content--help", p === "help");
|
||||
@@ -191,6 +194,10 @@ function setActivePage(page) {
|
||||
else if (window.DashboardApp?.onPageHide) window.DashboardApp.onPageHide();
|
||||
if (p === "integrations" && window.IntegrationsApp) window.IntegrationsApp.onPageShow();
|
||||
else if (window.IntegrationsApp?.onPageHide) window.IntegrationsApp.onPageHide();
|
||||
if (p === "settings" && window.SettingsApp) window.SettingsApp.onPageShow();
|
||||
else if (window.SettingsApp?.onPageHide) window.SettingsApp.onPageHide();
|
||||
if (p === "monitoring" && window.MonitoringApp) window.MonitoringApp.onPageShow();
|
||||
else if (window.MonitoringApp?.onPageHide) window.MonitoringApp.onPageHide();
|
||||
window.NavApp?.syncFromPage?.(p);
|
||||
try {
|
||||
localStorage.setItem("activePage", p);
|
||||
|
||||
Reference in New Issue
Block a user