tartiflette/app/templates/appci_compare.html
2018-01-30 16:20:23 -05:00

82 lines
3.6 KiB
HTML

{% extends "base.html" %}
{% block content %}
<h2 class="text-center my-3">{{ ref.display_name }} vs. {{ target.display_name }}</h2>
<div id="compareSummary" style="height: 270px;" class="col-sm-6 offset-sm-3 my-3"></div>
<div class="row">
<div class="mx-auto">
<div>
<table class="table table-responsive ci-app-table">
<thead>
<tr>
<th class="ci-app-row-title"></th>
<th class="ci-app-test-title"><div>{{ ref.display_name }} </div></th>
<th class="ci-app-test-title"><div>{{ target.display_name }} </div></th>
<th class="ci-app-test-title"></th>
</tr>
</thead>
<tbody>
{% for result in results %}
<tr class="ci-branch-comparison" value="{{ result.compare }}" app="{{ result.app.name }}">
<td class="ci-app-row-title">
{% if result.app.list.name == "official" %}
<span class="official-star oi oi-star" title="Official" aria-hidden="true"></span>
{% endif %}
<a href="{{ url_for('main.appci_app', app=result.app.name) }}">
<span title="App">
<strong>{{ result.app.name }}</strong></span>
</a>
</td>
<td class="ci-app-level" value="{{ result.level }}"><div title="Level">
<strong>
{{ result.level if result.level >= 0 else "" }}
</strong></div></td>
<td class="ci-app-level" value="{{ result.level_compare }}"><div title="Level">
<strong>
{{ result.level_compare if result.level_compare >= 0 else "" }}
</strong></div></td>
<td class="compare">
{% if result.level == -1 or result.level_compare == -1 %}
<span class="oi oi-question-mark level-unknown" title="Don't know" aria-hidden="true"></span>
{% elif result.level > result.level_compare %}
<span class="oi oi-chevron-bottom level-regression" title="Regression" aria-hidden="true"></span>
{% elif result.level < result.level_compare %}
<span class="oi oi-chevron-top level-improvement" title="Improvement" aria-hidden="true"></span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<script src="{{ url_for('static', filename='js/canvasjs.min.js') }}"></script>
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("compareSummary", {
animationEnabled: false,
data: [{
type: "doughnut",
startAngle: -90,
//innerRadius: 60,
indexLabelFontSize: 17,
indexLabel: "{label} - #percent%",
toolTipContent: "<b>{label}:</b> {y} (#percent%)",
dataPoints: [
{ y: $(".ci-branch-comparison[value=unknown]").length, label: "Unknown", color:"#cccccc" },
{ y: $(".ci-branch-comparison[value=regression]").length, label: "Regressions", color: "#d9534f" },
{ y: $(".ci-branch-comparison[value=same]").length, label: "Same", color: "#67e0d0" },
{ y: $(".ci-branch-comparison[value=improvement]").length, label: "Improvements", color: "#46bd32" }
]
}]
});
chart.render();
}
</script>
{% endblock %}