Skip to content

Commit 206cb51

Browse files
committed
feat(query editors): updated prometheus editor
1 parent 5e6485c commit 206cb51

File tree

2 files changed

+49
-75
lines changed

2 files changed

+49
-75
lines changed
Lines changed: 48 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,54 @@
1-
<query-editor-row ctrl="ctrl">
2-
<li class="tight-form-item" style="width: 94px">
3-
Query
4-
</li>
5-
<li>
6-
<input type="text"
7-
class="input-xxlarge tight-form-input"
8-
ng-model="ctrl.target.expr"
9-
spellcheck='false'
10-
placeholder="query expression"
11-
data-min-length=0 data-items=100
12-
ng-model-onblur
13-
ng-change="ctrl.refreshMetricData()">
14-
</li>
15-
<li class="tight-form-item">
16-
Metric
17-
</li>
18-
<li>
19-
<input type="text"
20-
class="input-medium tight-form-input"
21-
ng-model="ctrl.target.metric"
22-
spellcheck='false'
23-
bs-typeahead="ctrl.suggestMetrics"
24-
placeholder="metric name"
25-
data-min-length=0 data-items=100>
26-
</li>
27-
</query-editor-row>
1+
<query-editor-row query-ctrl="ctrl" can-collapse="false">
2+
<div class="gf-form-inline">
3+
<div class="gf-form gf-form--grow">
4+
<label class="gf-form-label width-8">Query</label>
5+
<input type="text" class="gf-form-input" ng-model="ctrl.target.expr" spellcheck='false' placeholder="query expression" data-min-length=0 data-items=100 ng-model-onblur ng-change="ctrl.refreshMetricData()">
6+
</div>
7+
<div class="gf-form max-width-22">
8+
<label class="gf-form-label">Metric lookup</label>
9+
<input type="text" class="gf-form-input" ng-model="ctrl.target.metric" spellcheck='false' bs-typeahead="ctrl.suggestMetrics" placeholder="metric name" data-min-length=0 data-items=100>
10+
</div>
11+
</div>
2812

29-
<div class="tight-form">
30-
<ul class="tight-form-list" role="menu">
31-
<li class="tight-form-item tight-form-align" style="width: 94px">
32-
Legend format
33-
</li>
34-
<li>
35-
<input type="text" class="tight-form-input input-xxlarge" ng-model="ctrl.target.legendFormat"
13+
<div class="gf-form-inline">
14+
<div class="gf-form max-width-26">
15+
<label class="gf-form-label width-8">Legend format</label>
16+
<input type="text" class="gf-form-input" ng-model="ctrl.target.legendFormat"
3617
spellcheck='false' placeholder="legend format" data-min-length=0 data-items=1000
3718
ng-model-onblur ng-change="ctrl.refreshMetricData()">
3819
</input>
39-
</li>
40-
</ul>
41-
42-
<div class="clearfix"></div>
43-
</div>
20+
</div>
21+
<div class="gf-form">
22+
<label class="gf-form-label width-5">Step</label>
23+
<input type="text" class="gf-form-input max-width-5" ng-model="ctrl.target.interval"
24+
data-placement="right"
25+
spellcheck='false'
26+
placeholder="{{ctrl.panelCtrl.interval}}"
27+
data-min-length=0 data-items=100
28+
ng-model-onblur
29+
ng-change="ctrl.refreshMetricData()"/>
30+
<info-popover mode="right-absolute">
31+
Leave blank for auto handling based on time range and panel width
32+
</info-popover>
33+
</div>
34+
<div class="gf-form">
35+
<label class="gf-form-label">Resolution</label>
36+
<div class="gf-form-select-wrapper max-width-15">
37+
<select ng-model="ctrl.target.intervalFactor" class="gf-form-input"
38+
ng-options="r.factor as r.label for r in ctrl.resolutions"
39+
ng-change="ctrl.refreshMetricData()">
40+
</select>
41+
</div>
42+
<label class="gf-form-label">
43+
<a href="{{ctrl.linkToPrometheus}}" target="_blank" bs-tooltip="'Link to Graph in Prometheus'">
44+
<i class="fa fa-share-square-o"></i>
45+
</a>
46+
</label>
47+
</div>
4448

45-
<div class="tight-form">
46-
<ul class="tight-form-list" role="menu">
47-
<li class="tight-form-item tight-form-align" style="width: 94px">
48-
Step
49-
</li>
50-
<li>
51-
<input type="text" class="input-mini tight-form-input" ng-model="ctrl.target.interval"
52-
bs-tooltip="'Leave blank for auto handling based on time range and panel width'"
53-
data-placement="right"
54-
spellcheck='false'
55-
placeholder="{{ctrl.panelCtrl.interval}}"
56-
data-min-length=0 data-items=100
57-
ng-model-onblur
58-
ng-change="ctrl.refreshMetricData()"
59-
/>
60-
</input>
61-
</li>
49+
<div class="gf-form gf-form--grow">
50+
<div class="gf-form-label gf-form-label--grow"></div>
51+
</div>
52+
</div>
6253

63-
<li class="tight-form-item">
64-
Resolution
65-
</li>
66-
<li>
67-
<select ng-model="ctrl.target.intervalFactor" class="tight-form-input input-mini"
68-
ng-options="r.factor as r.label for r in ctrl.resolutions"
69-
ng-change="ctrl.refreshMetricData()">
70-
</select>
71-
</li>
72-
<li class="tight-form-item">
73-
<a href="{{ctrl.linkToPrometheus}}" target="_blank" bs-tooltip="'Link to Graph in Prometheus'">
74-
<i class="fa fa-share-square-o"></i>
75-
</a>
76-
</li>
77-
</ul>
78-
79-
<div class="clearfix"></div>
80-
</div>
54+
</query-editor-row>

public/sass/utils/_utils.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ button.close {
5959

6060
// Toggling content
6161
.hide {
62-
display: none !important;
62+
display: none;
6363
}
6464

6565
.show {

0 commit comments

Comments
 (0)