Problems: fix tags add/remove

This commit is contained in:
Alexander Zobnin
2020-05-08 15:11:55 +03:00
parent 0381d77519
commit 001d911282
3 changed files with 35 additions and 18 deletions

View File

@@ -1,10 +1,21 @@
import _ from 'lodash';
import { getNextRefIdChar } from './utils';
import { getDefaultTarget } from './triggers_panel_ctrl';
// Actual schema version
export const CURRENT_SCHEMA_VERSION = 8;
export const getDefaultTarget = (targets?) => {
return {
group: {filter: ""},
host: {filter: ""},
application: {filter: ""},
trigger: {filter: ""},
tags: {filter: ""},
proxy: {filter: ""},
refId: getNextRefIdChar(targets),
};
};
export function getDefaultTargetOptions() {
return {
hostsInMaintenance: true,
@@ -89,6 +100,7 @@ export function migratePanelSchema(panel) {
// set queryType to PROBLEMS
target.queryType = 5;
target.options = getDefaultTargetOptions();
_.defaults(target, {tags: {filter: ""}});
}
}