forked from lix-project/hydra
Fix rendering of metrics with dots in their name
This commit is contained in:
parent
ef63dd77e3
commit
dc2010eafc
2 changed files with 11 additions and 7 deletions
|
@ -574,6 +574,8 @@ BLOCK createChart %]
|
||||||
requestJSON({
|
requestJSON({
|
||||||
url: "[%dataUrl%]",
|
url: "[%dataUrl%]",
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
var id = "[%id%]";
|
||||||
|
|
||||||
var ids = [];
|
var ids = [];
|
||||||
var d = [];
|
var d = [];
|
||||||
var maxTime = 0;
|
var maxTime = 0;
|
||||||
|
@ -600,9 +602,9 @@ BLOCK createChart %]
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
var plot = $.plot($("#[%id%]-chart"), [d], options);
|
var plot = $.plot($("#" + id + "-chart"), [d], options);
|
||||||
|
|
||||||
var overview = $.plot($("#[%id%]-overview"), [d], {
|
var overview = $.plot($("#" + id + "-overview"), [d], {
|
||||||
series: {
|
series: {
|
||||||
lines: { show: true, lineWidth: 1 },
|
lines: { show: true, lineWidth: 1 },
|
||||||
shadowSize: 0
|
shadowSize: 0
|
||||||
|
@ -614,7 +616,7 @@ BLOCK createChart %]
|
||||||
|
|
||||||
// now connect the two
|
// now connect the two
|
||||||
|
|
||||||
$("#[%id%]-chart").bind("plotselected", function (event, ranges) {
|
$("#" + id + "-chart").bind("plotselected", function (event, ranges) {
|
||||||
var ymax = 0;
|
var ymax = 0;
|
||||||
d.forEach(function(x) {
|
d.forEach(function(x) {
|
||||||
if (x[0] < ranges.xaxis.from) return;
|
if (x[0] < ranges.xaxis.from) return;
|
||||||
|
@ -623,7 +625,7 @@ BLOCK createChart %]
|
||||||
});
|
});
|
||||||
|
|
||||||
// do the zooming
|
// do the zooming
|
||||||
plot = $.plot($("#[%id%]-chart"), [d],
|
plot = $.plot($("#" + id + "-chart"), [d],
|
||||||
$.extend(true, {}, options, {
|
$.extend(true, {}, options, {
|
||||||
xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to },
|
xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to },
|
||||||
yaxis: { min: 0, max: ymax * 1.1 }
|
yaxis: { min: 0, max: ymax * 1.1 }
|
||||||
|
@ -633,11 +635,11 @@ BLOCK createChart %]
|
||||||
overview.setSelection(ranges, true);
|
overview.setSelection(ranges, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#[%id%]-overview").bind("plotselected", function (event, ranges) {
|
$("#" + id + "-overview").bind("plotselected", function (event, ranges) {
|
||||||
plot.setSelection(ranges);
|
plot.setSelection(ranges);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#[%id%]-chart").bind("plotclick", function (e, pos, item) {
|
$("#" + id + "-chart").bind("plotclick", function (e, pos, item) {
|
||||||
if (item) {
|
if (item) {
|
||||||
plot.highlight(item.series, item.datapoint);
|
plot.highlight(item.series, item.datapoint);
|
||||||
buildid = data[item.dataIndex].id;
|
buildid = data[item.dataIndex].id;
|
||||||
|
|
|
@ -102,7 +102,9 @@ removed or had an evaluation error.</div>
|
||||||
|
|
||||||
<h3>Metric: <tt>[%HTML.escape(metric.name)%]</tt></h3>
|
<h3>Metric: <tt>[%HTML.escape(metric.name)%]</tt></h3>
|
||||||
|
|
||||||
[% INCLUDE createChart id="metric-${metric.name}" dataUrl=c.uri_for('/job' project.name jobset.name job.name 'metric' metric.name) %]
|
[% id = "metric-" _ metric.name;
|
||||||
|
id = id.replace('\.', '_');
|
||||||
|
INCLUDE createChart dataUrl=c.uri_for('/job' project.name jobset.name job.name 'metric' metric.name); %]
|
||||||
|
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue