mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Smooth transition from opentsdb 2.1 to 2.2
This commit is contained in:
@@ -315,6 +315,8 @@ function (angular, _, dateMath) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query.filters = angular.copy(target.filters);
|
||||||
|
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@
|
|||||||
<ul class="tight-form-list" role="menu">
|
<ul class="tight-form-list" role="menu">
|
||||||
<li class="tight-form-item tight-form-align query-keyword" style="width: 100px">
|
<li class="tight-form-item tight-form-align query-keyword" style="width: 100px">
|
||||||
Filters
|
Filters
|
||||||
|
<tip ng-if="ctrl.tsdbVersion == 2">Filters does not work with tags, either of the two will work but not both.</tip>
|
||||||
</li>
|
</li>
|
||||||
<li ng-repeat="fil in ctrl.target.filters track by $index" class="tight-form-item">
|
<li ng-repeat="fil in ctrl.target.filters track by $index" class="tight-form-item">
|
||||||
{{fil.tagk}} = {{fil.type}}({{fil.filter}}) , groupBy = {{fil.groupBy}}
|
{{fil.tagk}} = {{fil.type}}({{fil.filter}}) , groupBy = {{fil.groupBy}}
|
||||||
@@ -118,15 +119,20 @@
|
|||||||
</input>
|
</input>
|
||||||
|
|
||||||
groupBy <editor-checkbox text="" model="ctrl.target.currentFilterGroupBy"></editor-checkbox>
|
groupBy <editor-checkbox text="" model="ctrl.target.currentFilterGroupBy"></editor-checkbox>
|
||||||
|
|
||||||
<a ng-click="ctrl.addFilter()">
|
|
||||||
add filter
|
|
||||||
</a>
|
|
||||||
<a bs-tooltip="ctrl.errors.filters"
|
<a bs-tooltip="ctrl.errors.filters"
|
||||||
style="color: rgb(229, 189, 28)"
|
style="color: rgb(229, 189, 28)"
|
||||||
ng-show="target.errors.filters">
|
ng-show="ctrl.errors.filters">
|
||||||
<i class="fa fa-warning"></i>
|
<i class="fa fa-warning"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
<a ng-click="ctrl.addFilter()" ng-hide="ctrl.errors.filters">
|
||||||
|
add filter
|
||||||
|
</a>
|
||||||
|
<a ng-click="ctrl.closeAddFilterMode()">
|
||||||
|
<i class="fa fa-remove"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
@@ -163,15 +169,21 @@
|
|||||||
spellcheck='false' bs-typeahead="ctrl.suggestTagValues"
|
spellcheck='false' bs-typeahead="ctrl.suggestTagValues"
|
||||||
data-min-length=0 data-items=100 ng-model="ctrl.target.currentTagValue" placeholder="value">
|
data-min-length=0 data-items=100 ng-model="ctrl.target.currentTagValue" placeholder="value">
|
||||||
</input>
|
</input>
|
||||||
<a ng-click="ctrl.addTag()">
|
|
||||||
|
<a bs-tooltip="ctrl.errors.tags"
|
||||||
|
style="color: rgb(229, 189, 28)"
|
||||||
|
ng-show="ctrl.errors.tags">
|
||||||
|
<i class="fa fa-warning"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a ng-click="ctrl.addTag()" ng-hide="ctrl.errors.tags">
|
||||||
add tag
|
add tag
|
||||||
</a>
|
</a>
|
||||||
<a bs-tooltip="ctrl.errors.tags"
|
<a ng-click="ctrl.closeAddTagMode()">
|
||||||
style="color: rgb(229, 189, 28)"
|
<i class="fa fa-remove"></i>
|
||||||
ng-show="target.errors.tags">
|
</a>
|
||||||
<i class="fa fa-warning"></i>
|
|
||||||
</a>
|
</li>
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -76,6 +76,11 @@ export class OpenTsQueryCtrl extends QueryCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addTag() {
|
addTag() {
|
||||||
|
|
||||||
|
if (this.target.filters && this.target.filters.length > 0) {
|
||||||
|
this.errors.tags = "Please remove filters to use tags, tags and filters are mutually exclusive.";
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.addTagMode) {
|
if (!this.addTagMode) {
|
||||||
this.addTagMode = true;
|
this.addTagMode = true;
|
||||||
return;
|
return;
|
||||||
@@ -109,7 +114,17 @@ export class OpenTsQueryCtrl extends QueryCtrl {
|
|||||||
this.addTag();
|
this.addTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeAddTagMode() {
|
||||||
|
this.addTagMode = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
addFilter() {
|
addFilter() {
|
||||||
|
|
||||||
|
if (this.target.tags && _.size(this.target.tags) > 0) {
|
||||||
|
this.errors.filters = "Please remove tags to use filters, tags and filters are mutually exclusive.";
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.addFilterMode) {
|
if (!this.addFilterMode) {
|
||||||
this.addFilterMode = true;
|
this.addFilterMode = true;
|
||||||
return;
|
return;
|
||||||
@@ -161,6 +176,11 @@ export class OpenTsQueryCtrl extends QueryCtrl {
|
|||||||
this.addFilter();
|
this.addFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeAddFilterMode() {
|
||||||
|
this.addFilterMode = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
validateTarget() {
|
validateTarget() {
|
||||||
var errs: any = {};
|
var errs: any = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user