Implements proposal #597

This commit is contained in:
g-goessel
2018-07-23 12:15:51 +02:00
committed by GOESSEL Guillaume
parent b96e09cd1c
commit 9cfb7e210a
9 changed files with 16 additions and 22 deletions

View File

@@ -52,9 +52,8 @@ class ZabbixAPIDatasource {
this.disableReadOnlyUsersAck = jsonData.disableReadOnlyUsersAck;
// Direct DB Connection options
let dbConnectionOptions = jsonData.dbConnection || {};
this.enableDirectDBConnection = dbConnectionOptions.enable;
this.sqlDatasourceId = dbConnectionOptions.datasourceId;
this.enableDirectDBConnection = jsonData.dbConnectionEnable || false;
this.sqlDatasourceId = jsonData.dbConnectionDatasourceId;
let zabbixOptions = {
username: this.username,

View File

@@ -79,9 +79,9 @@
<h3 class="page-heading">Direct DB Connection</h3>
<gf-form-switch class="gf-form" label-class="width-12"
label="Enable"
checked="ctrl.current.jsonData.dbConnection.enable">
checked="ctrl.current.jsonData.dbConnectionEnable">
</gf-form-switch>
<div ng-if="ctrl.current.jsonData.dbConnection.enable">
<div ng-if="ctrl.current.jsonData.dbConnectionEnable">
<div class="gf-form max-width-20">
<span class="gf-form-label width-12">
SQL Data Source
@@ -94,7 +94,7 @@
</info-popover>
</span>
<div class="gf-form-select-wrapper max-width-16">
<select class="gf-form-input" ng-model="ctrl.current.jsonData.dbConnection.datasourceId"
<select class="gf-form-input" ng-model="ctrl.current.jsonData.dbConnectionDatasourceId"
ng-options="ds.id as ds.name for ds in ctrl.sqlDataSources">
</select>
</div>

View File

@@ -15,9 +15,7 @@ describe('ZabbixDatasource', () => {
trends: true,
trendsFrom: '14d',
trendsRange: '7d',
dbConnection: {
enabled: false
}
dbConnectionEnable: false
}
};
ctx.templateSrv = {};