Add admin database backup export and import
This commit is contained in:
@@ -30,7 +30,30 @@
|
||||
<div class="flash">Ссылка удалена</div>
|
||||
{% elif flash == "toggled" %}
|
||||
<div class="flash">Статус ссылки обновлён</div>
|
||||
{% elif flash == "imported" %}
|
||||
<div class="flash">База восстановлена из бэкапа</div>
|
||||
{% endif %}
|
||||
{% if flash_error %}
|
||||
<div class="alert-error">Импорт не удался: {{ flash_error }}</div>
|
||||
{% endif %}
|
||||
|
||||
<section class="backup-box">
|
||||
<h2 style="font-family:var(--font-display);font-size:1.15rem;margin:0 0 0.5rem;">Бэкап базы</h2>
|
||||
<p class="muted" style="margin:0 0 1rem;font-size:0.9rem;">
|
||||
Экспорт / импорт всех ссылок, активаций и временного трафика (JSON).
|
||||
Импорт <strong>полностью заменяет</strong> текущие данные.
|
||||
</p>
|
||||
<div class="row-actions">
|
||||
<a class="btn btn-signal" href="/admin/backup/export">Скачать бэкап</a>
|
||||
</div>
|
||||
<form class="backup-import" method="post" action="/admin/backup/import" enctype="multipart/form-data" onsubmit="return confirm('Импорт заменит ВСЕ текущие ссылки и историю. Продолжить?')">
|
||||
<label>
|
||||
Восстановить из файла
|
||||
<input type="file" name="file" accept=".json,application/json" required />
|
||||
</label>
|
||||
<button class="btn btn-ghost" type="submit">Импортировать</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<h2 style="font-family:var(--font-display);font-size:1.25rem;margin:0 0 1rem;">Создать ссылку</h2>
|
||||
<form class="form-grid" method="post" action="/admin/links">
|
||||
|
||||
Reference in New Issue
Block a user