@cryptotaxi247 / netdata-1 / commits / 7d5749110

remove server= hash when switching hosts via the my-netdata menu

Costa Tsaousis (ktsaou) committed Nov 14, 2017 at 14:59 UTC 7d5749110d08345d9461255f83840336af13a895
1 file changed +6 -6
web/index.html
+6 -6
@@ -510,7 +510,7 @@
510 return typeof this[property] !== 'undefined';
511 },
512
513 - genHash: function() {
513 + genHash: function(forReload) {
514 var hash = urlOptions.hash;
515
516 if(urlOptions.pan_and_zoom === true) {
@@ -527,7 +527,7 @@
527 if(urlOptions.update_always === true)
528 hash += ';update_always=true';
529
530 - if(urlOptions.server !== null)
530 + if(forReload === true && urlOptions.server !== null)
531 hash += ';server=' + urlOptions.server.toString();
532
533 if(urlOptions.mode !== 'live')
@@ -606,7 +606,7 @@
606 },
607
608 hashUpdate: function() {
609 - history.replaceState(null, '', urlOptions.genHash());
609 + history.replaceState(null, '', urlOptions.genHash(true));
610 },
611
612 netdataPanAndZoomCallback: function(status, after, before) {
@@ -920,14 +920,14 @@
920 return this_is_demo;
921 }
922
923 - function netdataURL(url) {
923 + function netdataURL(url, forReload) {
924 if(typeof url === 'undefined')
925 url = document.location.toString();
926
927 if(url.indexOf('#') !== -1)
928 url = url.substring(0, url.indexOf('#'));
929
930 - var hash = urlOptions.genHash();
930 + var hash = urlOptions.genHash(forReload);
931
932 // console.log('netdataURL: ' + url + hash);
933
@@ -935,7 +935,7 @@
935 }
936
937 function netdataReload(url) {
938 - document.location = netdataURL(url);
938 + document.location = netdataURL(url, true);
939
940 // since we play with hash
941 // this is needed to reload the page