Files
virtuality/web/templates/vm_create.html
T

114 строки
4.6 KiB
HTML

<!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="/network">Сеть</a>
<a class="link-pill" href="/operations">Операции</a>
<a class="link-pill" href="/iso">ISO</a>
<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.3</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>Режим сети</span>
<select name="network_mode" required>
<option value="nat" {% if form.network_mode != 'bridge' %}selected{% endif %}>VPS NAT Router — virtuality-nat</option>
<option value="bridge" {% if form.network_mode == 'bridge' %}selected{% endif %}>Bridge — br0 / локальная сеть</option>
</select>
</label>
<label>
<span>Bridge для режима Bridge</span>
<input type="text" name="bridge" value="{{ form.bridge }}" placeholder="br0">
</label>
<div class="notice">
Для VPS выбирай NAT Router: VM получит внутренний адрес 192.168.100.x, а доступ снаружи делается через проброс портов в разделе «Сеть».
</div>
<button type="submit" class="primary wide" {% if not isos %}disabled{% endif %}>Создать виртуальную машину</button>
{% if not isos %}
<div class="alert danger">Сначала загрузи ISO-образ в ISO-менеджере.</div>
{% endif %}
</form>
</article>
<article class="card">
<div class="card-head">
<h2>Сетевые режимы</h2>
<a class="link-pill" href="/network">Открыть сеть</a>
</div>
<div class="quick-actions">
<div class="big-action static">
<strong>VPS NAT Router</strong>
<span>Правильный режим для VPS с одним внешним IP. VM сидят за NAT, входящие порты пробрасываются вручную.</span>
</div>
<div class="big-action static">
<strong>Bridge br0</strong>
<span>Режим для домашнего или офисного сервера, где VM могут получать IP из локальной сети.</span>
</div>
</div>
<pre>VPS: --network network=virtuality-nat,model=virtio
LAN: --network bridge=br0,model=virtio</pre>
</article>
</section>
</div>
</body>
</html>