fix direct DB connection datasource config, closes #731
This commit is contained in:
@@ -29,9 +29,7 @@ export class ZabbixDSConfigController {
|
|||||||
this.current.jsonData = migrateDSConfig(this.current.jsonData);
|
this.current.jsonData = migrateDSConfig(this.current.jsonData);
|
||||||
_.defaults(this.current.jsonData, defaultConfig);
|
_.defaults(this.current.jsonData, defaultConfig);
|
||||||
|
|
||||||
this.dbConnectionEnable = this.current.jsonData.dbConnectionEnable;
|
|
||||||
this.dbConnectionDatasourceId = this.current.jsonData.dbConnectionDatasourceId;
|
this.dbConnectionDatasourceId = this.current.jsonData.dbConnectionDatasourceId;
|
||||||
|
|
||||||
this.dbDataSources = this.getSupportedDBDataSources();
|
this.dbDataSources = this.getSupportedDBDataSources();
|
||||||
this.zabbixVersions = _.cloneDeep(zabbixVersions);
|
this.zabbixVersions = _.cloneDeep(zabbixVersions);
|
||||||
this.autoDetectZabbixVersion();
|
this.autoDetectZabbixVersion();
|
||||||
@@ -81,4 +79,8 @@ export class ZabbixDSConfigController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onDBConnectionDatasourceChange() {
|
||||||
|
this.current.jsonData.dbConnectionDatasourceId = this.dbConnectionDatasourceId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,9 +88,9 @@
|
|||||||
<h3 class="page-heading">Direct DB Connection</h3>
|
<h3 class="page-heading">Direct DB Connection</h3>
|
||||||
<gf-form-switch class="gf-form" label-class="width-12"
|
<gf-form-switch class="gf-form" label-class="width-12"
|
||||||
label="Enable"
|
label="Enable"
|
||||||
checked="ctrl.dbConnectionEnable">
|
checked="ctrl.current.jsonData.dbConnectionEnable">
|
||||||
</gf-form-switch>
|
</gf-form-switch>
|
||||||
<div ng-if="ctrl.dbConnectionEnable">
|
<div ng-if="ctrl.current.jsonData.dbConnectionEnable">
|
||||||
<div class="gf-form max-width-30">
|
<div class="gf-form max-width-30">
|
||||||
<span class="gf-form-label width-12">
|
<span class="gf-form-label width-12">
|
||||||
Data Source
|
Data Source
|
||||||
@@ -103,8 +103,10 @@
|
|||||||
</info-popover>
|
</info-popover>
|
||||||
</span>
|
</span>
|
||||||
<div class="gf-form-select-wrapper max-width-16">
|
<div class="gf-form-select-wrapper max-width-16">
|
||||||
<select class="gf-form-input" ng-model="ctrl.dbConnectionDatasourceId"
|
<select class="gf-form-input"
|
||||||
ng-options="ds.id as ds.name for ds in ctrl.dbDataSources">
|
ng-model="ctrl.dbConnectionDatasourceId"
|
||||||
|
ng-options="ds.id as ds.name for ds in ctrl.dbDataSources"
|
||||||
|
ng-change="ctrl.onDBConnectionDatasourceChange()">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user