diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:18:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-08-10 09:19:08 +0000 |
commit | a2d7dede737947d7c6afa20a88e1f0c64e0eb96c (patch) | |
tree | fed4aff7dbe0be00cf91de6261d98bc0eb9a2449 /web/gui/registry-access.html | |
parent | Releasing debian version 1.41.0-1. (diff) | |
download | netdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.tar.xz netdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.zip |
Merging upstream version 1.42.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/gui/registry-access.html')
-rw-r--r-- | web/gui/registry-access.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/web/gui/registry-access.html b/web/gui/registry-access.html index a5f265043..ffa008a98 100644 --- a/web/gui/registry-access.html +++ b/web/gui/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) }) } |