Trigger panel: added custom trigger status field (OK or Problem).
This commit is contained in:
@@ -130,7 +130,7 @@
|
||||
<strong>Show events</strong>
|
||||
</li>
|
||||
<li>
|
||||
<select class="tight-form-input input-medium last"
|
||||
<select class="tight-form-input input-medium"
|
||||
ng-model="panel.showEvents"
|
||||
ng-options="f.text for f in showEventsFields track by f.value"
|
||||
ng-change="get_data()">
|
||||
@@ -153,6 +153,15 @@
|
||||
ng-checked="panel.hostField">
|
||||
<label for="panel.hostField" class="cr1"></label>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
<label class="checkbox-label" for="panel.severityField">Status</label>
|
||||
<input class="cr1"
|
||||
id="panel.statusField"
|
||||
type="checkbox"
|
||||
ng-model="panel.statusField"
|
||||
ng-checked="panel.statusField">
|
||||
<label for="panel.statusField" class="cr1"></label>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
<label class="checkbox-label" for="panel.severityField">Severity</label>
|
||||
<input class="cr1"
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
Host
|
||||
</div>
|
||||
</th>
|
||||
<th ng-if="panel.statusField" style="width: 85px">
|
||||
<div class="table-panel-table-header-inner pointer">Status</div>
|
||||
</th>
|
||||
<th ng-if="panel.severityField" style="width: 120px">
|
||||
<div class="table-panel-table-header-inner pointer">Severity</div>
|
||||
</th>
|
||||
@@ -35,6 +38,11 @@
|
||||
<span><strong>{{trigger.host}}</strong></span>
|
||||
</div>
|
||||
</td>
|
||||
<td ng-if="panel.statusField" style="background-color: {{trigger.color}}; color: white">
|
||||
<div>
|
||||
{{triggerStatusMap[trigger.value]}}
|
||||
</div>
|
||||
</td>
|
||||
<td ng-if="panel.severityField" style="background-color: {{trigger.color}}; color: white">
|
||||
<div>
|
||||
{{trigger.severity}}
|
||||
|
||||
@@ -54,6 +54,11 @@ function (angular, app, _, $, moment, config, PanelMeta) {
|
||||
{ text: 'Problem events', value: 1 }
|
||||
];
|
||||
|
||||
$scope.triggerStatusMap = {
|
||||
'0': 'OK',
|
||||
'1': 'Problem'
|
||||
};
|
||||
|
||||
var grafanaDefaultSeverity = [
|
||||
{ priority: 0, severity: 'Not classified', color: '#B7DBAB', show: true },
|
||||
{ priority: 1, severity: 'Information', color: '#82B5D8', show: true },
|
||||
@@ -72,6 +77,7 @@ function (angular, app, _, $, moment, config, PanelMeta) {
|
||||
trigger: {filter: ""}
|
||||
},
|
||||
hostField: true,
|
||||
statusField: false,
|
||||
severityField: false,
|
||||
lastChangeField: true,
|
||||
ageField: true,
|
||||
|
||||
Reference in New Issue
Block a user