diff --git a/runbot/static/src/js/stats.js b/runbot/static/src/js/stats.js index ea341533..c08ea5a9 100644 --- a/runbot/static/src/js/stats.js +++ b/runbot/static/src/js/stats.js @@ -16,35 +16,39 @@ var config = { mode: 'point' }, scales: { - xAxes: [{ + x: { display: true, scaleLabel: { display: true, labelString: 'Builds' } - }], - yAxes: [{ + }, + y: { display: true, scaleLabel: { display: true, labelString: 'Value' }, - }] - } - } + }, + }, + }, }; +var shifted = false; +$(document).on('keyup keydown', function(e){shifted = e.shiftKey} ); + config.options.onClick = function(event, activeElements) { if (activeElements.length === 0){ - var x_label_index = this.scales['x-axis-0'].getValueForPixel(event.x); - var build_id = config.data.labels[x_label_index] - if (event.layerY > this.chartArea.bottom && event.layerY < this.chartArea.bottom + this.scales['x-axis-0'].height){ - config.searchParams['center_build_id'] = build_id; - fetchUpdateChart(); - } - return; + return } - window.open('/runbot/build/stats/' + config.data.labels[activeElements[0]._index]); + const build_id = config.data.labels[activeElements[0].index]; + if (shifted){ + config.searchParams['center_build_id'] = build_id; + fetchUpdateChart(); + } else { + window.open('/runbot/build/stats/' + build_id); + } + }; function fetch(path, data, then) { diff --git a/runbot/templates/build_stats.xml b/runbot/templates/build_stats.xml index 2e257921..020af014 100644 --- a/runbot/templates/build_stats.xml +++ b/runbot/templates/build_stats.xml @@ -92,6 +92,7 @@ +

Tips: click a bullet to see corresponding build stats, shift+click to center the graph on this build