tartiflette/appci/templates/branch.html

168 lines
5.6 KiB
HTML
Raw Normal View History

2017-11-19 09:41:32 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Apps CI Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2017-11-26 20:48:26 +01:00
<link rel="stylesheet" href="../../css/bootstrap.css" media="screen">
<link rel="stylesheet" href="../../skins/eden.css" media="screen">
2017-11-19 09:41:32 +01:00
<style>
#app-test-results
{
margin-left:auto;
margin-right:auto;
/*width:1000px;*/
}
.navbar-holder-dark {
padding: 20px 20px 200px 20px;
background: #333333;
}
table, thead, tbody { display: block; width: 100%;}
table.apps { margin: 0 auto; margin-top: 100px; width: 1000px; overflow-x: visible; }
th.ci-test-title
{
margin:5px;
white-space: nowrap;
}
th.ci-test-title > div
{
position:relative;
transform:
translate(0px, -10px)
rotate(315deg);
width: 33px;
}
th.ci-test-title > div > span
{
border-bottom: 1px solid #aaa;
padding: 0;
border:none;
}
/*tr { display: block; width: 100%; }*/
th, td { display: block; border: none; padding; 0px;float: left; height:33px; width: 33px; margin: 5px; }
th.ci-app-name, td.ci-app-name { text-align: center; width:130px; padding-top:9px !important; }
td.ci-test-result > div { position:relative; background-color: #bdc3c7; border-radius:5px; width: 100%; height:100%;}
td.ci-test-result { text-align:center; }
td.ci-test-result > div.success { background-color: rgb(46,204,113); }
td.ci-test-result > div.danger { background-color: rgb(225,80,62); }
.table > thead > tr > th { border : none; }
.table > tbody > tr > td { border : none; }
.canvasjs-chart-credit { display: none; }
.daysAgo { font-size: 12px; width:100px; }
2017-11-19 09:41:32 +01:00
</style>
</head>
<body>
<div class="bs-docs-section">
<div class="row text-center">
<h2>{{ data.ci_branch[1] }}</h2>
2017-11-26 20:48:26 +01:00
<div id="levelSummary" style="height: 270px;" class="col-sm-6 col-sm-offset-3"></div>
2017-11-19 09:41:32 +01:00
</div>
<div class="row">
<div id="app-test-results">
<div>
<table class="table table-responsive apps">
<thead>
<tr>
<th class="ci-app-name"><div></div></th>
<th class="ci-test-title"><div>Level</div></th>
{% for test in data.tests %}
<th class="ci-test-title"><div><span>{{ test }}</span></div></th>
{% endfor %}
<th class="ci-test-title"></th>
2017-11-19 09:41:32 +01:00
</tr>
</thead>
<tbody>
{% for app, test_results in data.apps %}
<tr id="ci-app-{{ app }}">
2017-11-26 20:48:26 +01:00
<td class="ci-app-name"><a href="../app/{{ app }}.html"><div title="App"><strong>{{ app }}</strong></div></a></td>
2017-11-19 09:41:32 +01:00
{% if test_results %}
2017-11-26 20:48:26 +01:00
<td><div title="Level"><strong>{{ '?' if test_results["level"] == None else test_results["level"] }}</strong></div></td>
2017-11-19 09:41:32 +01:00
{% for test in data.tests %}
<td class="ci-test-result">
<div title="{{ test }}" class="{{ data.result_to_class[test_results["tests"][test]] }}"></div>
</td>
{% endfor %}
{% endif %}
<td class="daysAgo" timestamp="{{ test_results['date'] }}">
</td>
2017-11-19 09:41:32 +01:00
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
2017-11-26 20:48:26 +01:00
<script src="../../js/jquery-2.1.3.min.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/canvasjs.min.js"></script>
2017-11-19 09:41:32 +01:00
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("levelSummary", {
2017-11-26 20:48:26 +01:00
animationEnabled: false,
2017-11-19 09:41:32 +01:00
data: [{
type: "doughnut",
startAngle: -90,
//innerRadius: 60,
indexLabelFontSize: 17,
indexLabel: "{label} - #percent%",
toolTipContent: "<b>{label}:</b> {y} (#percent%)",
dataPoints: [
2017-11-26 20:48:26 +01:00
{ y: {{ data.summary_per_level[0] }}, label: "Unknown", color: "#cccccc" },
{ y: {{ data.summary_per_level[1] }}, label: "Level 0", color: "#d9534f" },
{ y: {{ data.summary_per_level[2] }}, label: "Level 1", color: "#E26D4F" },
{ y: {{ data.summary_per_level[3] }}, label: "Level 2", color: "#E98D4E" },
{ y: {{ data.summary_per_level[4] }}, label: "Level 3", color: "#f0ad4e" },
{ y: {{ data.summary_per_level[5] }}, label: "Level 4", color: "#CBB052" },
{ y: {{ data.summary_per_level[6] }}, label: "Level 5", color: "#A6B255" },
{ y: {{ data.summary_per_level[7] }}, label: "Level 6", color: "#7AB659" },
{ y: {{ data.summary_per_level[8] }}, label: "Level 7", color: "#5cb85c" }
2017-11-19 09:41:32 +01:00
]
}]
});
chart.render();
}
</script>
<script>
function daysAgo(timestamp) {
var difference = Math.round(+new Date()/1000) - timestamp;
var daysDifference = Math.round(difference/60/60/24);
//return (new Date(timestamp*1000));
return "(" + daysDifference + " days ago)";
}
$(".daysAgo").each(function () {
console.log($(this));
var t = $(this).attr("timestamp");
$(this).text(daysAgo(t));
});
</script>
2017-11-19 09:41:32 +01:00
</body>
</html>