OXYGENHUB
# 93f445fa50d8 oxygenhub / templates / admin_backups.html
2.8 KiB · HTML · last changed Administration: a sidebar of grouped pages, one page per section (closes #288) 15 days ago source blame history raw
1e8a6e8b Andy McCall ↶ 1
{% extends "base.html" %}
737de0fa Andy McCall ↶ 2
{% import "admin_nav.html" as an %}
1e8a6e8b Andy McCall ↶ 3
{% block title %}Backups · Administration{% endblock %}
4
{% block mainclass %} class="wide"{% endblock %}
5
{% block content %}
6
<div class="head"><h1>Backups <small>{{ owners.len()|plural("owner", "owners") }} · <a href="/admin">Administration</a></small></h1></div>
737de0fa Andy McCall ↶ 7
<div class="settings-layout">
8
{% call an::nav(crate::web::admin::AdminSection::Backups) %}
9
<div class="sections settings-body">
1e8a6e8b Andy McCall ↶ 10
<p class="small mute">Each user and organisation backs up its own repositories, to a place it controls (docs/backups.md). Here is whether each one ran and how it went; what a run wrote stays with its owner. This site's own backup runs on its host, outside the hub.</p>
11
<section class="card-box">
12
  <div class="card-head"><h2>Owners' backups</h2><span class="count-chip">{{ owners.len() }}</span></div>
13
  {% if owners.is_empty() %}<p class="empty small">Nobody has set up a backup yet.</p>
14
  {% else %}
15
  <div class="table"><table class="backup-runs">
16
    <tr><th>Owner</th><th>How often</th><th>Where</th><th>Kept</th><th>Repositories</th><th>Last run</th><th>Failed today</th></tr>
17
    {% for o in owners %}
18
    <tr>
19
      <td><a href="/{{ o.setting.owner }}">{{ o.setting.owner }}</a> <span class="mute small">{% if o.setting.kind == "org" %}organisation{% else %}user{% endif %}</span></td>
20
      <td>{% if o.setting.every == "off" %}<span class="mute">off</span>{% else %}{{ o.setting.every }}{% endif %}</td>
21
      <td><code>{{ o.place() }}</code></td>
22
      <td>{{ o.setting.keep_days }} days</td>
23
      <td>{{ o.repos }}</td>
24
      <td>{% if let Some(r) = o.last %}<span class="backup-status st-{{ r.status }}">{{ r.status }}</span> <time title="{{ r.started_ms|when_i }}">{{ r.started_ms|ago_i }}</time> <span class="mute small">{{ r.repos }} repos, {{ (r.bytes / 1024) }} KiB sent</span>{% if !r.detail.is_empty() %}<div class="small mute">{{ r.detail }}</div>{% endif %}{% else %}<span class="mute">never</span>{% endif %}</td>
25
      <td>{% if o.failed_day > 0 %}<span class="backup-status st-failed">{{ o.failed_day }}</span>{% else %}<span class="mute">0</span>{% endif %}</td>
26
    </tr>
27
    {% endfor %}
28
  </table></div>
29
  {% endif %}
30
</section>
31
<section class="card-box">
32
  <div class="card-head"><h2>Not backed up</h2><span class="count-chip">{{ uncovered.len() }}</span></div>
33
  {% if uncovered.is_empty() %}<p class="empty small">Every owner of a repository backs it up.</p>
34
  {% else %}
35
  <p class="small mute">These own repositories that no backup covers: their owners set one up under Settings › Backups (an organisation's under its settings).</p>
36
  <ul class="plain">{% for (owner, n) in uncovered %}<li><a href="/{{ owner }}">{{ owner }}</a> <span class="mute small">{{ n|plural("repository", "repositories") }}</span></li>{% endfor %}</ul>
37
  {% endif %}
38
</section>
737de0fa Andy McCall ↶ 39
</div>
40
</div>
1e8a6e8b Andy McCall ↶ 41
{% endblock %}