Commit f577dd0f by thuck

Including LIMIT, SLIMIT and ORDER BY time on influxdb #6065

Initial work for the query builder interface
parent fe970f66
......@@ -21,6 +21,7 @@ export default class InfluxQuery {
target.policy = target.policy || 'default';
target.dsType = 'influxdb';
target.resultFormat = target.resultFormat || 'time_series';
target.orderByTime = target.orderByTime || 'ASC';
target.tags = target.tags || [];
target.groupBy = target.groupBy || [
{type: 'time', params: ['$__interval']},
......
......@@ -72,11 +72,33 @@
</div>
</div>
<div class="gf-form-inline">
<div class="gf-form">
<label class="gf-form-label query-keyword width-9">ORDER BY time</label>
<div class="gf-form-select-wrapper">
<select class="gf-form-input gf-size-auto" ng-model="ctrl.target.orderByTime" ng-options="f.value as f.text for f in ctrl.orderByTime" ng-change="ctrl.refresh()"></select>
</div>
</div>
<div class="gf-form max-width-30">
<label class="gf-form-label query-keyword width-7">LIMIT</label>
<input type="text" class="gf-form-input" ng-model="ctrl.target.limit" spellcheck='false' placeholder="No Limit" ng-blur="ctrl.refresh()">
</div>
<div class="gf-form max-width-30">
<label class="gf-form-label query-keyword width-7">SLIMIT</label>
<input type="text" class="gf-form-input" ng-model="ctrl.target.slimit" spellcheck='false' placeholder="No Limit" ng-blur="ctrl.refresh()">
</div>
<div class="gf-form gf-form--grow">
<div class="gf-form-label gf-form-label--grow"></div>
</div>
</div>
</div>
<div class="gf-form-inline">
<div class="gf-form max-width-30">
<label class="gf-form-label query-keyword width-7">ALIAS BY</label>
<label class="gf-form-label query-keyword width-9">ALIAS BY</label>
<input type="text" class="gf-form-input" ng-model="ctrl.target.alias" spellcheck='false' placeholder="Naming pattern" ng-blur="ctrl.refresh()">
</div>
<div class="gf-form">
......
......@@ -14,6 +14,7 @@ export class InfluxQueryCtrl extends QueryCtrl {
queryBuilder: any;
groupBySegment: any;
resultFormats: any[];
orderByTime: any[];
policySegment: any;
tagSegments: any[];
selectMenu: any;
......@@ -32,6 +33,10 @@ export class InfluxQueryCtrl extends QueryCtrl {
{text: 'Time series', value: 'time_series'},
{text: 'Table', value: 'table'},
];
this.orderByTime = [
{text: 'Ascending', value: 'ASC'},
{text: 'Descending', value: 'DESC'},
];
this.policySegment = uiSegmentSrv.newSegment(this.target.policy);
......
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