add migrations for datasource config
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import _ from 'lodash';
|
||||
import { migrateDSConfig } from './migrations';
|
||||
|
||||
const SUPPORTED_SQL_DS = ['mysql', 'postgres'];
|
||||
|
||||
const defaultConfig = {
|
||||
dbConnection: {
|
||||
enable: false,
|
||||
}
|
||||
trends: false,
|
||||
dbConnectionEnable: false,
|
||||
dbConnectionDatasourceId: null,
|
||||
alerting: false,
|
||||
addThresholds: false,
|
||||
alertingMinSeverity: 3,
|
||||
disableReadOnlyUsersAck: false
|
||||
};
|
||||
|
||||
export class ZabbixDSConfigController {
|
||||
@@ -14,6 +19,7 @@ export class ZabbixDSConfigController {
|
||||
constructor($scope, $injector, datasourceSrv) {
|
||||
this.datasourceSrv = datasourceSrv;
|
||||
|
||||
this.current.jsonData = migrateDSConfig(this.current.jsonData);
|
||||
_.defaults(this.current.jsonData, defaultConfig);
|
||||
this.sqlDataSources = this.getSupportedSQLDataSources();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user