AlertingNG: Enable UI to Save Alert Definitions (#30394)

* transform state to what the api expects

* add expr prop to dataquery

* Add evalutate field

* add refid picker to options

* minor fix to enable save

* fix  import

* more fixes after merge

* use default datasource if not changed

* replace name with title

* Change name in ui as well

* remove not used loadDataSources function

* prettier fixes

* look up datasource

* correct datasource per query model

* revert dataquery change, use expressionid const

* fix for type

* fix faulty const

* description readonly
This commit is contained in:
Peter Holmberg
2021-01-22 16:08:54 +01:00
committed by GitHub
parent 7126a91901
commit 529f564bd4
7 changed files with 159 additions and 79 deletions

View File

@@ -146,13 +146,14 @@ export interface AlertDefinitionState {
export interface AlertDefinition {
id: number;
name: string;
title: string;
description: string;
condition: AlertCondition;
interval: number;
}
export interface AlertCondition {
ref: string;
refId: string;
queriesAndExpressions: any[];
}

View File

@@ -1,7 +1,8 @@
import { DataQuery } from '@grafana/data';
import { ExpressionQuery } from '../features/expressions/types';
export interface QueryGroupOptions {
queries: DataQuery[];
queries: Array<DataQuery | ExpressionQuery>;
dataSource: QueryGroupDataSource;
maxDataPoints?: number | null;
minInterval?: string | null;
@@ -13,7 +14,7 @@ export interface QueryGroupOptions {
};
}
interface QueryGroupDataSource {
export interface QueryGroupDataSource {
name?: string | null;
uid?: string;
default?: boolean;