config page: rename SQL data sources to DB data sources

This commit is contained in:
Alexander Zobnin
2018-10-31 10:35:56 +03:00
parent 054e5518c5
commit d061a3ddce
2 changed files with 9 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ import _ from 'lodash';
import { migrateDSConfig } from './migrations'; import { migrateDSConfig } from './migrations';
const SUPPORTED_SQL_DS = ['mysql', 'postgres', 'influxdb']; const SUPPORTED_SQL_DS = ['mysql', 'postgres', 'influxdb'];
const zabbixVersions = [ const zabbixVersions = [
{ name: '2.x', value: 2 }, { name: '2.x', value: 2 },
{ name: '3.x', value: 3 }, { name: '3.x', value: 3 },
@@ -27,12 +28,12 @@ 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.sqlDataSources = this.getSupportedSQLDataSources(); this.dbDataSources = this.getSupportedDBDataSources();
this.zabbixVersions = _.cloneDeep(zabbixVersions); this.zabbixVersions = _.cloneDeep(zabbixVersions);
this.autoDetectZabbixVersion(); this.autoDetectZabbixVersion();
} }
getSupportedSQLDataSources() { getSupportedDBDataSources() {
let datasources = this.datasourceSrv.getAll(); let datasources = this.datasourceSrv.getAll();
return _.filter(datasources, ds => { return _.filter(datasources, ds => {
return _.includes(SUPPORTED_SQL_DS, ds.type); return _.includes(SUPPORTED_SQL_DS, ds.type);

View File

@@ -91,20 +91,20 @@
checked="ctrl.current.jsonData.dbConnectionEnable"> checked="ctrl.current.jsonData.dbConnectionEnable">
</gf-form-switch> </gf-form-switch>
<div ng-if="ctrl.current.jsonData.dbConnectionEnable"> <div ng-if="ctrl.current.jsonData.dbConnectionEnable">
<div class="gf-form max-width-20"> <div class="gf-form max-width-30">
<span class="gf-form-label width-12"> <span class="gf-form-label width-12">
SQL Data Source Data Source
<info-popover mode="right-normal"> <info-popover mode="right-normal">
Select SQL Data Source for Zabbix database. Select Data Source for Zabbix history database.
In order to use this feature you should <a href="/datasources/new" target="_blank">create</a> and In order to use this feature it should be <a href="/datasources/new" target="_blank">created</a> and
configure it first. Zabbix plugin uses this data source for querying history data directly from database. configured first. Zabbix plugin uses this data source for querying history data directly from the database.
This way usually faster than pulling data from Zabbix API, especially on the wide time ranges, and reduces This way usually faster than pulling data from Zabbix API, especially on the wide time ranges, and reduces
amount of data transfered. amount of data transfered.
</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.dbConnectionDatasourceId" <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.dbDataSources">
</select> </select>
</div> </div>
</div> </div>