graphite: minor changes

This commit is contained in:
Torkel Ödegaard 2017-11-16 14:16:37 +01:00
parent 3b18adfe1a
commit 3ae0cfa1d0
5 changed files with 10 additions and 11 deletions

View File

@ -1,5 +1,3 @@
///<reference path="../../../headers/common.d.ts" />
import _ from 'lodash';
import $ from 'jquery';
import coreModule from '../../core_module';
@ -201,9 +199,9 @@ export class FormDropdownCtrl {
}
open() {
this.inputElement.show();
this.inputElement.css('width', (Math.max(this.linkElement.width(), 80) + 16) + 'px');
this.inputElement.show();
this.inputElement.focus();
this.linkElement.hide();

View File

@ -103,7 +103,7 @@ function (angular, _, coreModule) {
};
this.newPlusButton = function() {
return new MetricSegment({fake: true, html: '<i class="fa fa-plus "></i>', type: 'plus-button' });
return new MetricSegment({fake: true, html: '<i class="fa fa-plus "></i>', type: 'plus-button', cssClass: 'query-part' });
};
this.newSelectTagValue = function() {

View File

@ -25,6 +25,7 @@ export default class GraphiteQuery {
parseTarget() {
this.functions = [];
this.segments = [];
this.tags = [];
this.error = null;
if (this.target.textEditor) {

View File

@ -7,7 +7,7 @@
<div ng-hide="ctrl.target.textEditor">
<div class="gf-form-inline">
<div class="gf-form">
<label class="gf-form-label width-6 query-keyword">Metrics</label>
<label class="gf-form-label width-6 query-keyword">Series</label>
</div>
<div ng-repeat="tag in ctrl.queryModel.tags" class="gf-form">
@ -17,13 +17,14 @@
</gf-form-dropdown>
<gf-form-dropdown model="tag.operator" lookup-text="false" allow-custom="false" label-mode="true" css-class="query-segment-operator"
get-options="ctrl.getTagOperators()"
on-change="ctrl.tagChanged(tag, $index)">
on-change="ctrl.tagChanged(tag, $index)"
min-input-width="30">
</gf-form-dropdown>
<gf-form-dropdown model="tag.value" lookup-text="false" allow-custom="false" label-mode="true" css-class="query-segment-value"
get-options="ctrl.getTagValues(tag, $index, $query)"
on-change="ctrl.tagChanged(tag, $index)">
</gf-form-dropdown>
<label class="gf-form-label query-keyword" ng-if="ctrl.showDelimiter($index)">,</label>
<label class="gf-form-label query-keyword" ng-if="ctrl.showDelimiter($index)">AND</label>
</div>
<div ng-repeat="segment in ctrl.segments" role="menuitem" class="gf-form">
@ -31,9 +32,7 @@
</div>
<div ng-if="ctrl.queryModel.seriesByTagUsed" ng-repeat="segment in ctrl.addTagSegments" role="menuitem" class="gf-form">
<metric-segment segment="segment"
get-options="ctrl.getTagsAsSegments()"
on-change="ctrl.addNewTag(segment)">
<metric-segment segment="segment" get-options="ctrl.getTagsAsSegments()" on-change="ctrl.addNewTag(segment)">
</metric-segment>
</div>

View File

@ -47,6 +47,7 @@ export class GraphiteQueryCtrl extends QueryCtrl {
this.segments = _.map(this.queryModel.segments, segment => {
return this.uiSegmentSrv.newSegment(segment);
});
let checkOtherSegmentsIndex = this.queryModel.checkOtherSegmentsIndex || 0;
this.checkOtherSegments(checkOtherSegmentsIndex);