summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-09-30 09:28:50 +0300
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-09-30 09:28:50 +0300
commited949919d09784b89d2e036c356895ac806e5919 (patch)
tree72093252f0042ee4f2bbc1e99eee16341c044c6c /web
parent80c1e4dd9eabf2641feb8a797142c9ab8f4be6f9 (diff)
lookup all the known URLs of a machine
Diffstat (limited to 'web')
-rw-r--r--web/index.html30
1 files changed, 25 insertions, 5 deletions
diff --git a/web/index.html b/web/index.html
index c0d34a252f..30c7231377 100644
--- a/web/index.html
+++ b/web/index.html
@@ -721,9 +721,6 @@
if(gotoServerValidateRemaining <= 0) {
gotoServerMiddleClick = false;
document.getElementById('gotoServerResponse').innerHTML = '<b>Sorry! I cannot find any operational URL for this server</b>';
- //NETDATA.registry.search(guid, function(d) {
- // console.log(d);
- //});
}
}
});
@@ -734,7 +731,9 @@
// console.log('goto server: ' + guid);
gotoServerStop = false;
+ var checked = {};
var len = NETDATA.registry.machines[guid].alternate_urls.length;
+ var count = 0;
document.getElementById('gotoServerResponse').innerHTML = '';
document.getElementById('gotoServerList').innerHTML = '';
@@ -742,9 +741,30 @@
$('#gotoServerModal').modal('show');
gotoServerValidateRemaining = len;
- while(len--)
- gotoServerValidateUrl(len, guid, NETDATA.registry.machines[guid].alternate_urls[len]);
+ while(len--) {
+ var url = NETDATA.registry.machines[guid].alternate_urls[len];
+ checked[url] = true;
+ gotoServerValidateUrl(count++, guid, url);
+ }
+ setTimeout(function() {
+ if(gotoServerStop === false) {
+ document.getElementById('gotoServerResponse').innerHTML = '<b>Added all the known URLs for this machine.</b>';
+ NETDATA.registry.search(guid, function(data) {
+ console.log(data);
+ len = data.urls.length;
+ while(len--) {
+ var url = data.urls[len][1];
+ console.log(url);
+ if(typeof checked[url] === 'undefined') {
+ gotoServerValidateRemaining++;
+ checked[url] = true;
+ gotoServerValidateUrl(count++, guid, url);
+ }
+ }
+ });
+ }
+ }, 2000);
return false;
}