Commit 1332ddbc by Torkel Ödegaard

feat(mixed datasources): updated OpenTSDB data source query editor to new model, #436

parent b30dfcf2
......@@ -80,8 +80,7 @@
<div class="tight-form" ng-hide="target.rawQuery">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 44px"></li>
<li class="tight-form-item query-keyword" style="width: 75px;">
<li class="tight-form-item query-keyword tight-form-align" style="width: 75px;">
FROM
</li>
<li>
......@@ -94,9 +93,7 @@
<div class="tight-form" ng-hide="target.rawQuery">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 44px"></li>
<li class="tight-form-item query-keyword" style="width: 75px;">
<li class="tight-form-item query-keyword tight-form-align" style="width: 75px;">
WHERE
</li>
......@@ -109,8 +106,7 @@
<div class="tight-form">
<ul class="tight-form-list" ng-hide="target.rawQuery">
<li class="tight-form-item" style="width: 44px"></li>
<li class="tight-form-item query-keyword">
<li class="tight-form-item query-keyword tight-form-align">
GROUP BY
</li>
......@@ -144,13 +140,14 @@
Alias pattern
</li>
<li>
<input type="text" class="input-medium tight-form-input" ng-model="target.alias" spellcheck='false' placeholder="alias" ng-model-onblur ng-change="get_data()">
</li>
</ul>
<div class="clearfix"></div>
</div>
<input type="text" class="input-medium tight-form-input"
ng-model="target.alias" spellcheck='false' placeholder="alias"
ng-model-onblur ng-change="get_data()"></input>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
define([
'angular',
'lodash',
'kbn',
],
function (angular, _, kbn) {
function (angular, _) {
'use strict';
var module = angular.module('grafana.services');
......@@ -27,12 +26,6 @@ function (angular, _, kbn) {
return { data: _.flatten(_.pluck(results, 'data')) };
});
// console.log(options.targets);
// // get from & to in seconds
// var from = kbn.parseDate(options.range.from).getTime();
// var to = kbn.parseDate(options.range.to).getTime();
//
// return backendSrv.get('/api/metrics/test', { from: from, to: to, maxDataPoints: options.maxDataPoints });
};
return MixedDatasource;
......
......@@ -8,6 +8,13 @@ function (angular, _, kbn) {
var module = angular.module('grafana.controllers');
module.directive('metricQueryEditorOpentsdb', function() {
return {
controller: 'OpenTSDBQueryCtrl',
templateUrl: 'app/plugins/datasource/opentsdb/partials/query.editor.html',
};
});
module.controller('OpenTSDBQueryCtrl', function($scope, $timeout) {
$scope.init = function() {
......@@ -113,6 +120,7 @@ function (angular, _, kbn) {
return errs;
}
$scope.init();
});
});
......@@ -29,6 +29,7 @@
}
}
.spaced-form {
.tight-form {
margin: 7px 0;
......@@ -209,3 +210,7 @@ select.tight-form-input {
}
}
.tight-form-align {
padding-left: 66px;
}
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