Griesbacher / histou

Adds templates to Grafana in combination with nagflux
GNU General Public License v2.0
35 stars 16 forks source link

Manage protocol and servername dynamically #27

Closed rverchere closed 5 years ago

rverchere commented 6 years ago

Hi,

when using with http and https, the histou.js dos not automatically get the correct protocol, leading to some errors when using with thruk.

I suggest the following patch:

--- histou.js   2018-08-23 22:51:48.465967766 +0200
+++ /usr/share/grafana/public/dashboards/histou.js      2018-08-23 22:52:42.155844954 +0200
@@ -12,7 +12,7 @@
         document.documentElement.style.background = '#FFF';
     }

-    var url = 'http://localhost/histou/';
+    var url = location.protocol+'//'+window.location.hostname+'/histou/';
     var configUrl = url+'index.php?host='+host+'&service='+service+'&height='+height+'&legend='+legend+debug+disablePanelTitle+disablePerfdataLookup+specificTemplate+'&annotations='+annotations;

     var flotAddons = url + 'flotAddons.js';

Thanks for your great work!

Griesbacher commented 5 years ago

Thanks for the hint, I've added the patch.