diff --git a/management/templates/index.html b/management/templates/index.html index 2c0d5a9a..f03dbbeb 100644 --- a/management/templates/index.html +++ b/management/templates/index.html @@ -82,34 +82,41 @@ {{hostname}}
@@ -383,6 +390,11 @@ $(function() { else if (typeof localStorage != 'undefined' && localStorage.getItem("miab-cp-credentials")) api_credentials = localStorage.getItem("miab-cp-credentials").split(":"); + if (api_credentials[0].length !== 0) { + $("#guestNav").addClass("hidden"); + $("#loggedInNav").removeClass("hidden"); + } + // Recall what the user was last looking at. if (typeof localStorage != 'undefined' && localStorage.getItem("miab-cp-lastpanel")) { show_panel(localStorage.getItem("miab-cp-lastpanel")); diff --git a/management/templates/login.html b/management/templates/login.html index b6e74df6..0e8e1a9a 100644 --- a/management/templates/login.html +++ b/management/templates/login.html @@ -117,7 +117,11 @@ function do_login() { // Open the next panel the user wants to go to. Do this after the XHR response // is over so that we don't start a new XHR request while this one is finishing, // which confuses the loading indicator. - setTimeout(function() { show_panel(!switch_back_to_panel || switch_back_to_panel == "login" ? 'system_status' : switch_back_to_panel) }, 300); + setTimeout(function() { + $("#guestNav").addClass("hidden"); + $("#loggedInNav").removeClass("hidden"); + show_panel(!switch_back_to_panel || switch_back_to_panel == "login" ? 'system_status' : switch_back_to_panel) + }, 300); } }) } @@ -128,6 +132,9 @@ function do_logout() { localStorage.removeItem("miab-cp-credentials"); if (typeof sessionStorage != 'undefined') sessionStorage.removeItem("miab-cp-credentials"); + + $("#guestNav").addClass("hidden"); + $("#loggedInNav").removeClass("hidden"); show_panel('login'); }