| 1 | <div class="container admin-page">
|
|---|
| 2 | <h1>Updates</h1>
|
|---|
| 3 | <p><a href="/admin" class="btn">← Beheer</a></p>
|
|---|
| 4 |
|
|---|
| 5 | <% if (success) { %><div class="alert alert-success"><%= success %></div><% } %>
|
|---|
| 6 | <% if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| 7 |
|
|---|
| 8 | <section class="set-card">
|
|---|
| 9 | <h2>Versie van deze Klonkt</h2>
|
|---|
| 10 |
|
|---|
| 11 | <div class="upd-row">
|
|---|
| 12 | <span class="upd-label">App-versie</span>
|
|---|
| 13 | <span class="upd-val"><%= appVersion || '—' %></span>
|
|---|
| 14 | </div>
|
|---|
| 15 | <div class="upd-row">
|
|---|
| 16 | <span class="upd-label">Huidig</span>
|
|---|
| 17 | <span class="upd-val">
|
|---|
| 18 | <% if (currentSha) { %><code><%= currentSha %></code> <span class="upd-desc"><%= currentDesc %></span>
|
|---|
| 19 | <% } else { %><em>onbekend (nog niet via de update-knop bijgewerkt)</em><% } %>
|
|---|
| 20 | </span>
|
|---|
| 21 | </div>
|
|---|
| 22 | <div class="upd-row">
|
|---|
| 23 | <span class="upd-label">Nieuwste</span>
|
|---|
| 24 | <span class="upd-val">
|
|---|
| 25 | <% if (latestSha) { %><code><%= latestSha %></code> <span class="upd-desc"><%= latestDesc %></span>
|
|---|
| 26 | <% } else { %><em>kon de nieuwste versie niet ophalen</em><% } %>
|
|---|
| 27 | </span>
|
|---|
| 28 | </div>
|
|---|
| 29 |
|
|---|
| 30 | <div class="upd-status">
|
|---|
| 31 | <% if (!canCheck) { %>
|
|---|
| 32 | <span class="upd-badge warn">⚠ Geen update-bron bereikbaar</span>
|
|---|
| 33 | <% } else if (upToDate) { %>
|
|---|
| 34 | <span class="upd-badge ok">✓ Up-to-date</span>
|
|---|
| 35 | <% } else { %>
|
|---|
| 36 | <span class="upd-badge new">↻ Update beschikbaar<% if (behind) { %> (<%= behind %> commit<%= behind === '1' ? '' : 's' %> achter)<% } %></span>
|
|---|
| 37 | <% } %>
|
|---|
| 38 | </div>
|
|---|
| 39 |
|
|---|
| 40 | <% if (canCheck) { %>
|
|---|
| 41 | <form method="post" action="/admin/updates/run" class="set-form"
|
|---|
| 42 | onsubmit="return confirm('De site wordt naar de nieuwste versie gebracht en herstart kort. Doorgaan?');">
|
|---|
| 43 | <button type="submit" class="btn btn-primary">
|
|---|
| 44 | <%= upToDate ? '↻ Opnieuw uitrollen' : '⬆ Nu bijwerken' %>
|
|---|
| 45 | </button>
|
|---|
| 46 | </form>
|
|---|
| 47 | <% } %>
|
|---|
| 48 |
|
|---|
| 49 | <p class="set-help" style="margin-top:1rem">
|
|---|
| 50 | Bijwerken haalt de nieuwste code op en herstart deze site kort (~10s). Doe dit
|
|---|
| 51 | rustig — er gaat niets verloren (je posts, instellingen en cirkel blijven staan).
|
|---|
| 52 | </p>
|
|---|
| 53 | </section>
|
|---|
| 54 | </div>
|
|---|
| 55 |
|
|---|
| 56 | <style>
|
|---|
| 57 | .admin-page { max-width: 700px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 58 | .admin-page h1 { font-family: var(--font-display, serif); font-size: 2rem; margin: 0 0 .25rem; }
|
|---|
| 59 | .set-card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem; }
|
|---|
| 60 | .set-card h2 { font-family: var(--font-display, serif); font-size: 1.25rem; margin: 0 0 1rem; }
|
|---|
| 61 | .set-help { color: var(--ink-muted); font-size: .9rem; }
|
|---|
| 62 | .upd-row { display: flex; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
|
|---|
| 63 | .upd-label { width: 90px; flex-shrink: 0; font-size: .8rem; font-weight: 600; color: var(--ink-muted); }
|
|---|
| 64 | .upd-val { font-size: .9rem; }
|
|---|
| 65 | .upd-val code { background: var(--paper); padding: .1rem .4rem; border-radius: 4px; font-size: .85em; }
|
|---|
| 66 | .upd-desc { color: var(--ink-muted); }
|
|---|
| 67 | .upd-status { margin: 1.1rem 0; }
|
|---|
| 68 | .upd-badge { font-size: .8rem; font-weight: 700; padding: .25rem .7rem; border-radius: 20px; }
|
|---|
| 69 | .upd-badge.ok { background: #d1fae5; color: #065f46; }
|
|---|
| 70 | .upd-badge.new { background: #fef3c7; color: #92400e; }
|
|---|
| 71 | .upd-badge.warn { background: #fee2e2; color: #991b1b; }
|
|---|
| 72 | .alert { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
|
|---|
| 73 | .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
|
|---|
| 74 | .alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
|
|---|
| 75 | </style>
|
|---|