mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tracking opentsdb version in opentsdb config
This commit is contained in:
parent
517721eaa4
commit
f90fda8e6f
21
public/app/plugins/datasource/opentsdb/config_ctrl.ts
Normal file
21
public/app/plugins/datasource/opentsdb/config_ctrl.ts
Normal file
@ -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.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 = {};
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
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,
|
||||
|
@ -1,2 +1,15 @@
|
||||
<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'));
|
||||
|
Loading…
Reference in New Issue
Block a user