Variable query editor (#856)
* refactor: convert module to typescript * refactor: covert utils to typescript * variable query editor WIP * variable editor: fix type error after grafana/ui update * variable editor: use FormLabel from grafana/ui * variable editor: refactor * variable editor: input validation and highlights * variable editor: fix tests * variable query: fix backward compatibility with empty queries * fix linter errors * variable editor: fix variable replacement in queries
This commit is contained in:
30
src/datasource-zabbix/types.ts
Normal file
30
src/datasource-zabbix/types.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { SelectableValue } from "@grafana/data";
|
||||
|
||||
export interface VariableQueryProps {
|
||||
query: LegacyVariableQuery;
|
||||
onChange: (query: VariableQuery, definition: string) => void;
|
||||
datasource: any;
|
||||
templateSrv: any;
|
||||
}
|
||||
|
||||
export interface VariableQueryData extends VariableQuery {
|
||||
selectedQueryType: SelectableValue<VariableQueryTypes>;
|
||||
legacyQuery?: string;
|
||||
}
|
||||
|
||||
export interface VariableQuery {
|
||||
queryType: VariableQueryTypes;
|
||||
group?: string;
|
||||
host?: string;
|
||||
application?: string;
|
||||
item?: string;
|
||||
}
|
||||
|
||||
export type LegacyVariableQuery = VariableQuery | string;
|
||||
|
||||
export enum VariableQueryTypes {
|
||||
Group = 'group',
|
||||
Host = 'host',
|
||||
Application = 'application',
|
||||
Item = 'item',
|
||||
}
|
||||
Reference in New Issue
Block a user