mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-28 06:59:40 -08:00
web/js: adjust Javascript to new response format
This commit is contained in:
parent
3d67d75935
commit
75ba840d88
File diff suppressed because one or more lines are too long
|
@ -579,7 +579,7 @@ Prometheus.Graph.prototype.handleConsoleResponse = function(data, textStatus) {
|
||||||
for (var i = 0; i < data.result.length; i++) {
|
for (var i = 0; i < data.result.length; i++) {
|
||||||
var s = data.result[i];
|
var s = data.result[i];
|
||||||
var tsName = self.metricToTsName(s.metric);
|
var tsName = self.metricToTsName(s.metric);
|
||||||
tBody.append("<tr><td>" + escapeHTML(tsName) + "</td><td>" + s.value + "</td></tr>");
|
tBody.append("<tr><td>" + escapeHTML(tsName) + "</td><td>" + s[1] + "</td></tr>");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "matrix":
|
case "matrix":
|
||||||
|
@ -598,10 +598,10 @@ Prometheus.Graph.prototype.handleConsoleResponse = function(data, textStatus) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "scalar":
|
case "scalar":
|
||||||
tBody.append("<tr><td>scalar</td><td>" + data.result.value + "</td></tr>");
|
tBody.append("<tr><td>scalar</td><td>" + data.result[1] + "</td></tr>");
|
||||||
break;
|
break;
|
||||||
case "string":
|
case "string":
|
||||||
tBody.append("<tr><td>string</td><td>" + data.result.value + "</td></tr>");
|
tBody.append("<tr><td>string</td><td>" + data.result[1] + "</td></tr>");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
self.showError("Unsupported value type!");
|
self.showError("Unsupported value type!");
|
||||||
|
|
Loading…
Reference in a new issue