triggers panel: fix icon for OK events
This commit is contained in:
@@ -163,7 +163,7 @@
|
|||||||
<label class="gf-form-label width-3">{{ trigger.priority }}</label>
|
<label class="gf-form-label width-3">{{ trigger.priority }}</label>
|
||||||
<label class="gf-form-label triggers-severity-config"
|
<label class="gf-form-label triggers-severity-config"
|
||||||
ng-style="{color: trigger.color}">
|
ng-style="{color: trigger.color}">
|
||||||
<i class="icon-gf" ng-class="ctrl.getAlertIconClass(trigger)"></i>
|
<i class="icon-gf" ng-class="ctrl.getAlertIconClassBySeverity(trigger)"></i>
|
||||||
</label>
|
</label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
class="gf-form-input width-12"
|
class="gf-form-input width-12"
|
||||||
|
|||||||
12
dist/panel-triggers/triggers_panel_ctrl.js
vendored
12
dist/panel-triggers/triggers_panel_ctrl.js
vendored
@@ -641,9 +641,8 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
|
|||||||
}, {
|
}, {
|
||||||
key: 'getAlertIconClass',
|
key: 'getAlertIconClass',
|
||||||
value: function getAlertIconClass(trigger) {
|
value: function getAlertIconClass(trigger) {
|
||||||
var triggerValue = Number(trigger.value);
|
|
||||||
var iconClass = '';
|
var iconClass = '';
|
||||||
if (triggerValue || trigger.color) {
|
if (trigger.value === '1') {
|
||||||
if (trigger.priority >= 3) {
|
if (trigger.priority >= 3) {
|
||||||
iconClass = 'icon-gf-critical';
|
iconClass = 'icon-gf-critical';
|
||||||
} else {
|
} else {
|
||||||
@@ -658,6 +657,15 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
|
|||||||
}
|
}
|
||||||
return iconClass;
|
return iconClass;
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
key: 'getAlertIconClassBySeverity',
|
||||||
|
value: function getAlertIconClassBySeverity(triggerSeverity) {
|
||||||
|
var iconClass = 'icon-gf-warning';
|
||||||
|
if (triggerSeverity.priority >= 3) {
|
||||||
|
iconClass = 'icon-gf-critical';
|
||||||
|
}
|
||||||
|
return iconClass;
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'getAlertStateClass',
|
key: 'getAlertStateClass',
|
||||||
value: function getAlertStateClass(trigger) {
|
value: function getAlertStateClass(trigger) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -163,7 +163,7 @@
|
|||||||
<label class="gf-form-label width-3">{{ trigger.priority }}</label>
|
<label class="gf-form-label width-3">{{ trigger.priority }}</label>
|
||||||
<label class="gf-form-label triggers-severity-config"
|
<label class="gf-form-label triggers-severity-config"
|
||||||
ng-style="{color: trigger.color}">
|
ng-style="{color: trigger.color}">
|
||||||
<i class="icon-gf" ng-class="ctrl.getAlertIconClass(trigger)"></i>
|
<i class="icon-gf" ng-class="ctrl.getAlertIconClassBySeverity(trigger)"></i>
|
||||||
</label>
|
</label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
class="gf-form-input width-12"
|
class="gf-form-input width-12"
|
||||||
|
|||||||
@@ -490,9 +490,8 @@ export class TriggerPanelCtrl extends PanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAlertIconClass(trigger) {
|
getAlertIconClass(trigger) {
|
||||||
const triggerValue = Number(trigger.value);
|
|
||||||
let iconClass = '';
|
let iconClass = '';
|
||||||
if (triggerValue || trigger.color) {
|
if (trigger.value === '1') {
|
||||||
if (trigger.priority >= 3) {
|
if (trigger.priority >= 3) {
|
||||||
iconClass = 'icon-gf-critical';
|
iconClass = 'icon-gf-critical';
|
||||||
} else {
|
} else {
|
||||||
@@ -508,6 +507,14 @@ export class TriggerPanelCtrl extends PanelCtrl {
|
|||||||
return iconClass;
|
return iconClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAlertIconClassBySeverity(triggerSeverity) {
|
||||||
|
let iconClass = 'icon-gf-warning';
|
||||||
|
if (triggerSeverity.priority >= 3) {
|
||||||
|
iconClass = 'icon-gf-critical';
|
||||||
|
}
|
||||||
|
return iconClass;
|
||||||
|
}
|
||||||
|
|
||||||
getAlertStateClass(trigger) {
|
getAlertStateClass(trigger) {
|
||||||
let statusClass = '';
|
let statusClass = '';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user