Iss #152 - fixed trigger panel (used new plugin API).

This commit is contained in:
Alexander Zobnin
2016-02-14 18:04:30 +03:00
parent f2201f9461
commit 637cf4c63d
4 changed files with 496 additions and 470 deletions

View File

@@ -8,28 +8,28 @@
</li>
<li>
<input type="text"
ng-model="panel.triggers.group.filter"
bs-typeahead="getGroupNames"
ng-change="onTargetPartChange(panel.triggers.group)"
ng-blur="parseTarget()"
ng-model="editor.panel.triggers.group.filter"
bs-typeahead="editor.getGroupNames"
ng-change="editor.onTargetPartChange(editor.panel.triggers.group)"
ng-blur="editor.parseTarget()"
data-min-length=0
data-items=100
class="input-large tight-form-input"
ng-style="panel.triggers.group.style">
ng-style="editor.panel.triggers.group.style">
</li>
<li class="tight-form-item" style="width: 50px">
Host
</li>
<li>
<input type="text"
ng-model="panel.triggers.host.filter"
bs-typeahead="getHostNames"
ng-change="onTargetPartChange(panel.triggers.host)"
ng-blur="parseTarget()"
ng-model="editor.panel.triggers.host.filter"
bs-typeahead="editor.getHostNames"
ng-change="editor.onTargetPartChange(editor.panel.triggers.host)"
ng-blur="editor.parseTarget()"
data-min-length=0
data-items=100
class="input-large tight-form-input last"
ng-style="panel.triggers.host.style">
ng-style="editor.panel.triggers.host.style">
</li>
</ul>
<div class="clearfix"></div>
@@ -41,26 +41,26 @@
</li>
<li>
<input type="text"
ng-model="panel.triggers.application.filter"
bs-typeahead="getApplicationNames"
ng-change="onTargetPartChange(panel.triggers.application)"
ng-blur="parseTarget()"
ng-model="editor.panel.triggers.application.filter"
bs-typeahead="editor.getApplicationNames"
ng-change="editor.onTargetPartChange(editor.panel.triggers.application)"
ng-blur="editor.parseTarget()"
data-min-length=0
data-items=100
class="input-large tight-form-input"
ng-style="panel.triggers.application.style">
ng-style="editor.panel.triggers.application.style">
</li>
<li class="tight-form-item" style="width: 50px">
Trigger
</li>
<li>
<input type="text"
ng-model="panel.triggers.trigger.filter"
ng-change="onTargetPartChange(panel.triggers.trigger)"
ng-blur="parseTarget()"
ng-model="editor.panel.triggers.trigger.filter"
ng-change="editor.onTargetPartChange(editor.panel.triggers.trigger)"
ng-blur="editor.parseTarget()"
placeholder="trigger name"
class="input-large tight-form-input last"
ng-style="panel.triggers.trigger.style"
ng-style="editor.panel.triggers.trigger.style"
empty-to-null>
</li>
</ul>
@@ -74,9 +74,9 @@
<ul class="tight-form-list">
<li>
<select class="tight-form-input input-large last"
ng-model="panel.datasource"
ng-options="ds for ds in datasources"
ng-change="datasourceChanged()">
ng-model="editor.panel.datasource"
ng-options="ds for ds in editor.datasources"
ng-change="editor.datasourceChanged()">
</select>
</li>
</ul>
@@ -96,9 +96,9 @@
</li>
<li>
<select class="input-medium tight-form-input"
ng-model="panel.showTriggers"
ng-options="f for f in ackFilters"
ng-change="get_data()">
ng-model="editor.panel.showTriggers"
ng-options="f for f in editor.ackFilters"
ng-change="editor.panelCtrl.refreshData()">
</select>
</li>
<li class="tight-form-item" style="width: 13em">
@@ -107,9 +107,9 @@
<li>
<input class="input-small tight-form-input"
type="number"
ng-model="panel.limit"
ng-model="editor.panel.limit"
ng-model-onblur
ng-change="get_data()">
ng-change="editor.panelCtrl.refreshData()">
</li>
</ul>
<div class="clearfix"></div>
@@ -121,9 +121,9 @@
</li>
<li>
<select class="input-medium tight-form-input"
ng-model="panel.sortTriggersBy"
ng-options="f.text for f in sortByFields track by f.value"
ng-change="get_data()">
ng-model="editor.panel.sortTriggersBy"
ng-options="f.text for f in editor.sortByFields track by f.value"
ng-change="editor.panelCtrl.refreshData()">
</select>
</li>
<li class="tight-form-item" style="width: 13em">
@@ -131,9 +131,9 @@
</li>
<li>
<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()">
ng-model="editor.panel.showEvents"
ng-options="f.text for f in editor.showEventsFields track by f.value"
ng-change="editor.panelCtrl.refreshData()">
</select>
</li>
</ul>
@@ -145,58 +145,58 @@
<strong>Show fields</strong>
</li>
<li class="tight-form-item">
<label class="checkbox-label" for="panel.hostField">Host</label>
<label class="checkbox-label" for="hostField">Host</label>
<input class="cr1"
id="panel.hostField"
id="hostField"
type="checkbox"
ng-model="panel.hostField"
ng-checked="panel.hostField">
<label for="panel.hostField" class="cr1"></label>
ng-model="editor.panel.hostField"
ng-checked="editor.panel.hostField">
<label for="hostField" class="cr1"></label>
</li>
<li class="tight-form-item">
<label class="checkbox-label" for="panel.severityField">Status</label>
<label class="checkbox-label" for="statusField">Status</label>
<input class="cr1"
id="panel.statusField"
id="statusField"
type="checkbox"
ng-model="panel.statusField"
ng-checked="panel.statusField">
<label for="panel.statusField" class="cr1"></label>
ng-model="editor.panel.statusField"
ng-checked="editor.panel.statusField">
<label for="statusField" class="cr1"></label>
</li>
<li class="tight-form-item">
<label class="checkbox-label" for="panel.severityField">Severity</label>
<label class="checkbox-label" for="severityField">Severity</label>
<input class="cr1"
id="panel.severityField"
id="severityField"
type="checkbox"
ng-model="panel.severityField"
ng-checked="panel.severityField">
<label for="panel.severityField" class="cr1"></label>
ng-model="editor.panel.severityField"
ng-checked="editor.panel.severityField">
<label for="severityField" class="cr1"></label>
</li>
<li class="tight-form-item">
<label class="checkbox-label" for="panel.lastChangeField">Last change</label>
<label class="checkbox-label" for="lastChangeField">Last change</label>
<input class="cr1"
id="panel.lastChangeField"
id="lastChangeField"
type="checkbox"
ng-model="panel.lastChangeField"
ng-checked="panel.lastChangeField">
<label for="panel.lastChangeField" class="cr1"></label>
ng-model="editor.panel.lastChangeField"
ng-checked="editor.panel.lastChangeField">
<label for="lastChangeField" class="cr1"></label>
</li>
<li class="tight-form-item">
<label class="checkbox-label" for="panel.ageField">Age</label>
<label class="checkbox-label" for="ageField">Age</label>
<input class="cr1"
id="panel.ageField"
id="ageField"
type="checkbox"
ng-model="panel.ageField"
ng-checked="panel.ageField">
<label for="panel.ageField" class="cr1"></label>
ng-model="editor.panel.ageField"
ng-checked="editor.panel.ageField">
<label for="ageField" class="cr1"></label>
</li>
<li class="tight-form-item last">
<label class="checkbox-label" for="panel.infoField">Info</label>
<label class="checkbox-label" for="infoField">Info</label>
<input class="cr1"
id="panel.infoField"
id="infoField"
type="checkbox"
ng-model="panel.infoField"
ng-checked="panel.infoField">
<label for="panel.infoField" class="cr1"></label>
ng-model="editor.panel.infoField"
ng-checked="editor.panel.infoField">
<label for="infoField" class="cr1"></label>
</li>
</ul>
<div class="clearfix"></div>
@@ -205,25 +205,25 @@
<ul class="tight-form-list">
<li class="tight-form-item">
<strong>Custom Last change format</strong>
<label class="checkbox-label" for="panel.customLastChangeFormat">&nbsp;</label>
<label class="checkbox-label" for="customLastChangeFormat">&nbsp;</label>
<input class="cr1"
id="panel.customLastChangeFormat"
id="customLastChangeFormat"
type="checkbox"
ng-change="get_data()"
ng-model="panel.customLastChangeFormat"
ng-checked="panel.customLastChangeFormat">
<label for="panel.customLastChangeFormat" class="cr1"></label>
ng-change="editor.panelCtrl.refreshData()"
ng-model="editor.panel.customLastChangeFormat"
ng-checked="editor.panel.customLastChangeFormat">
<label for="customLastChangeFormat" class="cr1"></label>
</li>
<li ng-if="panel.customLastChangeFormat">
<li ng-if="editor.panel.customLastChangeFormat">
<input type="text"
ng-model="panel.lastChangeFormat"
ng-blur="get_data()"
ng-model="editor.panel.lastChangeFormat"
ng-blur="editor.panelCtrl.refreshData()"
placeholder="dddd, MMMM Do YYYY, h:mm:ss a"
class="tight-form-input"
style="width: 300px"
empty-to-null>
</li>
<li class="tight-form-item last" ng-if="panel.customLastChangeFormat">
<li class="tight-form-item last" ng-if="editor.panel.customLastChangeFormat">
<a href="http://momentjs.com/docs/#/displaying/format/" target="_blank">
<i class="fa fa-question-circle"
bs-tooltip="'See moment.js dosc for time format.'">
@@ -237,8 +237,7 @@
</div>
<div class="section">
<h5>Customize triggers severity and colors</h5>
<div class="tight-form"
ng-repeat="trigger in panel.triggerSeverity">
<div class="tight-form" ng-repeat="trigger in editor.panel.triggerSeverity">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 10px">
{{ trigger.priority }}
@@ -251,10 +250,10 @@
style="color: white"
ng-style="{background: trigger.color}"
ng-model-onblur
ng-change="get_data()">
ng-change="editor.panelCtrl.refreshData()">
</li>
<li class="tight-form-item">
<spectrum-picker ng-model="trigger.color" ng-change="get_data()"></spectrum-picker>
<spectrum-picker ng-model="trigger.color" ng-change="editor.panelCtrl.refreshData()"></spectrum-picker>
</li>
<li class="tight-form-item last" style="width: 28px">
<label class="checkbox-label" for="{{ 'trigger-show-' + $index }}"></label>
@@ -263,7 +262,7 @@
type="checkbox"
ng-model="trigger.show"
ng-checked="trigger.show"
ng-change="get_data()">
ng-change="editor.panelCtrl.refreshData()">
<label for="{{ 'trigger-show-' + $index }}" class="cr1"></label>
</li>
</ul>
@@ -272,12 +271,15 @@
<div class="tight-form last">
<ul class="tight-form-list">
<li class="tight-form-item"
ng-style="{background:panel.okEventColor}"
ng-style="{background:editor.panel.okEventColor}"
style="width: 160px; color: white">
<span style="padding-left: 25px"> OK event color </span>
</li>
<li class="tight-form-item">
<spectrum-picker ng-model="panel.okEventColor" ng-change="get_data()"></spectrum-picker>
<spectrum-picker
ng-model="editor.panel.okEventColor"
ng-change="editor.panelCtrl.refreshData()">
</spectrum-picker>
</li>
</ul>
<div class="clearfix"></div>