fix direct DB connection datasource config, closes #731

This commit is contained in:
Alexander Zobnin
2019-07-05 16:23:36 +03:00
parent 3a7da58302
commit 6b5b5f818b
2 changed files with 10 additions and 6 deletions

View File

@@ -29,9 +29,7 @@ export class ZabbixDSConfigController {
this.current.jsonData = migrateDSConfig(this.current.jsonData);
_.defaults(this.current.jsonData, defaultConfig);
this.dbConnectionEnable = this.current.jsonData.dbConnectionEnable;
this.dbConnectionDatasourceId = this.current.jsonData.dbConnectionDatasourceId;
this.dbDataSources = this.getSupportedDBDataSources();
this.zabbixVersions = _.cloneDeep(zabbixVersions);
this.autoDetectZabbixVersion();
@@ -81,4 +79,8 @@ export class ZabbixDSConfigController {
}
});
}
onDBConnectionDatasourceChange() {
this.current.jsonData.dbConnectionDatasourceId = this.dbConnectionDatasourceId;
}
}

View File

@@ -88,9 +88,9 @@
<h3 class="page-heading">Direct DB Connection</h3>
<gf-form-switch class="gf-form" label-class="width-12"
label="Enable"
checked="ctrl.dbConnectionEnable">
checked="ctrl.current.jsonData.dbConnectionEnable">
</gf-form-switch>
<div ng-if="ctrl.dbConnectionEnable">
<div ng-if="ctrl.current.jsonData.dbConnectionEnable">
<div class="gf-form max-width-30">
<span class="gf-form-label width-12">
Data Source
@@ -103,8 +103,10 @@
</info-popover>
</span>
<div class="gf-form-select-wrapper max-width-16">
<select class="gf-form-input" ng-model="ctrl.dbConnectionDatasourceId"
ng-options="ds.id as ds.name for ds in ctrl.dbDataSources">
<select class="gf-form-input"
ng-model="ctrl.dbConnectionDatasourceId"
ng-options="ds.id as ds.name for ds in ctrl.dbDataSources"
ng-change="ctrl.onDBConnectionDatasourceChange()">
</select>
</div>
</div>