![Joe Gordon](/assets/img/avatar_default.png)
Add lastcomment dashboad to the collection of third party CI tools so it can be worked on via the standard gerrit workflow. lastcomment is an alternative monitoring scoreboard that uses gerrit's REST API as the data source. It was designed to address the developer's question, is CI system X running/reliable or not? original source: https://github.com/jogo/lastcomment Change-Id: I6bb0f321e1885999c9e20f74417dad8768c24c52
91 lines
2.9 KiB
HTML
91 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>OpenStack Third party CI Report</title>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table.min.css">
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
|
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/bootstrap-table.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.8.1/extensions/filter-control/bootstrap-table-filter-control.js"></script>
|
|
</head>
|
|
|
|
<script>
|
|
var oneDay = 24 * 60 * 60 * 1000;
|
|
var oneHour = 60 * 60 * 1000;
|
|
|
|
function timeFormatter(value, row, index) {
|
|
var diff = Date.now() - value*1000;
|
|
if (Math.floor(diff/oneDay)<1) {
|
|
return Math.floor(diff/oneHour) + " Hours"
|
|
}
|
|
return Math.floor(diff/oneDay) + " Days"
|
|
}
|
|
|
|
function isDataStale(time) {
|
|
var diff = Date.now() - time*1000;
|
|
var days = Math.floor(diff/oneDay);
|
|
var hours = Math.floor(diff/oneHour);
|
|
if (days === 1) {
|
|
return "Warning: data is " + days + " day old";
|
|
} else if (days > 1) {
|
|
return "Warning: data is " + days + " days old";
|
|
} else if (hours === 1) {
|
|
return "Warning: Data is " + hours + " hour old";
|
|
} else if (hours > 1) {
|
|
return "Warning: Data is " + hours + " hours old";
|
|
} else {
|
|
return "Data is up to date";
|
|
}
|
|
}
|
|
|
|
function timeStyle(value, row, index) {
|
|
if (value.indexOf("Days") > 0) {
|
|
return {classes: 'danger'}
|
|
}
|
|
return {}
|
|
}
|
|
|
|
function rateStyle(value, row, index) {
|
|
if (typeof value === 'undefined'){
|
|
return {classes: 'danger'}
|
|
}
|
|
var num = parseInt(value.substring(0,value.length - 1))
|
|
if (num < 60 ) {
|
|
return {classes: 'danger'}
|
|
}
|
|
return {}
|
|
|
|
}
|
|
|
|
function responseHandler(res) {
|
|
document.getElementById("stale").innerHTML = isDataStale(res.timestamp);
|
|
return res.rows
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
<body>
|
|
|
|
<div class="container">
|
|
<h1>OpenStack Third Party CI Report</h1>
|
|
<p id="stale"></p>
|
|
<table data-toggle="table" data-url="lastcomment.json" data-filter-control="true" data-response-handler="responseHandler">
|
|
<thead>
|
|
<tr>
|
|
<th data-field="name" data-filter-control="input">Name</th>
|
|
<th data-field="project" data-filter-control="select">Project</th>
|
|
<th data-field="last" data-formatter="timeFormatter" data-cell-style="timeStyle" data-sortable="true">Last Seen</th>
|
|
<th data-field="rate" data-cell-style="rateStyle" data-sortable="true">Success Rate</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|
|
|