Files
mirror/app/templates/restore/index.html
T
2026-06-03 17:33:19 +03:30

60 lines
2.4 KiB
HTML

{% extends "base.html" %}
{% from "macros.html" import guide_box %}
{% block title %}بازگردانی{% endblock %}
{% block content %}
<h2>بازگردانی تنظیمات</h2>
{{ guide_box(guide, 'restore') }}
<div class="row g-3 mb-4">
<div class="col-md-6">
<div class="card border-warning">
<div class="card-body">
<h5>بازگردانی به تنظیمات اولیه</h5>
<p class="small text-muted">وضعیت سیستم قبل از اولین اجرای Mirror Manager</p>
{% if state and state.initial_backup_path %}
<p class="small"><code>{{ state.initial_backup_path }}</code></p>
<form method="post" action="{{ url_for('restore.restore_initial_view') }}" onsubmit="return confirm('مطمئنید؟')">
<button type="submit" class="btn btn-warning">بازگردانی اولیه</button>
</form>
{% else %}
<p class="text-danger">Backup اولیه یافت نشد</p>
{% endif %}
</div>
</div>
</div>
</div>
<h4>Backupهای موجود</h4>
<div class="table-responsive">
<table class="table table-sm">
<thead><tr><th>نام</th><th>برچسب</th><th>عملیات</th></tr></thead>
<tbody>
{% for b in backups %}
<tr>
<td><code class="small">{{ b.name }}</code></td>
<td>{{ b.label }}</td>
<td>
<form method="post" action="{{ url_for('restore.restore_backup_view') }}" class="d-inline" onsubmit="return confirm('این backup restore شود؟')">
<input type="hidden" name="backup_path" value="{{ b.path }}">
<button type="submit" class="btn btn-sm btn-outline-warning">Restore</button>
</form>
</td>
</tr>
{% else %}
<tr><td colspan="3" class="text-muted">backupی وجود ندارد</td></tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="card mt-4 bg-light">
<div class="card-body">
<h6>دستورات SSH</h6>
<pre class="mb-0">python3 mirror-manager restore --initial
python3 mirror-manager restore --backup /path/to/backup
python3 mirror-manager disable
python3 mirror-manager enable</pre>
</div>
</div>
{% endblock %}