From 942a95bce791372e37f2152e46b183daf0bc1e40 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Mon, 5 Sep 2016 23:08:47 +0300 Subject: [PATCH] show hostname on alarm notifications --- web/dashboard.html | 2 +- web/dashboard.js | 10 +++++++--- web/demo.html | 2 +- web/demo2.html | 2 +- web/demosites.html | 2 +- web/index.html | 4 ++-- web/registry.html | 2 +- web/tv.html | 2 +- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/web/dashboard.html b/web/dashboard.html index 7fcc7368..25f71851 100644 --- a/web/dashboard.html +++ b/web/dashboard.html @@ -655,4 +655,4 @@ So, to avoid flashing the charts, we destroy and re-create the charts on each up - + diff --git a/web/dashboard.js b/web/dashboard.js index a659ee74..22a06d31 100644 --- a/web/dashboard.js +++ b/web/dashboard.js @@ -15,8 +15,8 @@ // var netdataNoRegistry = true; // Don't update the registry for this access // var netdataRegistryCallback = null; // Callback function that will be invoked with one param, // the URLs from the registry -// var netdataShowHelp = true; // enable/disable help -// var netdataShowAlarms = true; // enable/disable help +// var netdataShowHelp = false; // enable/disable help (default enabled) +// var netdataShowAlarms = true; // enable/disable alarms checks and notifications (default disabled) // // You can also set the default netdata server, using the following. // When this variable is not set, we assume the page is hosted on your @@ -50,6 +50,8 @@ // global namespace var NETDATA = window.NETDATA || {}; + NETDATA.hostname = 'localhost'; + // ---------------------------------------------------------------------------------------------------------------- // Detect the netdata server @@ -621,6 +623,8 @@ } else NETDATA.error(406, host + '/api/v1/charts'); + NETDATA.hostname = data.hostname; + if(typeof callback === 'function') callback(data); }) @@ -5595,7 +5599,7 @@ var name = entry.name.replace(/_/g, ' '); var title = name + ' = ' + ((entry.value === null)?'NaN':Math.floor(entry.value)).toString() + ' ' + entry.units; - var body = entry.info + ' of ' + entry.chart + ' (' + entry.family + ')'; + var body = NETDATA.hostname + ' - ' + entry.chart + ' (' + entry.family + ') - ' + entry.status.toLowerCase() + ': ' + entry.info; var tag = entry.alarm_id; var icon = 'images/seo-performance-128.png'; var interaction = false; diff --git a/web/demo.html b/web/demo.html index 8ed63f09..7642cd5a 100644 --- a/web/demo.html +++ b/web/demo.html @@ -20,7 +20,7 @@ - + diff --git a/web/demo2.html b/web/demo2.html index 7e0f3058..ccf8c060 100644 --- a/web/demo2.html +++ b/web/demo2.html @@ -21,7 +21,7 @@ - + diff --git a/web/demosites.html b/web/demosites.html index 9ad5b532..1598ac96 100644 --- a/web/demosites.html +++ b/web/demosites.html @@ -51,7 +51,7 @@ and that you have chown it to be owned by netdata:netdata --> - + - +
diff --git a/web/registry.html b/web/registry.html index 8b5dc387..6c7589ec 100644 --- a/web/registry.html +++ b/web/registry.html @@ -134,7 +134,7 @@ and that you have chown it to be owned by netdata:netdata --> - + +