Tracking opentsdb version in opentsdb config
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
///<reference path="../../../headers/common.d.ts" />
|
||||||
|
|
||||||
|
import angular from 'angular';
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
|
export class OpenTsConfigCtrl {
|
||||||
|
static templateUrl = 'public/app/plugins/datasource/opentsdb/partials/config.html';
|
||||||
|
current: any;
|
||||||
|
|
||||||
|
/** @ngInject */
|
||||||
|
constructor($scope) {
|
||||||
|
this.current.jsonData = this.current.jsonData || {};
|
||||||
|
this.current.jsonData.tsdbVersion = this.current.jsonData.tsdbVersion || 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
tsdbVersions = [
|
||||||
|
{name: '<=2.1', value: 1},
|
||||||
|
{name: '>=2.2', value: 2},
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,6 +14,11 @@ function (angular, _, dateMath) {
|
|||||||
this.name = instanceSettings.name;
|
this.name = instanceSettings.name;
|
||||||
this.withCredentials = instanceSettings.withCredentials;
|
this.withCredentials = instanceSettings.withCredentials;
|
||||||
this.basicAuth = instanceSettings.basicAuth;
|
this.basicAuth = instanceSettings.basicAuth;
|
||||||
|
this.tsdbVersions = [
|
||||||
|
{name: '<=2.1', value: 1},
|
||||||
|
{name: '>=2.2', value: 2},
|
||||||
|
];
|
||||||
|
this.tsdbVersion = instanceSettings.jsonData.tsdbVersion;
|
||||||
this.supportMetrics = true;
|
this.supportMetrics = true;
|
||||||
this.tagKeys = {};
|
this.tagKeys = {};
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import {OpenTsDatasource} from './datasource';
|
import {OpenTsDatasource} from './datasource';
|
||||||
import {OpenTsQueryCtrl} from './query_ctrl';
|
import {OpenTsQueryCtrl} from './query_ctrl';
|
||||||
|
import {OpenTsConfigCtrl} from './config_ctrl';
|
||||||
class OpenTsConfigCtrl {
|
|
||||||
static templateUrl = 'partials/config.html';
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
OpenTsDatasource as Datasource,
|
OpenTsDatasource as Datasource,
|
||||||
|
|||||||
@@ -1,2 +1,15 @@
|
|||||||
<datasource-http-settings current="ctrl.current"></datasource-http-settings>
|
<datasource-http-settings current="ctrl.current"></datasource-http-settings>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<h5>Opentsdb settings</h5>
|
||||||
|
<div class="tight-form last">
|
||||||
|
<ul class="tight-form-list">
|
||||||
|
<li class="tight-form-item" style="width: 80px">
|
||||||
|
Version
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
<select class="input-medium tight-form-input" ng-model="ctrl.current.jsonData.tsdbVersion" ng-options="v.value as v.name for v in ctrl.tsdbVersions"></select>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {OpenTsDatasource} from "../datasource";
|
|||||||
|
|
||||||
describe('opentsdb', function() {
|
describe('opentsdb', function() {
|
||||||
var ctx = new helpers.ServiceTestContext();
|
var ctx = new helpers.ServiceTestContext();
|
||||||
var instanceSettings = {url: '' };
|
var instanceSettings = {url: '', jsonData: { tsdbVersion: 1 }};
|
||||||
|
|
||||||
beforeEach(angularMocks.module('grafana.core'));
|
beforeEach(angularMocks.module('grafana.core'));
|
||||||
beforeEach(angularMocks.module('grafana.services'));
|
beforeEach(angularMocks.module('grafana.services'));
|
||||||
|
|||||||
Reference in New Issue
Block a user