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>
|
||||
<input class="gf-form-input width-8"
|
||||
ng-model="ctrl.panel.highlightNewerThan"
|
||||
ng-model-onblur
|
||||
ng-change="ctrl.render()">
|
||||
placeholder="1h"
|
||||
ng-model-onblur ng-change="ctrl.render()">
|
||||
</div>
|
||||
<gf-form-switch class="gf-form"
|
||||
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',
|
||||
value: function isNewTrigger(trigger) {
|
||||
var highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan);
|
||||
var durationSec = Date.now() - trigger.lastchangeUnix * 1000;
|
||||
return durationSec < highlightIntervalMs;
|
||||
try {
|
||||
var highlightNewerThanDefault = '1h';
|
||||
var highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan || highlightNewerThanDefault);
|
||||
var durationSec = Date.now() - trigger.lastchangeUnix * 1000;
|
||||
return durationSec < highlightIntervalMs;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
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>
|
||||
<input class="gf-form-input width-8"
|
||||
ng-model="ctrl.panel.highlightNewerThan"
|
||||
ng-model-onblur
|
||||
ng-change="ctrl.render()">
|
||||
placeholder="1h"
|
||||
ng-model-onblur ng-change="ctrl.render()">
|
||||
</div>
|
||||
<gf-form-switch class="gf-form"
|
||||
label-class="width-16"
|
||||
|
||||
@@ -458,9 +458,14 @@ export class TriggerPanelCtrl extends PanelCtrl {
|
||||
}
|
||||
|
||||
isNewTrigger(trigger) {
|
||||
const highlightIntervalMs = utils.parseInterval(this.panel.highlightNewerThan);
|
||||
const durationSec = (Date.now() - trigger.lastchangeUnix * 1000);
|
||||
return durationSec < highlightIntervalMs;
|
||||
try {
|
||||
const highlightNewerThanDefault = '1h';
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user