Problems count mode (#1493)

* Problems count mode

* Use tooltip from grafana ui

* Add editors for new modes

* Fix macro mode

* Fix bugs

* Unify editors to use one Triggers editor for all count queries

* Use time range toggle for triggers query, #918

* Add item tags suport for triggers count mode

* Fix triggers count by items

* Use data frames for triggers data, #1441

* Return empty result if no items found

* Add migration for problems count mode

* bump version to 4.3.0-pre

* Add zip task to makefile

* Add schema to query model

* Minor refactor

* Refactor: move components to separate files

* Minor refactor

* Support url in event tags

* Add tooltip with link url

* Update grafana packages

* Fix adding new problems panel

* ProblemDetails: rewrite as a functional component

* minor refactor
This commit is contained in:
Alexander Zobnin
2023-01-20 14:23:46 +01:00
committed by GitHub
parent 445b46a6aa
commit a5c239f77b
31 changed files with 2216 additions and 514 deletions

View File

@@ -34,17 +34,19 @@ export interface ZabbixConnectionTestQuery {
}
export interface ZabbixMetricsQuery extends DataQuery {
schema: number;
queryType: string;
datasourceId?: number;
group?: { filter: string; name?: string };
host?: { filter: string; name?: string };
application?: { filter: string; name?: string };
itemTag?: { filter: string; name?: string };
item?: { filter: string; name?: string };
textFilter?: string;
mode?: number;
itemids?: string;
useCaptureGroups?: boolean;
datasourceId: number;
group: { filter: string; name?: string };
host: { filter: string; name?: string };
application: { filter: string; name?: string };
itemTag: { filter: string; name?: string };
item: { filter: string; name?: string };
macro: { filter: string; macro?: string };
textFilter: string;
mode: number;
itemids: string;
useCaptureGroups: boolean;
proxy?: { filter: string };
trigger?: { filter: string };
itServiceFilter?: string;
@@ -53,6 +55,7 @@ export interface ZabbixMetricsQuery extends DataQuery {
slaInterval?: string;
tags?: { filter: string };
triggers?: { minSeverity: number; acknowledged: number; count: boolean };
countTriggersBy?: 'problems' | 'items' | '';
functions?: MetricFunc[];
options?: ZabbixQueryOptions;
// Problems
@@ -60,6 +63,7 @@ export interface ZabbixMetricsQuery extends DataQuery {
// Deprecated
hostFilter?: string;
itemFilter?: string;
macroFilter?: string;
}
export interface ZabbixQueryOptions {
@@ -77,6 +81,7 @@ export interface ZabbixQueryOptions {
limit?: number;
useTimeRange?: boolean;
severities?: number[];
count?: boolean;
// Annotations
showOkEvents?: boolean;
@@ -186,6 +191,7 @@ export interface VariableQuery {
application?: string;
itemTag?: string;
item?: string;
macro?: string;
}
export type LegacyVariableQuery = VariableQuery | string;
@@ -194,6 +200,7 @@ export enum VariableQueryTypes {
Group = 'group',
Host = 'host',
Application = 'application',
Macro = 'macro',
ItemTag = 'itemTag',
Item = 'item',
ItemValues = 'itemValues',
@@ -330,6 +337,7 @@ export interface ZBXHost {
maintenance_status?: string;
proxy_hostid?: string;
proxy?: any;
description?: string;
}
export interface ZBXItem {
@@ -340,6 +348,13 @@ export interface ZBXItem {
tags?: ZBXItemTag[];
}
export interface ZBXApp {
applicationid: string;
hostid: string;
name: string;
templateids?: string;
}
export interface ZBXItemTag {
tag: string;
value?: string;