Add autocompletion for metrics.

This commit is contained in:
Johannes 'fish' Ziemke 2013-03-25 16:15:54 +01:00
parent ecb8331df1
commit 0a87618733
1 changed files with 3 additions and 0 deletions

View File

@ -125,9 +125,12 @@ Prometheus.Graph.prototype.populateInsertableMetrics = function() {
url: "/api/metrics",
dataType: "json",
success: function(json, textStatus) {
var availableMetrics = []
for (var i = 0; i < json.length; i++) {
self.insertMetric[0].options.add(new Option(json[i], json[i]));
availableMetrics.push(json[i])
}
self.expr.autocomplete({source: availableMetrics})
},
error: function() {
alert("Error loading available metrics!");