Merge branch 'master' of https://github.com/g-goessel/grafana-zabbix into g-goessel-master

This commit is contained in:
Alexander Zobnin
2018-08-28 20:34:37 +03:00
3 changed files with 6 additions and 8 deletions

View File

@@ -50,8 +50,8 @@ export class ZabbixDatasource {
// Direct DB Connection options // Direct DB Connection options
let dbConnectionOptions = jsonData.dbConnection || {}; let dbConnectionOptions = jsonData.dbConnection || {};
this.enableDirectDBConnection = dbConnectionOptions.enable; this.enableDirectDBConnection = dbConnectionOptions.enable || jsonData.dbConnectionEnable || false;
this.datasourceId = dbConnectionOptions.datasourceId; this.datasourceId = dbConnectionOptions.datasourceId || jsonData.dbConnectionDatasourceId;
let zabbixOptions = { let zabbixOptions = {
url: this.url, url: this.url,

View File

@@ -79,9 +79,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.current.jsonData.dbConnection.enable"> checked="ctrl.current.jsonData.dbConnectionEnable">
</gf-form-switch> </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"> <div class="gf-form max-width-20">
<span class="gf-form-label width-12"> <span class="gf-form-label width-12">
SQL Data Source SQL Data Source
@@ -94,7 +94,7 @@
</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.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"> ng-options="ds.id as ds.name for ds in ctrl.sqlDataSources">
</select> </select>
</div> </div>

View File

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