153 lines
7.8 KiB
HTML
153 lines
7.8 KiB
HTML
{# Content-only fragment used inside modal (?frag=1). Forms post to same route with frag=1. #}
|
||
{% set form_extra %}<input type="hidden" name="frag" value="1">{% endset %}
|
||
|
||
<div class="wiz-body">
|
||
{% include 'admin/_flash.html' %}
|
||
|
||
<div class="wiz-steps">
|
||
<div class="wiz-step {% if step >= 1 %}active{% endif %} {% if step > 1 %}done{% endif %}">
|
||
<span class="wiz-num">1</span><span>DNS-записи</span>
|
||
</div>
|
||
<div class="wiz-line"></div>
|
||
<div class="wiz-step {% if step >= 2 %}active{% endif %} {% if step > 2 %}done{% endif %}">
|
||
<span class="wiz-num">2</span><span>Проверка</span>
|
||
</div>
|
||
<div class="wiz-line"></div>
|
||
<div class="wiz-step {% if step >= 3 %}active{% endif %}">
|
||
<span class="wiz-num">3</span><span>DKIM и финал</span>
|
||
</div>
|
||
</div>
|
||
|
||
{% if step == 1 %}
|
||
<h3 class="wiz-title">Шаг 1. DNS-записи для нового домена</h3>
|
||
<form method="post" action="{{ url_for('admin.domain_new') }}" class="wiz-form-row">
|
||
<input type="hidden" name="step" value="1">{{ form_extra|safe }}
|
||
<label>Домен:</label>
|
||
<input class="wiz-input" name="domain" value="{{ domain }}" placeholder="example.com" required>
|
||
<button class="btn btn-primary" type="submit">Показать записи →</button>
|
||
</form>
|
||
|
||
{% if records %}
|
||
<p class="wiz-hint">
|
||
Скопируйте эти записи в панель управления вашего DNS-регистратора.
|
||
После применения DNS обычно нужно подождать 5–30 минут.
|
||
</p>
|
||
<div class="wiz-table-wrap">
|
||
<table class="tbl">
|
||
<thead><tr><th>Тип</th><th>Имя</th><th>Значение</th><th>Назначение</th></tr></thead>
|
||
<tbody>
|
||
{% for r in records %}
|
||
<tr>
|
||
<td><span class="dns-type">{{ r.type }}</span></td>
|
||
<td><code>{{ r.name }}</code></td>
|
||
<td><code class="break-all">{{ r.value }}</code></td>
|
||
<td class="muted">{{ r.hint }}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<div class="wiz-actions">
|
||
<button type="button" class="btn" data-action="modal-close">Отмена</button>
|
||
<span class="spacer"></span>
|
||
<form method="post" action="{{ url_for('admin.domain_new') }}" style="display:inline">
|
||
<input type="hidden" name="step" value="1">
|
||
<input type="hidden" name="domain" value="{{ domain }}">{{ form_extra|safe }}
|
||
<button class="btn btn-primary" type="submit">Далее: проверка →</button>
|
||
</form>
|
||
</div>
|
||
{% endif %}
|
||
|
||
{% elif step == 2 %}
|
||
<h3 class="wiz-title">Шаг 2. Проверка DNS-записей для <code>{{ domain }}</code>
|
||
<a class="wiz-recheck" href="{{ url_for('admin.domain_new', step=2, domain=domain, frag=1) }}">↻ Перепроверить</a>
|
||
</h3>
|
||
<div class="wiz-table-wrap">
|
||
<table class="tbl">
|
||
<thead><tr><th style="width:1%"></th><th>Тип</th><th>Имя</th><th>Текущее значение</th><th>Назначение</th></tr></thead>
|
||
<tbody>
|
||
{% for v in verify %}
|
||
<tr>
|
||
<td>{% if v.ok %}<span class="dns-ok">✓</span>{% else %}<span class="dns-fail">✗</span>{% endif %}</td>
|
||
<td><span class="dns-type">{{ v.type }}</span></td>
|
||
<td><code>{{ v.name }}</code></td>
|
||
<td><code class="break-all small">{{ v.current }}</code></td>
|
||
<td class="muted">{{ v.hint }}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
<p class="wiz-hint">
|
||
Если записи ещё не подтянулись — DNS обновляется не мгновенно (TTL регистратора).
|
||
Подождите и нажмите «Перепроверить». DKIM-запись на этом шаге может быть пустой — она появится после Шага 3.
|
||
</p>
|
||
<div class="wiz-actions">
|
||
<a class="btn" href="{{ url_for('admin.domain_new', step=1, domain=domain, frag=1) }}">← Назад</a>
|
||
<span class="spacer"></span>
|
||
<form method="post" action="{{ url_for('admin.domain_new') }}" style="display:inline">
|
||
<input type="hidden" name="step" value="2"><input type="hidden" name="domain" value="{{ domain }}">{{ form_extra|safe }}
|
||
<button class="btn btn-primary" type="submit">Далее: DKIM →</button>
|
||
</form>
|
||
</div>
|
||
|
||
{% elif step == 3 %}
|
||
<h3 class="wiz-title">Шаг 3. DKIM и завершение</h3>
|
||
{% if not dkim %}
|
||
<p class="wiz-hint">
|
||
DKIM-ключ для <code>{{ domain }}</code> ещё не создан. Сгенерируйте его — после этого скопируйте
|
||
получившуюся TXT-запись в DNS вашего регистратора.
|
||
</p>
|
||
<form method="post" action="{{ url_for('admin.domain_new') }}">
|
||
<input type="hidden" name="step" value="3"><input type="hidden" name="domain" value="{{ domain }}">
|
||
<input type="hidden" name="action" value="dkim">{{ form_extra|safe }}
|
||
<button class="btn btn-primary" type="submit">Сгенерировать DKIM</button>
|
||
</form>
|
||
{% else %}
|
||
<p class="wiz-hint">Добавьте эту TXT-запись в DNS:</p>
|
||
<div class="wiz-table-wrap">
|
||
<table class="tbl">
|
||
<tr>
|
||
<td style="width:80px"><span class="dns-type">TXT</span></td>
|
||
<td style="width:240px"><code>mail._domainkey.{{ domain }}</code></td>
|
||
<td><code class="break-all small">{{ dkim }}</code></td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
<p class="wiz-hint">После применения DNS нажмите «Готово».</p>
|
||
{% endif %}
|
||
<div class="wiz-section">
|
||
<h4 class="wiz-subtitle">Первый ящик в домене</h4>
|
||
<p class="wiz-hint">
|
||
Домен «оживёт» в системе только после создания первого ящика. Обычно это <code>postmaster@{{ domain }}</code> или <code>admin@{{ domain }}</code>.
|
||
</p>
|
||
{% if domain_mailboxes %}
|
||
<div class="wiz-mb-list">
|
||
{% for mb in domain_mailboxes %}
|
||
<div class="wiz-mb-item">✓ {{ mb.email }}</div>
|
||
{% endfor %}
|
||
</div>
|
||
{% else %}
|
||
<form method="post" action="{{ url_for('admin.domain_new') }}" class="wiz-form-row">
|
||
<input type="hidden" name="step" value="3"><input type="hidden" name="domain" value="{{ domain }}">
|
||
<input type="hidden" name="action" value="create_mailbox">{{ form_extra|safe }}
|
||
<input class="wiz-input" name="local" value="postmaster" required style="max-width:160px">
|
||
<span style="color:var(--color-text-tertiary)">@{{ domain }}</span>
|
||
<input class="wiz-input" name="password" type="password" placeholder="пароль (≥6)" required style="max-width:200px">
|
||
<button class="btn btn-primary" type="submit">Создать ящик</button>
|
||
</form>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<div class="wiz-actions">
|
||
<a class="btn" href="{{ url_for('admin.domain_new', step=2, domain=domain, frag=1) }}">← Назад</a>
|
||
<span class="spacer"></span>
|
||
<form method="post" action="{{ url_for('admin.domain_new') }}" style="display:inline">
|
||
<input type="hidden" name="step" value="3"><input type="hidden" name="domain" value="{{ domain }}">
|
||
<input type="hidden" name="action" value="finish">{{ form_extra|safe }}
|
||
<button class="btn btn-primary" type="submit" {% if not domain_mailboxes %}disabled title="Создайте хотя бы один ящик"{% endif %}>Готово</button>
|
||
</form>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|