allow alarms to use either chart IDs or chart names; fixes #3500
Costa Tsaousis (ktsaou) committed
Mar 6, 2018 at 00:39 UTC
69d91ec205900ca31adb7c34383598a1a4fef280
1 file changed
+8
-4
web/index.html
+8
-4
@@ -2188,10 +2188,14 @@
2188
function alarm_to_html(alarm, full) {
2189
var chart = options.data.charts[alarm.chart];
2190
if(typeof(chart) === 'undefined') {
2191
- // this means the charts loaded are incomplete
2192
- // probably netdata was restarted and more charts
2193
- // are now available.
2194
- return '';
2191
+ chart = options.data.charts_by_name[alarm.chart];
2192
+ if (typeof(chart) === 'undefined') {
2193
+ // this means the charts loaded are incomplete
2194
+ // probably netdata was restarted and more alarms
2195
+ // are now available.
2196
+ console.log('Cannot find chart ' + alarm.chart + ', you probably need to refresh the page.');
2197
+ return '';
2198
+ }
2199
}
2200
2201
var has_alarm = (typeof alarm.warn !== 'undefined' || typeof alarm.crit !== 'undefined');