Show a count of changes in each pipeline on the status page

Change-Id: I145197acfb5bfdb34e1dbe00697175361cf5d183
This commit is contained in:
Alex Gaynor 2013-08-15 11:32:08 -07:00
parent 0031d3ff2d
commit d654bd2f4d
2 changed files with 26 additions and 5 deletions

View File

@ -24,6 +24,12 @@
.change > .header > .time {
float: right;
}
.pipeline > .subhead > .count {
float: right;
margin-right: 1em;
color: #535353;
font-size: 11pt;
}
.job {
display: block;
}

View File

@ -29,7 +29,7 @@ function format_time(ms, words) {
r += hours;
r += ' hr ';
}
r += minutes + ' min'
r += minutes + ' min';
} else {
if (hours < 10) r += '0';
r += hours + ':';
@ -62,9 +62,24 @@ function is_hide_project(project) {
return project.indexOf(filter) == -1;
}
function count_changes(pipeline) {
var count = 0;
$.each(pipeline['change_queues'], function(change_queue_i, change_queue) {
$.each(change_queue['heads'], function(head_i, head) {
count += head.length;
});
});
return count;
}
function format_pipeline(data) {
var count = count_changes(data);
var html = '<div class="pipeline"><h3 class="subhead">'+
data['name']+'</h3>';
data['name'];
if (count > 0) {
html += ' <span class="count">(' + count + ')</span>';
}
html += '</h3>';
if (data['description'] != null) {
html += '<p>'+data['description']+'</p>';
}
@ -88,11 +103,11 @@ function format_pipeline(data) {
if (name.length > 32) {
name = name.substr(0,32) + '...';
}
html += name + '</a></div>'
html += name + '</a></div>';
}
$.each(head, function(change_i, change) {
if (change_i > 0) {
html += '<div class="arrow">&uarr;</div>'
html += '<div class="arrow">&uarr;</div>';
}
html += format_change(change);
});
@ -218,7 +233,7 @@ function update() {
function update_graphs() {
$('.graph').each(function(i, img) {
var newimg = new Image()
var newimg = new Image();
var parts = img.src.split('#');
newimg.src = parts[0] + '#' + new Date().getTime();
$(newimg).load(function (x) {