Skip to content

Commit

Permalink
fix panel alert state icon in Grafana 6, closes #715
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Jul 8, 2019
1 parent 7727d86 commit ca082c9
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/datasource-zabbix/zabbixAlerting.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ZabbixAlertingService {
}

isFullScreen() {
return this.dashboardSrv.dash.meta.fullscreen;
return this.getDashboardModel().meta.fullscreen;
}

setPanelAlertState(panelId, alertState) {
Expand All @@ -35,21 +35,18 @@ class ZabbixAlertingService {
$(panelContainers[panelIndex]).removeClass(alertClass);

if (alertState) {
if (alertState === 'alerting') {
alertClass = "panel-has-alert panel-alert-state--" + alertState;
$(panelContainers[panelIndex]).addClass(alertClass);
}
if (alertState === 'ok') {
alertClass = "panel-alert-state--" + alertState;
$(panelContainers[panelIndex]).addClass(alertClass);
$(panelContainers[panelIndex]).removeClass("panel-has-alert");
}
alertClass = "panel-has-alert panel-alert-state--" + alertState;
$(panelContainers[panelIndex]).addClass(alertClass);
}
}
}

getDashboardModel() {
return this.dashboardSrv.dash || this.dashboardSrv.dashboard;
}

getPanelModels() {
return _.filter(this.dashboardSrv.dash.panels, panel => panel.type !== 'row');
return _.filter(this.getDashboardModel().panels, panel => panel.type !== 'row');
}

getPanelModel(panelId) {
Expand Down

0 comments on commit ca082c9

Please sign in to comment.