This commit is contained in:
Alec Sears
2019-10-17 16:06:35 -05:00
parent 7c3f26a7f4
commit 05243a9701
9 changed files with 158 additions and 33 deletions

View File

@@ -1,4 +1,5 @@
import _ from 'lodash';
import { ZabbixMetricsQuery } from './types';
/**
* Query format migration.
@@ -19,7 +20,7 @@ export function isGrafana2target(target) {
}
}
export function migrateFrom2To3version(target) {
export function migrateFrom2To3version(target: ZabbixMetricsQuery) {
target.group.filter = target.group.name === "*" ? "/.*/" : target.group.name;
target.host.filter = target.host.name === "*" ? convertToRegex(target.hostFilter) : target.host.name;
target.application.filter = target.application.name === "*" ? "" : target.application.name;