Commit 04d90d71 by hagen1778

Make Prometheus query field a textarea #7663

parent 3827c0a6
<query-editor-row query-ctrl="ctrl" can-collapse="false"> <query-editor-row query-ctrl="ctrl" can-collapse="true" has-text-edit-mode="true">
<div class="gf-form-inline"> <div class="gf-form-inline">
<div class="gf-form gf-form--grow"> <div class="gf-form gf-form--grow">
<label class="gf-form-label width-8">Query</label> <textarea rows="3" 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()"></textarea>
<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()">
</div>
<div class="gf-form max-width-22">
<label class="gf-form-label">Metric lookup</label>
<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>
</div> </div>
</div> </div>
...@@ -39,6 +34,14 @@ ...@@ -39,6 +34,14 @@
ng-change="ctrl.refreshMetricData()"> ng-change="ctrl.refreshMetricData()">
</select> </select>
</div> </div>
</div>
<div class="gf-form max-width-22">
<label class="gf-form-label">Metric lookup</label>
<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>
</div>
<div class="gf-form">
<label class="gf-form-label"> <label class="gf-form-label">
<a href="{{ctrl.linkToPrometheus}}" target="_blank" bs-tooltip="'Link to Graph in Prometheus'"> <a href="{{ctrl.linkToPrometheus}}" target="_blank" bs-tooltip="'Link to Graph in Prometheus'">
<i class="fa fa-share-square-o"></i> <i class="fa fa-share-square-o"></i>
......
...@@ -75,6 +75,10 @@ class PrometheusQueryCtrl extends QueryCtrl { ...@@ -75,6 +75,10 @@ class PrometheusQueryCtrl extends QueryCtrl {
var hash = encodeURIComponent(JSON.stringify([expr])); var hash = encodeURIComponent(JSON.stringify([expr]));
this.linkToPrometheus = this.datasource.directUrl + '/graph#' + hash; this.linkToPrometheus = this.datasource.directUrl + '/graph#' + hash;
} }
getCollapsedText() {
return this.target.expr;
}
} }
export {PrometheusQueryCtrl}; export {PrometheusQueryCtrl};
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