OXYGENHUB
◆ v0.4.2 oxygenhub / templates / report.html
3.7 KiB · HTML · last changed Reports: the Reports tab, each report's page, its frame, and checks from thresholds 24 days ago source blame history raw
c8df33a6 Andy McCall ↶ 1
{% extends "base.html" %}
2
{% import "repo_tabs.html" as m %}
3
{% block title %}{{ report.title }} · Reports · {{ repo.owner }}/{{ repo.name }}{% endblock %}
4
{% block tabs %}{% call m::tabs(repo, "reports") %}{% endblock %}
5
{% block content %}
6
<section class="cov-hero">
7
  <div class="cov-hero-head">
8
    <div>
9
      <div class="small"><a href="{{ repo.url }}/reports">Reports</a> /</div>
10
      <h1>{{ report.title }} <span class="tag rep-kind rep-{{ report.kind }}">{{ report.kind }}</span></h1>
11
      <div class="cov-sub">{% if bookmarks.len() > 1 %}<form class="inline" method="get" action="{{ repo.url }}/reports/{{ report.name }}"><label for="rep-bm" class="mute">bookmark</label> <select id="rep-bm" name="bookmark" onchange="this.form.submit()">{% for b in bookmarks %}<option value="{{ b }}"{% if b.as_str() == report.bookmark.as_str() %} selected{% endif %}>{{ b }}</option>{% endfor %}</select> <noscript><button>Show</button></noscript></form>{% else %}<span class="mute">on</span> <strong>{{ report.bookmark }}</strong>{% endif %}
12
        {% if let Some(n) = report.run_number %}· <a href="{{ repo.url }}/flow/{{ n }}">run #{{ n }}</a>{% endif %} · job {{ report.job }} · <time title="{{ report.created_ms|when_i }}">{{ report.created_ms|ago_i }}</time> · {{ report.files }} files, {{ report.bytes|bytes }} · <a href="{{ files_base }}/report.toml" target="_blank" rel="noopener">report.toml</a></div>
13
      {% if !report.summary.is_empty() %}<p class="rep-summary">{{ report.summary }}</p>{% endif %}
14
    </div>
15
  </div>
16
</section>
17
18
{% if !metrics.is_empty() %}
19
<section class="panel">
20
  <table class="rep-table">
21
    <thead><tr><th>Metric</th><th class="num">Value</th><th class="num">Change</th><th>Across runs</th><th>Threshold</th></tr></thead>
22
    <tbody>
23
    {% for v in metrics %}
24
      <tr class="{% if v.failing %}rep-failing{% endif %}">
25
        <td><code>{{ v.key }}</code></td>
26
        <td class="num"><strong>{{ v.value }}</strong>{% if !v.unit.is_empty() %} <small class="mute">{{ v.unit }}</small>{% endif %}</td>
27
        <td class="num">{% if !v.delta.is_empty() %}<span class="rep-delta {{ v.trend }}">{{ v.delta }}</span>{% else %}<span class="mute">–</span>{% endif %}</td>
28
        <td>{{ v.spark|safe }}</td>
29
        <td class="small">{% if v.failing %}<span class="error">{{ v.threshold }}: failing</span>{% else %}<span class="mute">{{ v.threshold }}</span>{% endif %}</td>
30
      </tr>
31
    {% endfor %}
32
    </tbody>
33
  </table>
34
</section>
35
{% endif %}
36
37
{% if let Some(src) = frame %}
38
<section class="rep-frame-wrap">
39
  <iframe class="rep-frame" src="{{ src }}" sandbox="allow-scripts" referrerpolicy="no-referrer" loading="lazy" title="{{ report.title }}"></iframe>
40
  <p class="small mute">The report's own page, in a sandbox: its scripts run with no access to your session or this hub. <a href="{{ src }}" target="_blank" rel="noopener">Open it alone</a>.</p>
41
</section>
42
{% endif %}
43
44
<div class="cov-grid">
45
  {% if !context.is_empty() %}
46
  <section class="panel cov-card">
47
    <h2>Context</h2>
48
    <dl class="rep-context">{% for (k, v) in context %}<dt>{{ k }}</dt><dd>{{ v }}</dd>{% endfor %}</dl>
49
  </section>
50
  {% endif %}
51
  <section class="panel cov-card">
52
    <h2>Runs on {{ report.bookmark }}</h2>
53
    <ul class="rep-runs">
54
    {% for r in runs.iter().take(15) %}
55
      <li{% if r.id == report.id %} class="on"{% endif %}><a href="{{ repo.url }}/reports/{{ report.name }}?id={{ r.id }}">{% if let Some(n) = r.run_number %}run #{{ n }}{% else %}upload{% endif %}</a> <span class="mute small"><time title="{{ r.created_ms|when_i }}">{{ r.created_ms|ago_i }}</time>{% if !r.summary.is_empty() %} · {{ r.summary }}{% endif %}</span></li>
56
    {% endfor %}
57
    </ul>
58
  </section>
59
</div>
60
{% endblock %}