Этот коммит содержится в:
Виктор
2026-05-06 19:52:10 +09:00
родитель 10effd895b
Коммит 492dd7eec6
+95
Просмотреть файл
@@ -0,0 +1,95 @@
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Создать VM — {{ app_name }}</title>
<link rel="stylesheet" href="/static/app.css">
</head>
<body>
<div class="shell">
<header class="topbar">
<div>
<div class="brand">Создать VM</div>
<div class="muted">Новая виртуальная машина через libvirt / virt-install</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 two">
<article class="card">
<div class="card-head">
<h2>Параметры</h2>
<span class="pill">VM wizard v0.1</span>
</div>
<form method="post" action="/vm/create" class="form-grid">
<label>
<span>Имя VM</span>
<input type="text" name="name" value="{{ form.name or '' }}" placeholder="ubuntu-test" required>
</label>
<div class="form-row">
<label>
<span>RAM, MB</span>
<input type="number" name="memory" min="512" max="262144" step="512" value="{{ form.memory }}" required>
</label>
<label>
<span>CPU</span>
<input type="number" name="vcpus" min="1" max="128" value="{{ form.vcpus }}" required>
</label>
</div>
<label>
<span>Диск, GB</span>
<input type="number" name="disk_size" min="4" max="4096" value="{{ form.disk_size }}" required>
</label>
<label>
<span>ISO образ</span>
<select name="iso_path" required>
{% for iso in isos %}
<option value="{{ iso.path }}" {% if form.iso_path == iso.path %}selected{% endif %}>{{ iso.name }} — {{ iso.size }}</option>
{% endfor %}
</select>
</label>
<label>
<span>Bridge</span>
<input type="text" name="bridge" value="{{ form.bridge }}" required>
</label>
<button type="submit" class="primary wide">Создать виртуальную машину</button>
</form>
</article>
<article class="card">
<div class="card-head">
<h2>ISO в хранилище</h2>
<span class="pill">/var/lib/virtuality/iso</span>
</div>
<div class="services">
{% for iso in isos %}
<div class="service-row">
<span>{{ iso.name }}</span>
<span class="status ok">{{ iso.size }}</span>
</div>
{% else %}
<div class="muted">ISO пока нет. Загрузи .iso в /var/lib/virtuality/iso</div>
{% endfor %}
</div>
<pre>sudo cp image.iso /var/lib/virtuality/iso/
sudo virsh pool-refresh virtuality-iso</pre>
</article>
</section>
</div>
</body>
</html>