Add autocompletion for metrics.
This commit is contained in:
parent
ecb8331df1
commit
0a87618733
|
@ -125,9 +125,12 @@ Prometheus.Graph.prototype.populateInsertableMetrics = function() {
|
||||||
url: "/api/metrics",
|
url: "/api/metrics",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(json, textStatus) {
|
success: function(json, textStatus) {
|
||||||
|
var availableMetrics = []
|
||||||
for (var i = 0; i < json.length; i++) {
|
for (var i = 0; i < json.length; i++) {
|
||||||
self.insertMetric[0].options.add(new Option(json[i], json[i]));
|
self.insertMetric[0].options.add(new Option(json[i], json[i]));
|
||||||
|
availableMetrics.push(json[i])
|
||||||
}
|
}
|
||||||
|
self.expr.autocomplete({source: availableMetrics})
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
alert("Error loading available metrics!");
|
alert("Error loading available metrics!");
|
||||||
|
|
Loading…
Reference in New Issue