Files
virtuality/web/templates/update.html
T
2026-05-07 01:27:49 +09:00

138 строки
5.6 KiB
HTML

<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Обновления — {{ app_name }}</title>
<link rel="stylesheet" href="/static/app.css">
</head>
<body>
<div class="shell">
<header class="topbar">
<div>
<div class="brand">Обновления</div>
<div class="muted">GitHub update center: проверка, changelog и установка</div>
</div>
<div class="top-meta">
<span>user: {{ user }}</span>
<a class="link-pill" href="/">← Дашборд</a>
<form method="post" action="/logout" class="logout-form"><button class="ghost">Выйти</button></form>
</div>
</header>
{% if error %}
<div class="alert danger">{{ error }}</div>
{% endif %}
<section class="grid stats">
<article class="card stat">
<div class="label">Текущая версия</div>
<div class="value small">{{ info.current_version }}</div>
</article>
<article class="card stat">
<div class="label">Новая версия</div>
<div class="value small">{{ info.latest_version }}</div>
</article>
<article class="card stat">
<div class="label">Статус</div>
<div class="value small">{{ 'Есть обновление' if info.has_update else 'Актуально' }}</div>
<span class="status {{ 'warn' if info.has_update else 'ok' }}">{{ 'update' if info.has_update else 'ok' }}</span>
</article>
<article class="card stat">
<div class="label">Последняя проверка</div>
<div class="value small">{{ info.checked_at }}</div>
</article>
</section>
<section class="grid two">
<article class="card">
<div class="card-head">
<h2>Проверка GitHub</h2>
<span class="pill">{{ info.remote }}/{{ info.branch }}</span>
</div>
<div class="meta-grid">
<div><span>Source</span><strong>{{ info.source_dir }}</strong></div>
<div><span>Local commit</span><strong>{{ info.current_commit[:12] if info.current_commit else 'unknown' }}</strong></div>
<div><span>Remote commit</span><strong>{{ info.latest_commit[:12] if info.latest_commit else 'unknown' }}</strong></div>
</div>
{% if not info.fetch_ok %}
<div class="alert danger top-space">GitHub fetch вернул ошибку: {{ info.fetch_error }}</div>
{% endif %}
<div class="actions top-space">
<form method="post" action="/update/check"><button>Проверить сейчас</button></form>
{% if info.has_update %}
<form method="post" action="/update/apply" onsubmit="return confirm('Запустить обновление Virtuality из GitHub? Панель перезапустится.');">
<button class="primary">Установить обновление</button>
</form>
{% else %}
<button disabled>Установить обновление</button>
{% endif %}
</div>
</article>
<article class="card">
<div class="card-head">
<h2>Состояние установки</h2>
<span class="status {{ 'ok' if info.state.status == 'success' else 'err' if info.state.status == 'error' else 'warn' }}">{{ info.state.status }}</span>
</div>
<div class="notice">{{ info.state.message }}</div>
<div class="meta-grid top-space">
<div><span>Started</span><strong>{{ info.state.started_at or '—' }}</strong></div>
<div><span>Updated</span><strong>{{ info.state.updated_at or '—' }}</strong></div>
<div><span>Finished</span><strong>{{ info.state.finished_at or '—' }}</strong></div>
</div>
</article>
</section>
<section class="card">
<div class="card-head">
<h2>Пропущенные версии и функции</h2>
<span class="pill">{{ info.missing_versions|length }} версий</span>
</div>
{% for release in info.missing_versions %}
<div class="release-note">
<div class="card-head compact">
<h2>{{ release.version }} · {{ release.title }}</h2>
<span class="pill">{{ release.date }}</span>
</div>
<p class="muted">{{ release.summary }}</p>
<ul>
{% for feature in release.features %}
<li>{{ feature }}</li>
{% endfor %}
</ul>
</div>
{% else %}
<div class="muted">Нет пропущенных версий. Система на свежем коде, красота.</div>
{% endfor %}
</section>
<section class="grid two">
<article class="card">
<div class="card-head">
<h2>Новые коммиты</h2>
<span class="pill">{{ info.commits|length }}</span>
</div>
<div class="services">
{% for commit in info.commits %}
<div class="service-row">
<span><strong>{{ commit.short }}</strong><small>{{ commit.subject }} · {{ commit.date }}</small></span>
</div>
{% else %}
<div class="muted">Новых коммитов нет.</div>
{% endfor %}
</div>
</article>
<article class="card">
<div class="card-head">
<h2>Лог обновления</h2>
<span class="pill">/var/log/virtuality/update.log</span>
</div>
<pre>{{ info.log_tail or 'Лог пока пуст.' }}</pre>
</article>
</section>
</div>
</body>
</html>