OXYGENHUB
# 34388e612963 oxygenhub / templates / reports.html
4.0 KiB · HTML · last changed Reports: cards with a kind icon and health, frames that fit and share the hub's look 24 days ago source blame history raw
1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}Reports · {{ repo.owner }}/{{ repo.name }}{% endblock %}
4
{% block tabs %}{% call m::tabs(repo, "reports") %}{% endblock %}
5
{% macro icon(kind) %}<span class="rep-icon rep-{{ kind }}" aria-hidden="true"><svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">{% if kind == "performance" %}<path d="M4 17a8 8 0 1 1 16 0"/><path d="M12 17l4.5-6"/><circle cx="12" cy="17" r="1.2" fill="currentColor"/>{% else if kind == "coverage" %}<path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/><path d="M8.5 12l2.5 2.5 4.5-5"/>{% else if kind == "tests" %}<path d="M9 3h6"/><path d="M10 3v6l-5 9a2 2 0 0 0 1.8 3h10.4a2 2 0 0 0 1.8-3l-5-9V3"/><path d="M7.5 15h9"/>{% else %}<path d="M5 20V11"/><path d="M12 20V4"/><path d="M19 20v-6"/>{% endif %}</svg></span>{% endmacro %}
6
{% block content %}
7
<div class="rep-top">
8
  <h1>Reports</h1>
9
  <p class="mute small">What this repository's Flow jobs measure, newest run first{% if !bookmark.is_empty() %}, on <strong>{{ bookmark }}</strong> (<a href="{{ repo.url }}/reports">all bookmarks</a>){% endif %}. Changes are against the run before on the same bookmark.</p>
10
</div>
11
<div class="rep-list">
12
{% for i in items %}
13
  <article class="rep-card rep-{{ i.health }}">
14
    <div class="rep-head">
15
      {% call icon(i.report.kind) %}
16
      <div class="rep-name">
17
        <a class="rep-link" href="{{ repo.url }}/reports/{{ i.report.name }}?id={{ i.report.id }}">{{ i.report.title }}</a>
18
        <span class="rep-kindname">{{ i.report.kind }}</span>
19
      </div>
20
      <span class="rep-badge">{% if i.health == "good" %}✓ {% else if i.health == "bad" %}✗ {% endif %}{{ i.badge }}</span>
21
    </div>
22
    {% if !i.report.summary.is_empty() %}<p class="rep-summary">{{ i.report.summary }}</p>{% endif %}
23
    {% if !i.metrics.is_empty() %}<ul class="rep-tiles">{% for v in i.metrics %}<li class="{% if v.failing %}rep-failing{% endif %}"><span class="v">{{ v.value }}{% if !v.unit.is_empty() %}<small> {{ v.unit }}</small>{% endif %}</span><span class="k">{{ v.key }}</span>{% if !v.delta.is_empty() %}<span class="rep-delta {{ v.trend }}">{{ v.delta }}</span>{% endif %}</li>{% endfor %}</ul>{% endif %}
24
    <div class="rep-foot">{% if !i.report.bookmark.is_empty() %}<span class="lbl lbl-bm">{{ i.report.bookmark }}</span>{% endif %}{% if let Some(n) = i.report.run_number %} run #{{ n }} ·{% endif %} {{ i.report.job }} · <time title="{{ i.report.created_ms|when_i }}">{{ i.report.created_ms|ago_i }}</time></div>
25
  </article>
26
{% endfor %}
27
{% if let Some(c) = coverage %}
28
  <article class="rep-card rep-{{ c.health }}">
29
    <div class="rep-head">
30
      {% call icon("coverage") %}
31
      <div class="rep-name"><a class="rep-link" href="{{ repo.url }}/coverage">Coverage</a><span class="rep-kindname">coverage</span></div>
32
    </div>
33
    <div class="rep-hero"><span class="rep-big">{{ c.big }}</span><span class="mute">{{ c.sub }}</span></div>
34
    <div class="rep-foot"><span class="lbl lbl-bm">{{ c.bookmark }}</span> from the jobs' <code>coverage</code> artifacts · <time title="{{ c.when_ms|when_i }}">{{ c.when_ms|ago_i }}</time></div>
35
  </article>
36
{% endif %}
37
{% if let Some(t) = tests %}
38
  <article class="rep-card rep-{{ t.health }}">
39
    <div class="rep-head">
40
      {% call icon("tests") %}
41
      <div class="rep-name"><a class="rep-link" href="{{ repo.url }}/tests">Tests</a><span class="rep-kindname">tests</span></div>
42
    </div>
43
    <div class="rep-hero"><span class="rep-big">{{ t.big }}</span><span class="mute">{{ t.sub }}</span></div>
44
    <div class="rep-foot"><span class="lbl lbl-bm">{{ t.bookmark }}</span> from the jobs' <code>junit</code> artifacts · <time title="{{ t.when_ms|when_i }}">{{ t.when_ms|ago_i }}</time></div>
45
  </article>
46
{% endif %}
47
</div>
48
{% if items.is_empty() && coverage.is_none() && tests.is_none() %}<p class="empty">No reports yet. A Flow job keeps one with <code>report "NAME" { path "/src/out/report" }</code> in its output; see the OxygenFlow wiki's Reports page.</p>{% endif %}
49
{% endblock %}