diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
commit | 3b95e5be69c199a2a195c57aba12d88c242225ac (patch) | |
tree | 137b72ffaefe7f34bf21e975ccc9cc9ec0474564 /web/gui/main.js | |
parent | Adding upstream version 1.13.0. (diff) | |
download | netdata-b9ac22f8da656f8703bea7c713068a397e01c714.tar.xz netdata-b9ac22f8da656f8703bea7c713068a397e01c714.zip |
Adding upstream version 1.14.0~rc0.upstream/1.14.0_rc0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/main.js')
-rw-r--r-- | web/gui/main.js | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/web/gui/main.js b/web/gui/main.js index c6a2bac13..8a61673ea 100644 --- a/web/gui/main.js +++ b/web/gui/main.js @@ -4044,6 +4044,14 @@ function runOnceOnDashboardWithjQuery() { // ------------------------------------------------------------------------ // sidebar / affix + if (shouldShowSignInBanner()) { + const el = document.getElementById("sign-in-banner"); + if (el) { + el.style.display = "initial"; + el.classList.add(`theme-${netdataTheme}`); + } + } + $('#sidebar') .affix({ offset: { @@ -4361,12 +4369,6 @@ function finalizePage() { // do not to give errors on netdata demo servers for 60 seconds NETDATA.options.current.retries_on_data_failures = 60; - if (urlOptions.nowelcome !== true) { - setTimeout(function () { - $('#welcomeModal').modal(); - }, 1000); - } - // google analytics when this is used for the home page of the demo sites // this does not run on user's installations setTimeout(function () { @@ -4405,6 +4407,12 @@ function finalizePage() { NETDATA.globalPanAndZoom.setMaster(NETDATA.options.targets[0], netdataSnapshotData.after_ms, netdataSnapshotData.before_ms); } + //if (urlOptions.nowelcome !== true) { + // setTimeout(function () { + // $('#welcomeModal').modal(); + // }, 2000); + //} + // var netdataEnded = performance.now(); // console.log('start up time: ' + (netdataEnded - netdataStarted).toString() + ' ms'); } @@ -4685,6 +4693,26 @@ function signInDidClick(e) { signIn(); } +function shouldShowSignInBanner() { + if (isSignedIn()) { + return false; + } + + return localStorage.getItem("signInBannerClosed") != "true"; +} + +function closeSignInBanner() { + localStorage.setItem("signInBannerClosed", "true"); + const el = document.getElementById("sign-in-banner"); + if (el) { + el.style.display = "none"; + } +} + +function closeSignInBannerDidClick(e) { + closeSignInBanner(); +} + function signOutDidClick(e) { e.preventDefault(); e.stopPropagation(); @@ -4779,7 +4807,7 @@ function renderAccountUI() { container.setAttribute("data-original-title", "sign in"); container.setAttribute("data-placement", "bottom"); container.innerHTML = ( - `<a href="#" class="btn" onclick="signInDidClick(event); return false"> + `<a href="#" class="btn sign-in-btn theme-${netdataTheme}" onclick="signInDidClick(event); return false"> <i class="fas fa-sign-in-alt"></i> <span class="hidden-sm hidden-md">Sign In</span> </a>` ) @@ -4802,6 +4830,7 @@ function handleMessage(e) { } function handleSignInMessage(e) { + closeSignInBanner(); localStorage.setItem("cloud.baseURL", NETDATA.registry.cloudBaseURL); cloudAccountID = e.data.accountID; |