diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-28 21:16:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-28 21:16:49 +0000 |
commit | c7191c291b318c93b4db058b7ff820cb7dc44cc7 (patch) | |
tree | 8caa842f47708dac599794745b87212e4d71df7b /web/gui/main.js | |
parent | Releasing debian version 1.12.1-2. (diff) | |
download | netdata-c7191c291b318c93b4db058b7ff820cb7dc44cc7.tar.xz netdata-c7191c291b318c93b4db058b7ff820cb7dc44cc7.zip |
Merging upstream version 1.12.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/main.js')
-rw-r--r-- | web/gui/main.js | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/web/gui/main.js b/web/gui/main.js index 86dca62ff..8ea33e540 100644 --- a/web/gui/main.js +++ b/web/gui/main.js @@ -550,10 +550,6 @@ function renderStreamedHosts(options) { } function renderMachines(machinesArray) { - // let html = isSignedIn() - // ? `<div class="info-item">My nodes</div>` - // : `<div class="info-item">My nodes</div>`; - let html = `<div class="info-item">My nodes</div>`; if (machinesArray === null) { @@ -710,13 +706,6 @@ function renderMyNetdataMenu(machinesArray) { const el = document.getElementById('my-netdata-dropdown-content'); el.classList.add(`theme-${netdataTheme}`); - if (!isSignedIn()) { - if (!NETDATA.registry.isRegistryEnabled()) { - restrictMyNetdataMenu(); - return; - } - } - if (machinesArray == registryAgents) { console.log("Rendering my-netdata menu from registry"); } else { @@ -725,6 +714,18 @@ function renderMyNetdataMenu(machinesArray) { let html = ''; + if (!isSignedIn()) { + if (!NETDATA.registry.isRegistryEnabled()) { + html += ( + `<div class="info-item" style="white-space: nowrap"> + <span>Please <a href="#" onclick="signInDidClick(event); return false">sign in to netdata.cloud</a> to view your nodes!</span> + <div></div> + </div> + <hr />` + ); + } + } + if (isSignedIn()) { html += ( `<div class="filter-control"> @@ -743,16 +744,26 @@ function renderMyNetdataMenu(machinesArray) { ); } + // options.hosts = [ + // { + // hostname: "streamed1", + // }, + // { + // hostname: "streamed2", + // }, + // ] + if (options.hosts.length > 1) { html += `<div id="my-netdata-menu-streamed">${renderStreamedHosts(options)}</div><hr />`; } - html += `<div id="my-netdata-menu-machines">${renderMachines(machinesArray)}</div>`; + if (isSignedIn() || NETDATA.registry.isRegistryEnabled()) { + html += `<div id="my-netdata-menu-machines">${renderMachines(machinesArray)}</div><hr />`; + } if (!isSignedIn()) { html += ( - `<hr /> - <div class="agent-item"> + `<div class="agent-item"> <i class="fas fa-cog""></i> <a href="#" onclick="switchRegistryModalHandler(); return false;">Switch Identity</a> <div></div> @@ -765,8 +776,7 @@ function renderMyNetdataMenu(machinesArray) { ) } else { html += ( - `<hr /> - <div class="agent-item"> + `<div class="agent-item"> <i class="fas fa-sync"></i> <a href="#" onclick="showSyncModal(); return false">Synchronize with netdata.cloud</a> <div></div> |