Add v2-packaging info/display

This commit is contained in:
Alexandre Aubin 2023-06-11 16:14:41 +02:00
parent 306d1aff78
commit c33bf8596f
2 changed files with 25 additions and 2 deletions

View file

@ -41,6 +41,7 @@ class AppCatalog():
known_app.maintained = 'package-not-maintained' not in app.get('antifeatures', [])
known_app.state = app["state"]
known_app.public_level = app.get("level", None)
known_app.packaging_format = app["manifest"].get("packaging_format", 0)
if "github" in known_app.repo:
@ -86,6 +87,7 @@ class App(db.Model):
testing_pr = db.Column(db.PickleType, default=None)
opened_issues = db.Column(db.Integer, default=-1)
opened_prs = db.Column(db.Integer, default=-1)
packaging_format = db.Column(db.Integer, default=-1)
long_term_good_quality = db.Column(db.Boolean)
long_term_broken = db.Column(db.Boolean)

View file

@ -2,7 +2,8 @@
{% block content %}
<h2 class="text-center my-3">{{ branch.display_name }}</h2>
<div id="levelSummary" style="height: 270px;" class="col-sm-6 offset-sm-3 my-3"></div>
<div id="levelSummary" class="col-md-3 col-offset-md-3 col-sm-6 offset-sm-3 my-3" style="height: 270px; display: inline-block;"></div>
<div id="packagingSummary" class="col-md-3 col-sm-6 my-3" style="height: 270px; display: inline-block;"></div>
<div class="row">
<div class="mx-auto">
@ -24,7 +25,7 @@
</thead>
<tbody>
{% for result in app_results %}
<tr app="{{ result.app.name }}" class="resultline {% if result.needs_attention %}ci-needs-attention{% endif %}" {% if result.outdated %}style="opacity: 0.8; background-color: #e9e9e9;"{% endif %} >
<tr app="{{ result.app.name }}" class="resultline {% if result.needs_attention %}ci-needs-attention{% endif %}" {% if result.outdated %}style="opacity: 0.8; background-color: #e9e9e9;"{% endif %} data-packaging="{{ result.app.packaging_format }}" >
<td class="ci-app-row-title">
{% if result.app.long_term_good_quality %}
<span class="oi oi-star" title="Long-term good quality" aria-hidden="true" style="color: goldenrod;"></span>
@ -32,6 +33,9 @@
{% if result.app.long_term_broken %}
<span class="oi oi-flag" title="Long-term broken" aria-hidden="true" style="color: firebrick;"></span>
{% endif %}
{% if result.app.packaging_format and result.app.packaging_format >= 2 %}
<span class="oi oi-box" title="Uses packaging v2!" aria-hidden="true" style="color: blueviolet; font-size: 0.8em;"></span>
{% endif %}
<a href="{{ url_for('main.appci_app', app=result.app.name) }}">
<span class="font-weight-bold" title="More tests / info for this app">
{{ result.app.name }}</span>
@ -112,6 +116,23 @@ window.onload = function () {
}]
});
chart.render();
var chart2 = new CanvasJS.Chart("packagingSummary", {
animationEnabled: false,
data: [{
type: "doughnut",
startAngle: -90,
//innerRadius: 60,
indexLabelFontSize: 17,
indexLabel: "{label} - {y}",
toolTipContent: "<b>{label}:</b> {y}",
dataPoints: [
{ y: $(".resultline[data-packaging=2]").length, label: "Packaging v2", color: "#8829df" },
{ y: $(".resultline[data-packaging=1]").length, label: "Packaging v1", color: "#f0f0f0" },
]
}]
});
chart2.render();
$("input[type='radio']").change(function() { update_filters(); });
update_filters();
}