summaryrefslogtreecommitdiffstats
path: root/web/gui/main.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:57:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:57:13 +0000
commitcbf70980c060bde02906a8e9de2064459bacc93c (patch)
tree5b9ade02e0ed32a4b33f5e8647092d0c02ea586d /web/gui/main.js
parentReleasing debian version 1.16.0-1. (diff)
downloadnetdata-cbf70980c060bde02906a8e9de2064459bacc93c.tar.xz
netdata-cbf70980c060bde02906a8e9de2064459bacc93c.zip
Merging upstream version 1.16.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/main.js')
-rw-r--r--web/gui/main.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/web/gui/main.js b/web/gui/main.js
index 65c4d4a88..1214eba6f 100644
--- a/web/gui/main.js
+++ b/web/gui/main.js
@@ -704,11 +704,11 @@ function restrictMyNetdataMenu() {
</div>`);
}
-function openAuthenticatedUrl(url) {
+function openAuthenticatedUrl(url) {
if (isSignedIn()) {
window.open(url);
} else {
- window.open(`${NETDATA.registry.cloudBaseURL}/account/sign-in-agent?id=${NETDATA.registry.machine_guid}&name=${encodeURIComponent(NETDATA.registry.hostname)}&origin=${encodeURIComponent(window.location.origin + "/")}`);
+ window.open(`${NETDATA.registry.cloudBaseURL}/account/sign-in-agent?id=${NETDATA.registry.machine_guid}&name=${encodeURIComponent(NETDATA.registry.hostname)}&origin=${encodeURIComponent(window.location.origin + "/")}&redirectUrl=${encodeURIComponent(window.location.origin + "/" + url)}`);
}
}
@@ -1775,8 +1775,6 @@ function renderPage(menus, data) {
if (urlOptions.mode === 'print') {
chtml += '</div>';
}
-
- // console.log(' \------- ' + chart.id + ' (' + chart.priority + '): ' + chart.context + ' height: ' + menus[menu].submenus[submenu].height);
}
head += '</div>';
@@ -2747,7 +2745,7 @@ function initializeDynamicDashboardWithData(data) {
}
// update the dashboard hostname
- document.getElementById('hostname').innerHTML = options.hostname + ((netdataSnapshotData !== null) ? ' (snap)' : '').toString() + '&nbsp;&nbsp;<strong class="caret">';
+ document.getElementById('hostname').innerHTML = '<span id="hostnametext">' + options.hostname + ((netdataSnapshotData !== null) ? ' (snap)' : '').toString() + '</span>&nbsp;&nbsp;<strong class="caret">';
document.getElementById('hostname').href = NETDATA.serverDefault;
document.getElementById('netdataVersion').innerHTML = options.version;
@@ -4899,6 +4897,9 @@ function handleSignInMessage(e) {
cloudToken = e.data.token;
netdataRegistryCallback(registryAgents);
+ if (e.data.redirectUrl) {
+ window.location.replace(e.data.redirectUrl);
+ }
}
function handleSignOutMessage(e) {