Trigger panel: added host technical name, fixes #192.

This commit is contained in:
Alexander Zobnin
2016-07-31 17:12:53 +03:00
parent d75cb8f9b3
commit e75a714e22
3 changed files with 32 additions and 2 deletions

View File

@@ -150,7 +150,7 @@
<strong>Show fields</strong> <strong>Show fields</strong>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item">
<label class="checkbox-label" for="hostField">Host</label> <label class="checkbox-label" for="hostField">Host Name</label>
<input class="cr1" <input class="cr1"
id="hostField" id="hostField"
type="checkbox" type="checkbox"
@@ -158,6 +158,15 @@
ng-checked="editor.panel.hostField"> ng-checked="editor.panel.hostField">
<label for="hostField" class="cr1"></label> <label for="hostField" class="cr1"></label>
</li> </li>
<li class="tight-form-item">
<label class="checkbox-label" for="hostField">Host Technical Name</label>
<input class="cr1"
id="hostTechNameField"
type="checkbox"
ng-model="editor.panel.hostTechNameField"
ng-checked="editor.panel.hostTechNameField">
<label for="hostTechNameField" class="cr1"></label>
</li>
<li class="tight-form-item"> <li class="tight-form-item">
<label class="checkbox-label" for="statusField">Status</label> <label class="checkbox-label" for="statusField">Status</label>
<input class="cr1" <input class="cr1"
@@ -176,6 +185,14 @@
ng-checked="editor.panel.severityField"> ng-checked="editor.panel.severityField">
<label for="severityField" class="cr1"></label> <label for="severityField" class="cr1"></label>
</li> </li>
</ul>
<div class="clearfix"></div>
</div>
<div class="tight-form">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 100px">
<strong>&nbsp;</strong>
</li>
<li class="tight-form-item"> <li class="tight-form-item">
<label class="checkbox-label" for="lastChangeField">Last change</label> <label class="checkbox-label" for="lastChangeField">Last change</label>
<input class="cr1" <input class="cr1"
@@ -194,7 +211,7 @@
ng-checked="editor.panel.ageField"> ng-checked="editor.panel.ageField">
<label for="ageField" class="cr1"></label> <label for="ageField" class="cr1"></label>
</li> </li>
<li class="tight-form-item last"> <li class="tight-form-item">
<label class="checkbox-label" for="infoField">Info</label> <label class="checkbox-label" for="infoField">Info</label>
<input class="cr1" <input class="cr1"
id="infoField" id="infoField"
@@ -206,6 +223,7 @@
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list"> <ul class="tight-form-list">
<li class="tight-form-item"> <li class="tight-form-item">

View File

@@ -9,6 +9,11 @@
Host Host
</div> </div>
</th> </th>
<th ng-if="ctrl.panel.hostTechNameField" style="width: 15%">
<div class="triggers-panel-table-header-inner pointer">
Technical Name
</div>
</th>
<th ng-if="ctrl.panel.statusField" style="width: 85px"> <th ng-if="ctrl.panel.statusField" style="width: 85px">
<div class="triggers-panel-table-header-inner pointer">Status</div> <div class="triggers-panel-table-header-inner pointer">Status</div>
</th> </th>
@@ -38,6 +43,12 @@
</div> </div>
</td> </td>
<td ng-if="ctrl.panel.hostTechNameField">
<div>
<span><strong>{{trigger.hostTechName}}</strong></span>
</div>
</td>
<td ng-if="ctrl.panel.statusField" style="background-color: {{trigger.color}}; color: white"> <td ng-if="ctrl.panel.statusField" style="background-color: {{trigger.color}}; color: white">
<div> <div>
{{ctrl.triggerStatusMap[trigger.value]}} {{ctrl.triggerStatusMap[trigger.value]}}

View File

@@ -140,6 +140,7 @@ class TriggerPanelCtrl extends MetricsPanelCtrl {
// Set host that the trigger belongs // Set host that the trigger belongs
if (trigger.hosts.length) { if (trigger.hosts.length) {
triggerObj.host = trigger.hosts[0].name; triggerObj.host = trigger.hosts[0].name;
triggerObj.hostTechName = trigger.hosts[0].host;
} }
// Set color // Set color