Страница обновлений была возвращена в общий каркас панели
Этот коммит содержится в:
@@ -7,11 +7,33 @@
|
||||
<link rel="stylesheet" href="/static/app.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="shell">
|
||||
<header class="topbar">
|
||||
<div class="v-layout">
|
||||
<aside class="v-sidebar">
|
||||
<div class="v-logo">
|
||||
<strong>Virtuality</strong>
|
||||
<span>control panel</span>
|
||||
</div>
|
||||
<nav class="v-nav">
|
||||
<a href="/">Обзор</a>
|
||||
<a href="/vm/create">Создать VM</a>
|
||||
<div class="v-nav-group open">
|
||||
<button class="v-nav-group-title" type="button">Образы</button>
|
||||
<a href="/iso">ISO</a>
|
||||
<a href="/disk-images">Диски</a>
|
||||
</div>
|
||||
<a href="/network">Сеть</a>
|
||||
<a href="/operations">Операции</a>
|
||||
<a href="/logs">Журналы</a>
|
||||
<a class="active" href="/update">Обновления</a>
|
||||
<a href="/host">Хост</a>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<main class="v-main">
|
||||
<header class="v-topbar">
|
||||
<div>
|
||||
<div class="brand">Обновления</div>
|
||||
<div class="muted">GitHub update center: changelog, проверка и установка</div>
|
||||
<div class="v-title">Обновления</div>
|
||||
<div class="v-subtitle">GitHub update center: changelog, проверка и установка</div>
|
||||
</div>
|
||||
<div class="top-meta">
|
||||
<span>user: {{ user }}</span>
|
||||
@@ -44,7 +66,7 @@
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="grid two">
|
||||
<section class="grid two update-main-grid">
|
||||
<article class="card">
|
||||
<div class="card-head">
|
||||
<h2>Проверка GitHub</h2>
|
||||
@@ -59,36 +81,24 @@
|
||||
<div class="alert danger top-space">GitHub fetch вернул ошибку: {{ info.fetch_error }}</div>
|
||||
{% endif %}
|
||||
<div class="actions top-space update-actions">
|
||||
<form method="post" action="/update/check" id="update-check-form">
|
||||
<button class="primary" id="update-main-button" type="submit">{{ 'Установить обновления' if info.has_update else 'Проверить обновления' }}</button>
|
||||
</form>
|
||||
{% if info.has_update %}
|
||||
<form method="post" action="/update/apply" id="update-apply-form" onsubmit="return confirm('Запустить обновление Virtuality из GitHub? Панель перезапустится.');">
|
||||
<button class="primary" id="update-apply-button" type="submit">Установить обновления</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form method="post" action="/update/check" id="update-check-form">
|
||||
<button class="primary" id="update-main-button" type="submit">Проверить обновления</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="card">
|
||||
<div class="card-head">
|
||||
<h2>Состояние установки</h2>
|
||||
<span id="update-status-badge" class="status {{ 'ok' if info.state.status == 'success' else 'err' if info.state.status == 'error' else 'warn' }}">{{ info.state.status }}</span>
|
||||
</div>
|
||||
<div id="update-message" class="notice">{{ info.state.message }}</div>
|
||||
<div class="meta-grid top-space">
|
||||
<div><span>Started</span><strong id="update-started">{{ info.state.started_at or '—' }}</strong></div>
|
||||
<div><span>Updated</span><strong id="update-updated">{{ info.state.updated_at or '—' }}</strong></div>
|
||||
<div><span>Finished</span><strong id="update-finished">{{ info.state.finished_at or '—' }}</strong></div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<article class="card missed-versions-card">
|
||||
<div class="card-head">
|
||||
<h2>Пропущенные версии и функции</h2>
|
||||
<span class="pill">{{ info.missing_versions|length }} версий</span>
|
||||
</div>
|
||||
<div class="missed-versions-list">
|
||||
{% for release in info.missing_versions %}
|
||||
<div class="release-note">
|
||||
<div class="card-head compact">
|
||||
@@ -105,6 +115,8 @@
|
||||
{% else %}
|
||||
<div class="muted">Нет пропущенных версий. Система на свежем коде.</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="grid two">
|
||||
@@ -132,28 +144,17 @@
|
||||
<pre id="update-log">{{ info.log_tail or 'Лог пока пуст.' }}</pre>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const statusBadge = document.getElementById('update-status-badge');
|
||||
const messageBox = document.getElementById('update-message');
|
||||
const startedBox = document.getElementById('update-started');
|
||||
const updatedBox = document.getElementById('update-updated');
|
||||
const finishedBox = document.getElementById('update-finished');
|
||||
const logBox = document.getElementById('update-log');
|
||||
const logState = document.getElementById('update-log-state');
|
||||
const lastCheckBox = document.getElementById('last-check-value');
|
||||
const checkForm = document.getElementById('update-check-form');
|
||||
const applyForm = document.getElementById('update-apply-form');
|
||||
const mainButton = document.getElementById('update-main-button');
|
||||
const applyButton = document.getElementById('update-apply-button');
|
||||
|
||||
function statusClass(status) {
|
||||
if (status === 'success') return 'status ok';
|
||||
if (status === 'error') return 'status err';
|
||||
return 'status warn';
|
||||
}
|
||||
|
||||
function stageText(state) {
|
||||
const status = state.status || 'idle';
|
||||
const message = state.message || '';
|
||||
@@ -169,12 +170,6 @@
|
||||
const payload = await response.json();
|
||||
if (!payload.ok) return;
|
||||
const state = payload.state || {};
|
||||
statusBadge.textContent = state.status || 'idle';
|
||||
statusBadge.className = statusClass(state.status || 'idle');
|
||||
messageBox.textContent = state.message || 'Готово к проверке обновлений';
|
||||
startedBox.textContent = state.started_at || '—';
|
||||
updatedBox.textContent = state.updated_at || '—';
|
||||
finishedBox.textContent = state.finished_at || '—';
|
||||
logBox.textContent = payload.log_tail || 'Лог пока пуст.';
|
||||
logState.textContent = 'live · ' + (payload.checked_at || 'now');
|
||||
if (applyButton && state.status === 'running') applyButton.textContent = stageText(state);
|
||||
@@ -199,5 +194,6 @@
|
||||
refreshUpdateStatus();
|
||||
setInterval(refreshUpdateStatus, 2000);
|
||||
</script>
|
||||
<script src="/static/panel.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Ссылка в новой задаче
Block a user