Remove legacy zuul status page

We don't use this anymore and it's confusing in git greps.

Change-Id: I4a2fe60c090a0f58e5c23bf793aad8bb8e5fe765
This commit is contained in:
Monty Taylor 2019-01-17 12:52:56 +00:00
parent a81503921d
commit 50580e55d5
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
11 changed files with 0 additions and 1086 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

View File

@ -1,62 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
lang="en">
<HEAD>
<TITLE></TITLE>
<script type="text/javascript"
src="http://status.openstack.org/common.js"></script>
<!-- Google Fonts -->
<link href='http://fonts.googleapis.com/css?family=PT+Sans&amp;subset=latin' rel='stylesheet' type='text/css'/>
<!-- Framework CSS -->
<link rel="stylesheet" href="http://openstack.org/themes/openstack/css/blueprint/screen.css" type="text/css" media="screen, projection"/>
<link rel="stylesheet" href="http://openstack.org/themes/openstack/css/blueprint/print.css" type="text/css" media="print"/>
<!-- IE CSS -->
<!--[if lt IE 8]><link rel="stylesheet" href="http://openstack.org/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
<!-- OpenStack Specific CSS -->
<link rel="stylesheet" href="http://openstack.org/themes/openstack/css/dropdown.css" type="text/css" media="screen, projection, print"/>
<!-- Page Specific CSS -->
<link rel="stylesheet" href="http://openstack.org/themes/openstack/css/home.css" type="text/css" media="screen, projection, print"/>
<link rel="stylesheet" type="text/css" href="http://openstack.org/themes/openstack/css/main.css" />
<style type="text/css">
h3.subhead {
border: none;
margin-bottom: 0.2em;
padding-top: 1.5em;
}
</style>
</HEAD>
<BODY>
<script type="text/javascript">header('Rechecks');</script>
<div class="container">
<h1>Bugs Causing Rechecks</h1>
<div py:for="bug in bugs">
<h3 class="subhead">
<a href="https://code.launchpad.net/bugs/${bug['number']}">
Bug ${bug.number}: ${bug.title}</a>
<py:if test="bug.is_closed()">(closed)</py:if>
</h3>
First seen: ${bug.first_seen.strftime("%Y-%m-%d %H:%M:%S")} UTC<br/>
Last seen: ${bug.last_seen.strftime("%Y-%m-%d %H:%M:%S")} UTC<br/>
Rechecks: ${len(bug.hits)}<br/>
Affecting projects: ${', '.join(bug.projects)}<br/>
Affecting changes:
<span py:for="i, change in enumerate(bug.changes)">
<a href="https://review.openstack.org/${change}"
>${change}</a><span py:if="i+1 != len(bug.changes)" py:replace="','"/>
</span>
</div>
</div>
<script type="text/javascript">footer();</script>
</BODY>
</html>

View File

