diff --git a/src/datasource-zabbix/constants.ts b/src/datasource-zabbix/constants.ts index a30aa4c..ad90cd2 100644 --- a/src/datasource-zabbix/constants.ts +++ b/src/datasource-zabbix/constants.ts @@ -44,3 +44,5 @@ export const TRIGGER_SEVERITY = [ export const MIN_SLA_INTERVAL = 3600; export const RANGE_VARIABLE_VALUE = 'range_series'; + +export const DEFAULT_ZABBIX_PROBLEMS_LIMIT = 1001; diff --git a/src/datasource-zabbix/query.controller.js b/src/datasource-zabbix/query.controller.js index eecc31a..d78d44d 100644 --- a/src/datasource-zabbix/query.controller.js +++ b/src/datasource-zabbix/query.controller.js @@ -42,10 +42,11 @@ function getProblemsTargetDefaults() { return { showProblems: ShowProblemTypes.Problems, options: { - sortTriggersBy: 'default', + sortProblems: 'default', acknowledged: 2, hostsInMaintenance: false, hostProxy: false, + limit: c.DEFAULT_ZABBIX_PROBLEMS_LIMIT, }, }; } @@ -386,7 +387,7 @@ export class ZabbixQueryController extends QueryCtrl { }; const problemsOptionsMap = { - sortTriggersBy: "Sort problems", + sortProblems: "Sort problems", acknowledged: "Acknowledged", skipEmptyValues: "Skip empty values", hostsInMaintenance: "Show hosts in maintenance", diff --git a/src/panel-triggers/migrations.ts b/src/panel-triggers/migrations.ts index 8b83b32..1e0adce 100644 --- a/src/panel-triggers/migrations.ts +++ b/src/panel-triggers/migrations.ts @@ -123,10 +123,17 @@ function migrateOptions(panel) { acknowledged = 0; } + // Default limit in Zabbix + let limit = 1001; + if (panel.limit && panel.limit !== 100) { + limit = panel.limit; + } + return { hostsInMaintenance: panel.hostsInMaintenance, sortProblems: panel.sortTriggersBy?.value === 'priority' ? 'priority' : 'default', acknowledged: acknowledged, + limit: limit, }; } diff --git a/src/panel-triggers/specs/migrations.spec.ts b/src/panel-triggers/specs/migrations.spec.ts index 10336ec..6108877 100644 --- a/src/panel-triggers/specs/migrations.spec.ts +++ b/src/panel-triggers/specs/migrations.spec.ts @@ -67,6 +67,7 @@ describe('Triggers Panel schema migration', () => { hostsInMaintenance: false, acknowledged: 0, sortProblems: 'default', + limit: 10, }, } ],