Commit f90fda8e by utkarshcmu

Tracking opentsdb version in opentsdb config

parent 517721ea
///<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.withCredentials = instanceSettings.withCredentials;
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.tagKeys = {};
......
import {OpenTsDatasource} from './datasource';
import {OpenTsQueryCtrl} from './query_ctrl';
class OpenTsConfigCtrl {
static templateUrl = 'partials/config.html';
}
import {OpenTsConfigCtrl} from './config_ctrl';
export {
OpenTsDatasource as Datasource,
......
<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() {
var ctx = new helpers.ServiceTestContext();
var instanceSettings = {url: '' };
var instanceSettings = {url: '', jsonData: { tsdbVersion: 1 }};
beforeEach(angularMocks.module('grafana.core'));
beforeEach(angularMocks.module('grafana.services'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment