diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:47 +0000 |
commit | 1d63948d79ca6f32889656692d6736c9127f2ee1 (patch) | |
tree | bb26a34d7c7b62ac30b0d4da15584efe3e2a754a /web/gui/main.js | |
parent | Releasing debian version 1.13.0-1. (diff) | |
download | netdata-1d63948d79ca6f32889656692d6736c9127f2ee1.tar.xz netdata-1d63948d79ca6f32889656692d6736c9127f2ee1.zip |
Merging upstream version 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; |