set default for "Newer than" option
This commit is contained in:
@@ -110,8 +110,8 @@
|
|||||||
<label class="gf-form-label width-10">Newer than</label>
|
<label class="gf-form-label width-10">Newer than</label>
|
||||||
<input class="gf-form-input width-8"
|
<input class="gf-form-input width-8"
|
||||||
ng-model="ctrl.panel.highlightNewerThan"
|
ng-model="ctrl.panel.highlightNewerThan"
|
||||||
ng-model-onblur
|
placeholder="1h"
|
||||||
ng-change="ctrl.render()">
|
ng-model-onblur ng-change="ctrl.render()">
|
||||||
</div>
|
</div>
|
||||||
<gf-form-switch class="gf-form"
|
<gf-form-switch class="gf-form"
|
||||||
label-class="width-16"
|
label-class="width-16"
|
||||||
|
|||||||
11
dist/panel-triggers/triggers_panel_ctrl.js
vendored
11
dist/panel-triggers/triggers_panel_ctrl.js
vendored
@@ -602,9 +602,14 @@ System.register(['lodash', 'jquery', 'moment', '../datasource-zabbix/utils', 'ap
|
|||||||
}, {
|
}, {
|
||||||
key: 'isNewTrigger',
|
key: 'isNewTrigger',
|
||||||
value: function isNewTrigger(trigger) {
|
value: function isNewTrigger(trigger) {
|
||||||
var highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan);
|
try {
|
||||||
var durationSec = Date.now() - trigger.lastchangeUnix * 1000;
|
var highlightNewerThanDefault = '1h';
|
||||||
return durationSec < highlightIntervalMs;
|
var highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan || highlightNewerThanDefault);
|
||||||
|
var durationSec = Date.now() - trigger.lastchangeUnix * 1000;
|
||||||
|
return durationSec < highlightIntervalMs;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'link',
|
key: 'link',
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -110,8 +110,8 @@
|
|||||||
<label class="gf-form-label width-10">Newer than</label>
|
<label class="gf-form-label width-10">Newer than</label>
|
||||||
<input class="gf-form-input width-8"
|
<input class="gf-form-input width-8"
|
||||||
ng-model="ctrl.panel.highlightNewerThan"
|
ng-model="ctrl.panel.highlightNewerThan"
|
||||||
ng-model-onblur
|
placeholder="1h"
|
||||||
ng-change="ctrl.render()">
|
ng-model-onblur ng-change="ctrl.render()">
|
||||||
</div>
|
</div>
|
||||||
<gf-form-switch class="gf-form"
|
<gf-form-switch class="gf-form"
|
||||||
label-class="width-16"
|
label-class="width-16"
|
||||||
|
|||||||
@@ -458,9 +458,14 @@ export class TriggerPanelCtrl extends PanelCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isNewTrigger(trigger) {
|
isNewTrigger(trigger) {
|
||||||
const highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan);
|
try {
|
||||||
const durationSec = (Date.now() - trigger.lastchangeUnix * 1000);
|
const highlightNewerThanDefault = '1h';
|
||||||
return durationSec < highlightIntervalMs;
|
const highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan || highlightNewerThanDefault);
|
||||||
|
const durationSec = (Date.now() - trigger.lastchangeUnix * 1000);
|
||||||
|
return durationSec < highlightIntervalMs;
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
link(scope, elem, attrs, ctrl) {
|
link(scope, elem, attrs, ctrl) {
|
||||||
|
|||||||
Reference in New Issue
Block a user