problems: limit events in timeline
This commit is contained in:
@@ -368,7 +368,7 @@ export class ZabbixAPIConnector {
|
|||||||
return this.request('trigger.get', params);
|
return this.request('trigger.get', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
getEvents(objectids, timeFrom, timeTo, showEvents) {
|
getEvents(objectids, timeFrom, timeTo, showEvents, limit) {
|
||||||
var params = {
|
var params = {
|
||||||
output: 'extend',
|
output: 'extend',
|
||||||
time_from: timeFrom,
|
time_from: timeFrom,
|
||||||
@@ -376,9 +376,15 @@ export class ZabbixAPIConnector {
|
|||||||
objectids: objectids,
|
objectids: objectids,
|
||||||
select_acknowledges: 'extend',
|
select_acknowledges: 'extend',
|
||||||
selectHosts: 'extend',
|
selectHosts: 'extend',
|
||||||
value: showEvents
|
value: showEvents,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (limit) {
|
||||||
|
params.limit = limit;
|
||||||
|
params.sortfield = 'clock';
|
||||||
|
params.sortorder = 'DESC';
|
||||||
|
}
|
||||||
|
|
||||||
return this.request('event.get', params);
|
return this.request('event.get', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {migratePanelSchema, CURRENT_SCHEMA_VERSION} from './migrations';
|
|||||||
import { ProblemList } from './components/Problems';
|
import { ProblemList } from './components/Problems';
|
||||||
|
|
||||||
const ZABBIX_DS_ID = 'alexanderzobnin-zabbix-datasource';
|
const ZABBIX_DS_ID = 'alexanderzobnin-zabbix-datasource';
|
||||||
|
const PROBLEM_EVENTS_LIMIT = 100;
|
||||||
|
|
||||||
export const DEFAULT_TARGET = {
|
export const DEFAULT_TARGET = {
|
||||||
group: {filter: ""},
|
group: {filter: ""},
|
||||||
@@ -470,7 +471,7 @@ export class TriggerPanelCtrl extends PanelCtrl {
|
|||||||
const timeTo = Math.ceil(dateMath.parse(this.range.to) / 1000);
|
const timeTo = Math.ceil(dateMath.parse(this.range.to) / 1000);
|
||||||
return this.datasourceSrv.get(trigger.datasource)
|
return this.datasourceSrv.get(trigger.datasource)
|
||||||
.then(datasource => {
|
.then(datasource => {
|
||||||
return datasource.zabbix.getEvents(triggerids, timeFrom, timeTo, [0, 1]);
|
return datasource.zabbix.getEvents(triggerids, timeFrom, timeTo, [0, 1], PROBLEM_EVENTS_LIMIT);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user