Add Problems (Alerting) query type to UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Wesley van Tilburg
2026-01-15 14:00:53 +00:00
parent 7ee9487be1
commit 9b38ec17d5
2 changed files with 8 additions and 1 deletions

View File

@@ -55,6 +55,11 @@ const zabbixQueryTypeOptions: Array<ComboboxOption<QueryType>> = [
label: 'User macros',
description: 'User Macros',
},
{
value: c.MODE_PROBLEMS_ALERTING,
label: 'Problems (Alerting)',
description: 'Query problems for alerting (returns 0/1 time series)',
},
];
const getDefaultQuery: () => Partial<ZabbixMetricsQuery> = () => ({
@@ -226,6 +231,7 @@ export const QueryEditor = ({ query, datasource, onChange, onRunQuery, range }:
{queryType === c.MODE_TEXT && renderTextMetricsEditor()}
{queryType === c.MODE_ITSERVICE && renderITServicesEditor()}
{queryType === c.MODE_PROBLEMS && renderProblemsEditor()}
{queryType === c.MODE_PROBLEMS_ALERTING && renderProblemsEditor()}
{queryType === c.MODE_TRIGGERS && renderTriggersEditor()}
{queryType === c.MODE_MACROS && renderUserMacrosEditor()}
<QueryOptionsEditor queryType={queryType} queryOptions={query.options} onChange={onOptionsChange} />

View File

@@ -9,7 +9,8 @@ export type QueryType =
| typeof c.MODE_ITEMID
| typeof c.MODE_TRIGGERS
| typeof c.MODE_PROBLEMS
| typeof c.MODE_MACROS;
| typeof c.MODE_MACROS
| typeof c.MODE_PROBLEMS_ALERTING;
type BaseQuery = { queryType: QueryType; datasourceId: number } & DataQuery;