summaryrefslogtreecommitdiffstats
path: root/web/gui/v2/registry-access.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:18:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:18:49 +0000
commitdd814a7c1a8de056a79f7238578b09236edd5506 (patch)
tree429e7eed5a634a4efe9a6877ce66da8e64aa1782 /web/gui/v2/registry-access.html
parentAdding upstream version 1.41.0. (diff)
downloadnetdata-upstream/1.42.0.tar.xz
netdata-upstream/1.42.0.zip
Adding upstream version 1.42.0.upstream/1.42.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/v2/registry-access.html')
-rw-r--r--web/gui/v2/registry-access.html12
1 files changed, 6 insertions, 6 deletions
diff --git a/web/gui/v2/registry-access.html b/web/gui/v2/registry-access.html
index a5f26504..ffa008a9 100644
--- a/web/gui/v2/registry-access.html
+++ b/web/gui/v2/registry-access.html
@@ -9,25 +9,25 @@
.then(function(response) { return response.json() })
: Promise.resolve(parentHelloData)
- helloPromise.then(function(data) {
+ helloPromise.then(function(helloData) {
var retries = 3
- var nodes = data.nodes || []
+ var nodes = helloData.nodes || []
var doAccess = function(mg, nm, token) {
- fetch(data.registry + '/api/v1/registry?action=access&machine=' + (mg || data.machine_guid) + '&name=' + encodeURIComponent(nm || data.hostname) + '&url=' + encodeURIComponent(originUrl) + '&agent=' + (data.agent ? data.agent.machine_guid : ""), { cache: "no-cache", credentials: "include", headers: { Authorization: 'Bearer ' + (token || localStorage.getItem("registry-netdata-token")) } })
+ fetch(helloData.registry + '/api/v1/registry?action=access&machine=' + (mg || helloData.machine_guid) + '&name=' + encodeURIComponent(nm || helloData.hostname) + '&url=' + encodeURIComponent(originUrl) + '&agent=' + (helloData.agent ? helloData.agent.machine_guid : ""), { cache: "no-cache", credentials: "include", headers: { Authorization: 'Bearer ' + (token || localStorage.getItem("registry-netdata-token")) } })
.then(function(response) { return response.json() })
.then(function(data) {
var token = data.person_guid
if (data.status === "redirect" && retries > 0) {
retries = retries - 1
- doAccess(data.machine_guid, data.hostname, token)
+ doAccess(helloData.machine_guid, helloData.hostname, token)
}
if (data.status === "ok") {
localStorage.setItem("registry-netdata-token", token)
- node = nodes.pop()
+ let node = nodes.pop()
if (!!node) {
setTimeout(function () {
@@ -38,7 +38,7 @@
window.parent.postMessage(data, "*");
})
}
- doAccess(data.machine_guid, data.hostname)
+ doAccess(helloData.machine_guid, helloData.hostname)
})
}