SLA support in Zabbix 6.0 (#1547)

This commit is contained in:
Alexander Zobnin
2022-12-29 15:32:39 +03:00
committed by GitHub
parent 42281a6577
commit 1cee6f0ae3
8 changed files with 316 additions and 117 deletions

View File

@@ -11,7 +11,7 @@ import { QueryOptionsEditor } from './QueryEditor/QueryOptionsEditor';
import { TextMetricsQueryEditor } from './QueryEditor/TextMetricsQueryEditor';
import { ProblemsQueryEditor } from './QueryEditor/ProblemsQueryEditor';
import { ItemIdQueryEditor } from './QueryEditor/ItemIdQueryEditor';
import { ITServicesQueryEditor } from './QueryEditor/ITServicesQueryEditor';
import { ServicesQueryEditor } from './QueryEditor/ServicesQueryEditor';
import { TriggersQueryEditor } from './QueryEditor/TriggersQueryEditor';
const zabbixQueryTypeOptions: Array<SelectableValue<string>> = [
@@ -27,8 +27,8 @@ const zabbixQueryTypeOptions: Array<SelectableValue<string>> = [
},
{
value: c.MODE_ITSERVICE,
label: 'IT Services',
description: 'Query IT Services data',
label: 'Services',
description: 'Query services SLA',
},
{
value: c.MODE_ITEMID,
@@ -75,9 +75,10 @@ const getDefaultQuery: () => Partial<ZabbixMetricsQuery> = () => ({
},
});
function getSLAQueryDefaults() {
function getSLAQueryDefaults(): Partial<ZabbixMetricsQuery> {
return {
itServiceFilter: '',
slaFilter: '',
slaProperty: 'sla',
slaInterval: 'none',
};
@@ -166,7 +167,7 @@ export const QueryEditor = ({ query, datasource, onChange, onRunQuery }: ZabbixQ
const renderITServicesEditor = () => {
return (
<>
<ITServicesQueryEditor query={query} datasource={datasource} onChange={onChangeInternal} />
<ServicesQueryEditor query={query} datasource={datasource} onChange={onChangeInternal} />
<QueryFunctionsEditor query={query} onChange={onChangeInternal} />
</>
);