63d0699cdd
Remove invalid _mirror_manager from daemon.json that prevented Docker from starting. Add 2-minute test apply with auto-rollback, final apply confirmation, emergency-restore CLI/UI, and post-restart Docker health checks. Co-authored-by: Cursor <cursoragent@cursor.com>
77 lines
3.5 KiB
HTML
77 lines
3.5 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-danger">
|
|
|
|
<div class="card-body">
|
|
|
|
<h5>بازگردانی فوری (Emergency)</h5>
|
|
|
|
<p class="small text-muted">برگشت به آخرین backup قبل از apply — یک کلیک، بدون انتخاب مسیر</p>
|
|
|
|
{% if latest_apply_backup %}
|
|
|
|
<p class="small"><code>{{ latest_apply_backup }}</code></p>
|
|
|
|
<form method="post" action="{{ url_for('restore.emergency_restore_view') }}" onsubmit="return confirm('تنظیمات به آخرین وضعیت قبل از apply برگردد؟ Docker restart میشود.')">
|
|
|
|
<button type="submit" class="btn btn-danger">بازگردانی فوری</button>
|
|
|
|
</form>
|
|
|
|
{% else %}
|
|
|
|
<p class="text-muted">backup قبل از apply یافت نشد</p>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<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">mirror-manager emergency-restore
|
|
|
|
mirror-manager restore --initial
|
|
|
|
mirror-manager restore --last
|
|
|
|
mirror-manager disable
|
|
|
|
mirror-manager enable</pre>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|