From a2d7dede737947d7c6afa20a88e1f0c64e0eb96c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 10 Aug 2023 11:18:52 +0200 Subject: Merging upstream version 1.42.0. Signed-off-by: Daniel Baumann --- web/gui/v2/agent.html | 159 ++++++++++++++++++++------------------------------ 1 file changed, 63 insertions(+), 96 deletions(-) (limited to 'web/gui/v2/agent.html') diff --git a/web/gui/v2/agent.html b/web/gui/v2/agent.html index 2e917b7e0..a53ec9e3c 100644 --- a/web/gui/v2/agent.html +++ b/web/gui/v2/agent.html @@ -1,42 +1,43 @@ -Netdata Agent Console

Welcome to Netdata

Loading latest Netdata Cloud UI...

We couldn't load the latest Netdata Cloud UI. You can try again
Or you can load the old single node dashboard or a local copy of Netdata Cloud UI

Welcome to Netdata

Loading latest Netdata UI...

We couldn't load the latest Netdata UI. You can try again
Or you can load the old single node dashboard or a local copy of Netdata UI
\ No newline at end of file + + envSettings.tracking = window.localNetdataRegistry.anonymousStatistics + + let withoutNodes = btoa(JSON.stringify({ + registry: data.registry, + machine_guid: data.machine_guid, + hostname: data.hostname, + agent: data.agent, + nodes: [] + })) + let iframe = document.createElement('iframe'); + iframe.src = data.registry + "/registry-access.html?x=" + withoutNodes + "&originUrl=" + window.envSettings.agentApiUrl; + iframe.style = { position: "absolute", left: "-99999999px" }; + iframe.width = 0 ; + iframe.height = 0; + iframe.tabindex = -1; + iframe.title = "empty"; + iframe.classList.add("hidden"); + document.body.appendChild(iframe); + + setTimeout(function () { + document.title = data.hostname + ': Netdata Agent Console'; + iframe.contentWindow.postMessage(["netdata-registry", window.envSettings.agentApiUrl, data], "*") + }, 300); + + window.addEventListener('message', function(event) { + if (event.source !== iframe.contentWindow) return; + + if (event.data.status === "disabled") console.error("Your netdata registry is disabled! Check your configuration.") + }); + }) \ No newline at end of file -- cgit v1.2.3