Добавлена страница управления ISO
Этот коммит содержится в:
@@ -0,0 +1,87 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="ru">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>ISO — {{ app_name }}</title>
|
||||||
|
<link rel="stylesheet" href="/static/app.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="shell">
|
||||||
|
<header class="topbar">
|
||||||
|
<div>
|
||||||
|
<div class="brand">ISO</div>
|
||||||
|
<div class="muted">Управление образами в /var/lib/virtuality/iso</div>
|
||||||
|
</div>
|
||||||
|
<div class="top-meta">
|
||||||
|
<span>user: {{ user }}</span>
|
||||||
|
<a class="link-pill" href="/">← Дашборд</a>
|
||||||
|
<a class="link-pill accent" href="/vm/create">+ Создать VM</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 two">
|
||||||
|
<article class="card">
|
||||||
|
<div class="card-head">
|
||||||
|
<h2>Загрузить ISO</h2>
|
||||||
|
<span class="pill">upload .iso</span>
|
||||||
|
</div>
|
||||||
|
<form method="post" action="/iso/upload" enctype="multipart/form-data" class="form-grid">
|
||||||
|
<label class="upload-box">
|
||||||
|
<span>Выбери ISO-файл</span>
|
||||||
|
<input type="file" name="iso_file" accept=".iso,application/x-iso9660-image" required>
|
||||||
|
</label>
|
||||||
|
<button type="submit" class="primary wide">Загрузить ISO</button>
|
||||||
|
</form>
|
||||||
|
<p class="muted small-note">Файл попадёт в <b>/var/lib/virtuality/iso</b>, после загрузки будет выполнен refresh pool <b>virtuality-iso</b>.</p>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<article class="card">
|
||||||
|
<div class="card-head">
|
||||||
|
<h2>Действия</h2>
|
||||||
|
<span class="pill">pool</span>
|
||||||
|
</div>
|
||||||
|
<div class="actions big-actions">
|
||||||
|
<form method="post" action="/iso/refresh"><button>Обновить ISO pool</button></form>
|
||||||
|
<a class="link-pill accent" href="/vm/create">Создать VM</a>
|
||||||
|
</div>
|
||||||
|
<pre>sudo virsh pool-refresh virtuality-iso
|
||||||
|
ls -lh /var/lib/virtuality/iso</pre>
|
||||||
|
</article>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<div class="card-head">
|
||||||
|
<h2>ISO-образы</h2>
|
||||||
|
<span class="pill">{{ isos|length }} файлов</span>
|
||||||
|
</div>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr><th>Файл</th><th>Размер</th><th>Обновлён</th><th>Действия</th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for iso in isos %}
|
||||||
|
<tr>
|
||||||
|
<td class="strong">{{ iso.name }}</td>
|
||||||
|
<td>{{ iso.size }}</td>
|
||||||
|
<td>{{ iso.updated }}</td>
|
||||||
|
<td class="actions">
|
||||||
|
<form method="post" action="/iso/{{ iso.name }}/delete" onsubmit="return confirm('Удалить ISO {{ iso.name }}?');">
|
||||||
|
<button class="danger">Удалить</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% else %}
|
||||||
|
<tr><td colspan="4" class="muted">ISO пока нет. Загрузи первый образ через форму выше.</td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Ссылка в новой задаче
Block a user