@ -164,68 +164,6 @@ class openstack_project::status (
# sets up the cron update scripts for static pages
include elastic_recheck::cron
###########################################################
# Status - zuul
file { '/srv/static/status/zuul':
ensure => directory,
}
file { '/srv/static/status/zuul/index.html':
ensure => present,
content => template('openstack_project/zuul/status.html.erb'),
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/status.js':
ensure => present,
content => template('openstack_project/zuul/status.js.erb'),
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/green.png':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/green.png',
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/red.png':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/red.png',
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/black.png':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/black.png',
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/grey.png':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/grey.png',
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/line-angle.png':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/line-angle.png',
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/line-t.png':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/line-t.png',
require => File['/srv/static/status/zuul'],
}
file { '/srv/static/status/zuul/line.png':
ensure => present,
source => 'puppet:///modules/openstack_project/zuul/line.png',
require => File['/srv/static/status/zuul'],
}
###########################################################
# Status - reviewday

View File

@ -1,394 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
lang="en">
<HEAD>
<TITLE>Zuul Status</TITLE>
<script type="text/javascript"
src="http://status.openstack.org/jquery.min.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/jquery-visibility.min.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/jquery-graphite.js"></script>
<script type="text/javascript"
src="http://status.openstack.org/common.js"></script>
<script type="text/javascript"
src="status.js"></script>
<!-- Google Fonts -->
<link href='http://fonts.googleapis.com/css?family=PT+Sans&amp;subset=latin' rel='stylesheet' type='text/css'/>
<!-- Framework CSS -->
<link rel="stylesheet" href="https://www.openstack.org/themes/openstack/css/blueprint/screen.css" type="text/css" media="screen, projection"/>
<link rel="stylesheet" href="https://www.openstack.org/themes/openstack/css/blueprint/print.css" type="text/css" media="print"/>
<!-- IE CSS -->
<!--[if lt IE 8]><link rel="stylesheet" href="https://www.openstack.org/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
<!-- OpenStack Specific CSS -->
<link rel="stylesheet" href="https://www.openstack.org/themes/openstack/css/dropdown.css" type="text/css" media="screen, projection, print"/>
<!-- Page Specific CSS -->
<link rel="stylesheet" href="https://www.openstack.org/themes/openstack/css/home.css" type="text/css" media="screen, projection, print"/>
<link rel="stylesheet" type="text/css" href="https://www.openstack.org/themes/openstack/css/main.css" />
<style type="text/css">
.container {
width: 1024px;
}
label {
font-weight: normal;
}
#pipeline-container {
margin: 0 auto;
}
.line {
background-image: url('line.png');
background-repeat: repeat-y;
}
.pipeline {
float: left;
padding: 4px;
}
.pipeline > .header {
background: #0000cc;
color: white;
}
.pipeline > .subhead > .count {
float: right;
margin-right: 1em;
color: #535353;
font-size: 11pt;
}
.pipeline table {
margin: 0 0 2px 0;
}
.pipeline table td {
margin: 0;
padding: 0 0 10px 0;
}
td.tree {
width: 16px;
height: 100%;
vertical-align: top;
}
.pipeline table td.change-container {
padding-left: 4px;
}
.change {
border: 1px solid #95c7db;
padding: 2px;
}
.change > .header {
background: #E2ECEF;
color: black;
margin: -2px;
padding: 4px;
}
.change > .header > .changeid {
margin: 1em;
}
.change > .header > .time {
float: right;
}
.change > .hover {
background: #F3FDFF;
}
.jobs {
padding-top: 4px;
}
.jobwrapper {
display: table;
width: 100%;
}
.job {
display: block;
line-height: 1.5;
}
.result {
float: right;
}
.result_success {
color: #007f00;
}
.queue_bad,
.result_failure {
color: #cf2f19;
}
.queue_warn,
.result_unstable {
color: #e39f00;
}
.queue_good {
color: #888888;
}
#graph-container img {
margin-left: 2px;
margin-right: 2px;
}
#zuul_info_container {
margin-top: 12px;
}
a:link {
color: #204A87;
}
#message p{
margin: 0;
}
.alertbox {
border: 1px solid #e5574d;
background: #ffaba5;
color: black;
padding: 1em;
font-size: 12pt;
margin: 0pt;
}
.change_progress {
width: 5em;
float: right;
/* because other wise this floats up off the line */
margin-top: 0.25em;
}
.filter_container {
display: inline-block;
position: relative;
top: 1.5em;
padding-left: .5em;
}
.filter_container input#filter {
display: inline-block;
}
.filter_container sub {
padding: .5em 0;
display: block;
}
.filter_container sub a.save-filter {
text-decoration: underline;
}
.filter_container .hidden {
visibility: hidden;
}
.filter_container img.filter-saved {
display: inline-block;
position: relative;
top: 3px;
}
.filter_container img.filter-saved.hidden {
display: none;
}
.loading_message {
text-align: center;
font-size: 16pt;
}
/** Theming for the progress bars to get them consisten across browers:
referenced from http://www.useragentman.com/blog/2012/01/03/cross-browser-html5-progress-bars-in-depth/
*/
progress, /* All HTML5 progress enabled browsers */
progress[role] /* polyfill */
{
/* Turns off styling - not usually needed, but good to know. */
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
/* gets rid of default border in Firefox and Opera. */
border: none;
/* Needs to be in here for Safari polyfill so background images work as expected. */
background-size: auto;
}
/* Polyfill */
progress[role]:after {
background-image: none; /* removes default background from polyfill */
}
/* Ensure fallback text doesn't appear in polyfill */
progress[role] strong {
display: none;
}
/** Background color */
progress, /* Firefox */
progress[role][aria-valuenow] { /* Polyfill */
background: #e6e6e6 !important; /* !important is needed by the polyfill */
}
/* Chrome */
progress::-webkit-progress-bar {
background: #e6e6e6;
}
/** Foreground color */
/* IE10 */
progress {
color: #6b81a2;
}
/* Firefox */
progress::-moz-progress-bar {
background: #6b81a2;
}
/* Chrome */
progress::-webkit-progress-value {
background: #6b81a2;
}
/* Polyfill */
progress[aria-valuenow]:before {
background: #6b81a2;
}
</style>
</HEAD>
<BODY>
<script type="text/javascript">header('Zuul');</script>
<div class="container">
<h1> Zuul Status </h1>
<p> Zuul is a pipeline oriented project gating and automation
system. Each of the sections below is a separate pipeline
configured to automate some portion of the testing or
operation of the OpenStack project. For more information, please see
<a href="https://docs.openstack.org/infra/zuul">the Zuul reference manual.</a>
</p>
<p>
Queue lengths: <span id="trigger_event_queue_length"></span> events,
<span id="result_event_queue_length"></span> results.
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="filter">Filters:</label>
<span class="filter_container">
<input title="project(s) or review(s) separated by comma" type="text" id="filter" />
<!--
An embedded 'approved' image.
From the famfamfam "Silk" icon set, Creative Commons Attribution 2.5.
http://www.famfamfam.com/lab/icons/silk/
-->
<img class="filter-saved hidden" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKfSURBVDjLpZPrS1NhHMf9O3bOdmwDCWREIYKEUHsVJBI7mg3FvCxL09290jZj2EyLMnJexkgpLbPUanNOberU5taUMnHZUULMvelCtWF0sW/n7MVMEiN64AsPD8/n83uucQDi/id/DBT4Dolypw/qsz0pTMbj/WHpiDgsdSUyUmeiPt2%2BV7SrIM%2BbSss8ySGdR4abQQv6lrui6VxsRonrGCS9VEjSQ9E7CtiqdOZ4UuTqnBHO1X7YXl6Daa4yGq7vWO1D40wVDtj4kWQbn94myPGkCDPdSesczE2sCZShwl8CzcwZ6NiUs6n2nYX99T1cnKqA2EKui6%2BTwphA5k4yqMayopU5mANV3lNQTBdCMVUA9VQh3GuDMHiVcLCS3J4jSLhCGmKCjBEx0xlshjXYhApfMZRP5CyYD%2BUkG08%2Bxt%2B4wLVQZA1tzxthm2tEfD3JxARH7QkbD1ZuozaggdZbxK5kAIsf5qGaKMTY2lAU/rH5HW3PLsEwUYy%2BYCcERmIjJpDcpzb6l7th9KtQ69fi09ePUej9l7cx2DJbD7UrG3r3afQHOyCo%2BV3QQzE35pvQvnAZukk5zL5qRL59jsKbPzdheXoBZc4saFhBS6AO7V4zqCpiawuptwQG%2BUAa7Ct3UT0hh9p9EnXT5Vh6t4C22QaUDh6HwnECOmcO7K%2B6kW49DKqS2DrEZCtfuI%2B9GrNHg4fMHVSO5kE7nAPVkAxKBxcOzsajpS4Yh4ohUPPWKTUh3PaQEptIOr6BiJjcZXCwktaAGfrRIpwblqOV3YKdhfXOIvBLeREWpnd8ynsaSJoyESFphwTtfjN6X1jRO2%2BFxWtCWksqBApeiFIR9K6fiTpPiigDoadqCEag5YUFKl6Yrciw0VOlhOivv/Ff8wtn0KzlebrUYwAAAABJRU5ErkJggg%3D%3D" />
<sub>
<a href="#" class="save-filter hidden">Save Filter</a>
</sub>
</span>
&nbsp;&nbsp;&nbsp;&nbsp;
<label for="expandByDefault">Expand by default:</label>
<span class="expand_by_default_container">
<input type="checkbox" id="expandByDefault" onchange="toggle_expand_by_default(this)"/>
</span>
</p>
</div>
<div class="container">
<div id="message"/>
</div>
<div id="pipeline-container">
<p class="loading_message">Loading...</p>
</div>
<div class="container" id="graph-container">
<h2> Job Stats </h2>
<script type="text/javascript">
$.fn.graphite.defaults.url = "<%= @graphite_render_url %>";
$("#graph-container").append($(new Image()).addClass('graph').graphite({
from: "-24hours",
width: 334,
height: 180,
bgcolor: 'ffffff',
fgcolor: '000000',
areaMode: 'stacked',
target: [
"color(alias(sumSeries(stats.gauges.nodepool.nodes.building), 'Building'), 'ffbf52')",
"color(alias(sumSeries(stats.gauges.nodepool.nodes.ready), 'Available'), '00c868')",
"color(alias(sumSeries(stats.gauges.nodepool.nodes.used), 'In Use'), '6464ff')",
"color(alias(sumSeries(stats.gauges.nodepool.nodes.delete), 'Deleting'), 'c864ff')",
],
title: "Test Nodes"
}));
$("#graph-container").append($(new Image()).addClass('graph').graphite({
from: "-24hours",
width: 334,
height: 180,
bgcolor: 'ffffff',
fgcolor: '000000',
target: [
"alias(smartSummarize(sumSeries(stats_counts.zuul.pipeline.*.all_jobs),'1h'),'All Jobs')",
],
title: "Zuul Jobs Launched (per Hour)"
}));
$("#graph-container").append($(new Image()).addClass('graph').graphite({
from: "-24hours",
width: 334,
height: 180,
bgcolor: 'ffffff',
fgcolor: '000000',
target: [
"alias(smartSummarize(stats_counts.gerrit.event.comment-added, '1h'), 'Comment added')",
"alias(smartSummarize(stats_counts.gerrit.event.patchset-created, '1h'), 'Patchset created')",
"alias(smartSummarize(stats_counts.gerrit.event.change-merged, '1h'), 'Change merged')",
],
title: "Gerrit Events (per Hour)"
}));
$("#graph-container").append($(new Image()).addClass('graph').graphite({
from: "-24hours",
width: 334,
height: 180,
bgcolor: 'ffffff',
fgcolor: '000000',
target: [
"color(alias(stats.gauges.zuul.geard.queue.running, 'Running'), 'blue')",
"color(alias(stats.gauges.zuul.geard.queue.waiting, 'Waiting'), 'red')",
"color(alias(stats.gauges.zuul.geard.queue.total, 'Total Jobs'), '888888')",
"color(alias(stats.gauges.zuul.geard.workers, 'Workers'), 'green')",
],
title: "Zuul Job Queue"
}));
$("#graph-container").append($(new Image()).addClass('graph').graphite({
from: "-24hours",
width: 334,
height: 180,
bgcolor: 'ffffff',
fgcolor: '000000',
target: [
"color(alias(stats.gauges.logstash.geard.queue.running, 'Running'), 'blue')",
"color(alias(stats.gauges.logstash.geard.queue.waiting, 'Waiting'), 'red')",
"color(alias(stats.gauges.logstash.geard.queue.total, 'Total Jobs'), '888888')",
"color(alias(stats.gauges.logstash.geard.workers, 'Workers'), 'green')",
],
title: "Logstash Job Queue"
}));
</script>
</div>
<div class="container" id="zuul_info_container">
<h2>Zuul info</h2>
<p>
Zuul version:
<span id="zuul-version"></span>
</p>
<p>
Last reconfigured:
<span id="last-reconfigured-span"></span>
</p>
</div>
<script type="text/javascript">footer();</script>
</BODY>
</html>

