From d654bd2f4d7da477c1cab4acd04c3c6f78f7e15a Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 15 Aug 2013 11:32:08 -0700 Subject: [PATCH] Show a count of changes in each pipeline on the status page Change-Id: I145197acfb5bfdb34e1dbe00697175361cf5d183 --- .../openstack_project/files/zuul/status.html | 6 +++++ .../openstack_project/files/zuul/status.js | 25 +++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/modules/openstack_project/files/zuul/status.html b/modules/openstack_project/files/zuul/status.html index 30a27095b5..56a0382ea0 100644 --- a/modules/openstack_project/files/zuul/status.html +++ b/modules/openstack_project/files/zuul/status.html @@ -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; } diff --git a/modules/openstack_project/files/zuul/status.js b/modules/openstack_project/files/zuul/status.js index 519e115942..3d34151440 100644 --- a/modules/openstack_project/files/zuul/status.js +++ b/modules/openstack_project/files/zuul/status.js @@ -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 = '

'+ - data['name']+'

'; + data['name']; + if (count > 0) { + html += ' (' + count + ')'; + } + html += ''; if (data['description'] != null) { html += '

'+data['description']+'

'; } @@ -88,11 +103,11 @@ function format_pipeline(data) { if (name.length > 32) { name = name.substr(0,32) + '...'; } - html += name + '
' + html += name + ''; } $.each(head, function(change_i, change) { if (change_i > 0) { - html += '
' + html += '
'; } 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) {