summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2018-03-06 00:39:57 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2018-03-06 00:39:57 +0200
commit69d91ec205900ca31adb7c34383598a1a4fef280 (patch)
tree525cdc6d4b76ce6926d1f332379a7732c5699eac /web
parent6041bcdf224eeb3d786e8b43d919a46525d0ff79 (diff)
allow alarms to use either chart IDs or chart names; fixes #3500
Diffstat (limited to 'web')
-rw-r--r--web/index.html12
1 files changed, 8 insertions, 4 deletions
diff --git a/web/index.html b/web/index.html
index 90179b0604..394f8a5152 100644
--- a/web/index.html
+++ b/web/index.html
@@ -2188,10 +2188,14 @@
function alarm_to_html(alarm, full) {
var chart = options.data.charts[alarm.chart];
if(typeof(chart) === 'undefined') {
- // this means the charts loaded are incomplete
- // probably netdata was restarted and more charts
- // are now available.
- return '';
+ chart = options.data.charts_by_name[alarm.chart];
+ if (typeof(chart) === 'undefined') {
+ // this means the charts loaded are incomplete
+ // probably netdata was restarted and more alarms
+ // are now available.
+ console.log('Cannot find chart ' + alarm.chart + ', you probably need to refresh the page.');
+ return '';
+ }
}
var has_alarm = (typeof alarm.warn !== 'undefined' || typeof alarm.crit !== 'undefined');