my-netdata: delay checking https dashboards when the current dashboard is http
Costa Tsaousis committed
May 29, 2016 at 22:28 UTC
453756537cd3199d55eb3e61cd7e3128480c5cb7
1 file changed
+10
-1
web/index.html
+10
-1
@@ -980,6 +980,9 @@
980
<table id="gotoServerList">
981
</table>
982
</div>
983
+ <p style="padding-top: 10px;"><small>
984
+ Checks may fail if you are viewing an HTTPS page and the server to be checked is HTTP only.
985
+ </small></p>
986
<div id="gotoServerResponse" style="display: block; width: 100%; text-align: center; padding-top: 20px;"></div>
987
</div>
988
<div class="modal-footer">
@@ -1017,6 +1020,12 @@ if(isdemo()) {
1020
}
1021
var gotoServerValidateRemaining = 0;
1022
function gotoServerValidateUrl(id, guid, url) {
1023
+ var penaldy = 0;
1024
+ if(document.location.toString().startsWith('http://') && url.toString().startsWith('https://'))
1025
+ // we penalize https only if the current url is http
1026
+ // to allow the user walk through all its servers.
1027
+ penaldy = 500;
1028
+
1029
setTimeout(function() {
1030
document.getElementById('gotoServerList').innerHTML += '<tr><td style="padding-left: 20px;"><a href="' + url + '" target="_blank">' + url + '</a></td><td style="padding-left: 30px;"><code id="' + guid + '-' + id + '-status">checking...</code></td></tr>';
1031
NETDATA.registry.hello(url, function(data) {
@@ -1032,7 +1041,7 @@ function gotoServerValidateUrl(id, guid, url) {
1041
document.getElementById('gotoServerResponse').innerHTML = '<b>Sorry! I cannot find any operational URL for this server</b>';
1042
}
1043
});
1035
- }, id * 50);
1044
+ }, (id * 50) + penaldy);
1045
}
1046
1047
function gotoServerModalHandler(guid) {