View File

@ -1,568 +0,0 @@
// Copyright 2012-2013 OpenStack Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
window.zuul_enable_status_updates = true;
window.zuul_filter = [];
window.zuul_collapsed_exceptions = [];
function format_enqueue_time(time) {
var hours = 60 * 60 * 1000;
var now = Date.now();
var delta = now - time;
var status = "queue_good";
var text = format_time(delta, true);
if (delta > (4 * hours)) {
status = "queue_bad";
} else if (delta > (2 * hours)) {
status = "queue_warn";
}
return '<span class="' + status + '">' + text + '</span>';
}
function format_time(ms, words) {
if (ms == null) {
return "unknown";
}
var seconds = (+ms)/1000;
var minutes = Math.floor(seconds/60);
var hours = Math.floor(minutes/60);
seconds = Math.floor(seconds % 60);
minutes = Math.floor(minutes % 60);
r = '';
if (words) {
if (hours) {
r += hours;
r += ' hr ';
}
r += minutes + ' min';
} else {
if (hours < 10) r += '0';
r += hours + ':';
if (minutes < 10) r += '0';
r += minutes + ':';
if (seconds < 10) r += '0';
r += seconds;
}
return r;
}
function format_progress(elapsed, remaining) {
if (remaining != null) {
total = elapsed + remaining;
} else {
total = null;
}
r = '<progress class="change_progress" title="' +
format_time(elapsed, false) + ' elapsed, ' +
format_time(remaining, false)+' remaining" ' +
'value="'+elapsed+'" max="'+total+'">in progress</progress>';
return r;
}
function is_hidden(project, change_id) {
var filters = window.zuul_filter;
if (filters.length == 0) {
return false;
}
var hide = true;
$.each(filters, function(filter_i, filter) {
if(project.indexOf(filter) != -1)
hide = false;
if(change_id !== null && change_id.indexOf(filter) != -1)
hide = false;
});
return hide;
}
function remove(l, idx) {
l[idx] = null;
while (l[l.length-1] === null) {
l.pop();
}
}
function create_tree(pipeline) {
var count = 0;
var pipeline_max_tree_columns = 1;
$.each(pipeline['change_queues'], function(change_queue_i, change_queue) {
var tree = [];
var max_tree_columns = 1;
var changes = [];
var last_tree_length = 0;
$.each(change_queue['heads'], function(head_i, head) {
$.each(head, function(change_i, change) {
changes[change['id']] = change;
change['_tree_position'] = change_i;
});
});
$.each(change_queue['heads'], function(head_i, head) {
$.each(head, function(change_i, change) {
if (change.live === true) {
count += 1;
}
var idx = tree.indexOf(change['id']);
if (idx > -1) {
change['_tree_index'] = idx;
remove(tree, idx);
} else {
change['_tree_index'] = 0;
}
change['_tree_branches'] = [];
change['_tree'] = [];
change['items_behind'].sort(function(a, b) {
return changes[b]['_tree_position'] - changes[a]['_tree_position'];
});
$.each(change['items_behind'], function(i, id) {
tree.push(id);
if (tree.length>last_tree_length && last_tree_length > 0)
change['_tree_branches'].push(tree.length-1);
});
if (tree.length > max_tree_columns) {
max_tree_columns = tree.length;
}
if (tree.length > pipeline_max_tree_columns) {
pipeline_max_tree_columns = tree.length;
}
change['_tree'] = tree.slice(0); // make a copy
last_tree_length = tree.length;
});
});
change_queue['_tree_columns'] = max_tree_columns;
});
pipeline['_tree_columns'] = pipeline_max_tree_columns;
return count;
}
function get_sparkline_url(pipeline_name) {
if (!(pipeline_name in window.zuul_sparkline_urls)) {
window.zuul_sparkline_urls[pipeline_name] = $.fn.graphite.geturl({
url: "<%= @graphite_render_url %>",
from: "-8hours",
width: 100,
height: 16,
margin: 0,
hideLegend: true,
hideAxes: true,
hideGrid: true,
target: [
"color(stats.gauges.zuul.pipeline."+pipeline_name+".current_changes, '6b8182')"
]
});
}
return window.zuul_sparkline_urls[pipeline_name];
}
function format_pipeline(data) {
var count = create_tree(data);
var width = (16 * data['_tree_columns']) + 300;
var html = '<div class="pipeline" style="width:'+width+'"><h3 class="subhead">'+
data['name'];
html += '<span class="count"><img src="' + get_sparkline_url(data['name']);
html += '" title="8 hour history of changes in pipeline"/>';
if (count > 0) {
html += ' (' + count + ')';
}
html += '</span></h3>';
if (data['description'] != null) {
html += '<p>'+data['description']+'</p>';
}
$.each(data['change_queues'], function(change_queue_i, change_queue) {
$.each(change_queue['heads'], function(head_i, head) {
var projects = "";
var change_ids = "";
var hide_queue = true;
$.each(head, function(change_i, change) {
projects += change['project'] + "|";
change_ids += change['id'];
hide_queue &= is_hidden(change['project'], change['id']);
});
html += '<div change_id="' + change_ids + '" project="' + projects + '" style="'
+ (hide_queue ? 'display:none;' : '') + '">';
if (data['change_queues'].length > 1 && head_i == 0) {
html += '<div> Change queue: ';
var name = change_queue['name'];
html += '<a title="' + name + '">';
if (name.length > 32) {
name = name.substr(0,32) + '...';
}
html += name + '</a></div>';
}
html += '<table>';
$.each(head, function(change_i, change) {
html += format_change(change, change_queue);
});
html += '</table></div>';
});
});
html += '</div>';
return html;
}
function safe_id(id) {
if (id === null) {
return "null";
}
return id.replace(',', '_');
}
function format_change(change, change_queue) {
var html = '<tr>';
safe_change_id = safe_id(change['id']);
display = $('#expandByDefault').is(':checked');
collapsed_index = window.zuul_collapsed_exceptions.indexOf(safe_change_id);
if (collapsed_index > -1) {
/* listed as an exception to the current default */
display = !display;
}
for (var i=0; i<change_queue['_tree_columns']; i++) {
var cls = 'tree';
if (i < change['_tree'].length && change['_tree'][i] !== null) {
cls += ' line';
}
html += '<td class="'+cls+'">';
if (i == change['_tree_index']) {
if (change['active'] != true) {
html += '<img src="grey.png" title="Waiting until closer to head of queue to start jobs"/>';
} else if (change.live != true) {
html += '<img src="grey.png" title="Dependent change independently tested"/>';
} else if (change['failing_reasons'] && change['failing_reasons'].length > 0) {
var reason = change['failing_reasons'].join(', ');
var image = 'red.png';
if (reason.match(/merge conflict/)) {
image = 'black.png';
}
html += '<img src="' + image + '" title="Failing because ' + reason +'"/>';
} else {
html += '<img src="green.png" title="Succeeding"/>';
}
}
if (change['_tree_branches'].indexOf(i) != -1) {
if (change['_tree_branches'].indexOf(i) == change['_tree_branches'].length-1)
html += '<img src="line-angle.png"/>';
else
html += '<img src="line-t.png"/>';
}
html += '</td>';
}
html += '<td class="change-container">';
html += '<div class="change" id="' + safe_change_id + '">' +
'<div class="header" onClick="toggle_display_jobs(event, this)" ' +
'onmouseover="$(this).addClass(\'hover\')" ' +
'onmouseout="$(this).removeClass(\'hover\')">';
// Row #1 of the header (project and remaining time)
html += '<span class="project">' + change['project'] + '</span>';
if (change.live === true) {
html += '<span class="time" title="Remaining Time">';
html += format_time(change['remaining_time'], true);
html += '</span>';
}
html += '<br/>';
// Row #2 of the header (change id and enqueue time)
html += '<span class="changeid"> ';
var id = change['id'];
var url = change['url'];
if (id !== null) {
if (id.length == 40) {
id = id.substr(0,7);
}
if (url !== null) {
html += '<a href="'+url+'">';
}
html += id;
if (url !== null) {
html += '</a>';
}
} else {
// if there is not changeset we still need forced content, otherwise
// the layout doesn't work
html += '&nbsp;';
}
html += '</span>';
if (change.live === true) {
html += '<span class="time" title="Queued Time">';
html += format_enqueue_time(change['enqueue_time']) + '</span>';
}
html += '</div>';
// Job listing from here down
html += '<div class="jobs"';
if (display == false) {
html += ' style="display: none;"';
}
html += '>';
$.each(change['jobs'], function(i, job) {
result = job['result'];
var result_class = "result";
if (result === null) {
if (job['url'] !== null) {
result = 'in progress';
} else {
result = 'queued';
}
} else if (result == 'SUCCESS') {
result_class += " result_success";
} else if (result == 'FAILURE') {
result_class += " result_failure";
} else if (result == 'LOST') {
result_class += " result_unstable";
} else if (result == 'UNSTABLE') {
result_class += " result_unstable";
}
html += '<span class="jobwrapper"><span class="job">';
if (job['result'] !== null && job['report_url'] !== null) {
html += '<a href="'+job['report_url']+'">';
html += job['name'];
html += '</a>';
} else if (job['url'] !== null) {
html += '<a href="'+job['url']+'">';
html += job['name'];
html += '</a>';
} else {
html += job['name'];
}
html += ': ';
if (job['result'] === null && job['url'] !== null) {
html += format_progress(job['elapsed_time'], job['remaining_time']);
} else {
html += '<span class="result '+result_class+'">'+result+'</span>';
}
if (job['voting'] == false) {
html += ' (non-voting)';
}
html += '</span></span>';
});
html += '</div></div></td></tr>';
return html;
}
function toggle_display_jobs(e, _header) {
e = e || window.event; // standards compliant || IE
var header = $(_header);
var target = $(e.target || e.srcElement);
var link = header.find("a");
if (target.is(link)) {
return true;
}
content = header.next("div");
content.slideToggle(100, function () {
changeid = header.parent().attr('id');
collapsed_index = window.zuul_collapsed_exceptions.indexOf(changeid);
expand_by_default = $('#expandByDefault').is(':checked');
visible = content.is(":visible");
if (expand_by_default != visible && collapsed_index == -1) {
/* now an exception to the default */
window.zuul_collapsed_exceptions.push(changeid);
} else if (collapsed_index > -1) {
window.zuul_collapsed_exceptions.splice(collapsed_index, 1);
}
});
}
function toggle_expand_by_default(_checkbox) {
var checkbox = $(_checkbox);
expand_by_default = checkbox.is(':checked');
set_cookie('zuul-expand-by-default', expand_by_default ? 'true' : 'false');
window.zuul_collapsed_exceptions = [];
$.each($('div.change'), function(i, _change) {
change = $(_change);
content = change.children('div').next('div');
if (expand_by_default) {
content.show(0);
} else {
content.hide(0);
}
});
}
function update_timeout() {
if (!window.zuul_enable_status_updates) {
setTimeout(update_timeout, 5000);
return;
}
window.zuul_graph_update_count += 1;
update();
/* Only update graphs every minute */
if (window.zuul_graph_update_count > 11) {
window.zuul_graph_update_count = 0;
update_graphs();
}
setTimeout(update_timeout, 5000);
}
function clean_changes_lists() {
new_collapsed_exceptions = [];
$.each($('div.change'), function(i, change) {
collapsed_index = window.zuul_collapsed_exceptions.indexOf(change.id);
if (collapsed_index > -1) {
new_collapsed_exceptions.push(change.id);
return;
}
});
window.zuul_collapsed_exceptions = new_collapsed_exceptions;
}
function update_zuul_info(data) {
if ('zuul_version' in data) {
$('#zuul-version').text(data['zuul_version']);
}
if ('last_reconfigured' in data) {
var last_reconfigured = new Date(data['last_reconfigured']);
$('#last-reconfigured-span').text(last_reconfigured.toString());
}
}
function update() {
var html = '';
$.getJSON('http://zuul.openstack.org/status.json', function(data) {
update_zuul_info(data);
if ('message' in data) {
$("#message").attr('class', 'alertbox');
$("#message").html(data['message']);
} else {
$("#message").removeClass('alertbox');
$("#message").html('');
}
html += '<br style="clear:both"/>';
$.each(data['pipelines'], function(i, pipeline) {
html = html + format_pipeline(pipeline);
});
html += '<br style="clear:both"/>';
$("#pipeline-container").html(html);
$("#trigger_event_queue_length").html(
data['trigger_event_queue']['length']);
$("#result_event_queue_length").html(
data['result_event_queue']['length']);
});
clean_changes_lists();
}
function update_graphs() {
$('.graph').each(function(i, img) {
var newimg = new Image();
var parts = img.src.split('#');
newimg.src = parts[0] + '#' + new Date().getTime();
$(newimg).load(function (x) {
img.src = newimg.src;
});
});
$.each(window.zuul_sparkline_urls, function(name, url) {
var newimg = new Image();
var parts = url.split('#');
newimg.src = parts[0] + '#' + new Date().getTime();
$(newimg).load(function (x) {
window.zuul_sparkline_urls[name] = newimg.src;
});
});
}
function save_filter() {
var name = 'zuul-filter';
var value = $('#filter').val().trim();
set_cookie(name, value);
$('img.filter-saved').removeClass('hidden');
window.setTimeout(function(){
$('img.filter-saved').addClass('hidden');
}, 1500);
}
function set_cookie(name, value) {
document.cookie = name + "=" + value + "; path=/";
}
function read_cookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
$(function() {
window.zuul_graph_update_count = 0;
window.zuul_sparkline_urls = {};
update_timeout();
$(document).on({
'show.visibility': function() {
window.zuul_enable_status_updates = true;
update();
update_graphs();
},
'hide.visibility': function() {
window.zuul_enable_status_updates = false;
}
});
$('#filter').live('keyup change', function () {
window.zuul_filter = $('#filter').val().trim().split(/[\s,]+/);
window.zuul_filter = window.zuul_filter.filter(function(n){
return n;
});
$.each($('div[project]'), function (idx, val) {
val = $(val);
var project = val.attr('project');
var change_id = val.attr('change_id');
if (is_hidden(project, change_id)) {
val.hide(100);
} else {
val.show(100);
}
});
}).live('keyup', function () {
$('a.save-filter')
.removeClass('hidden')
.live('click', function(e){
e.preventDefault();
$(this).addClass('hidden');
save_filter();
});
});
var cookie = read_cookie('zuul-filter');
if(cookie)
$('#filter').val(cookie).change();
cookie = read_cookie('zuul-expand-by-default');
if(cookie)
$('#expandByDefault').prop('checked', cookie == 'true' ? true : false);
});