- Accessibility: dark ink (#00003d) on warning/success buttons, badges, and success alert - white text on #ff9500/#0ad64f failed WCAG AA (~2:1); dark-on-bright now passes. - Heading hierarchy: sidebar brand h1 -> div.brand-title (with matching CSS selector), and standardized all page-header titles to a single <h1> per page (8 templates were h2). - Prefix-safe modal JS: dashboard/backups/reports/enrollment delete+clone actions now build their form action from url_for(...'__K__'/'__F__').replace(...) instead of hardcoded paths, so they survive a URL-prefix mount.
141 lines
5.3 KiB
HTML
141 lines
5.3 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Clonezilla Backups - PXE Server Manager{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="page-header">
|
|
<h1>Clonezilla Backups</h1>
|
|
<div class="header-actions">
|
|
<button class="pxe-btn pxe-btn-primary" data-bs-toggle="modal" data-bs-target="#uploadModal">
|
|
<i class="bi bi-upload"></i> Upload Backup
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-header d-flex align-items-center">
|
|
<i class="bi bi-hdd-stack me-2"></i>
|
|
Machine Backups
|
|
<span class="badge badge-secondary ms-2">{{ backups|length }}</span>
|
|
</div>
|
|
<div class="card-body p-0">
|
|
{% if backups %}
|
|
<div class="table-container">
|
|
<table class="data-table mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>Machine #</th>
|
|
<th>Filename</th>
|
|
<th>Size</th>
|
|
<th>Last Modified</th>
|
|
<th class="text-end">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for b in backups %}
|
|
<tr>
|
|
<td><strong>{{ b.machine }}</strong></td>
|
|
<td><span class="mono">{{ b.filename }}</span></td>
|
|
<td>{{ "%.1f"|format(b.size / 1073741824) }} GB</td>
|
|
<td>{{ b.modified | timestamp_fmt }}</td>
|
|
<td class="actions text-end text-nowrap">
|
|
<a href="{{ url_for('clonezilla_download', filename=b.filename) }}"
|
|
class="pxe-btn pxe-btn-secondary btn-row-action" title="Download">
|
|
<i class="bi bi-download"></i> Download
|
|
</a>
|
|
<button type="button" class="pxe-btn pxe-btn-danger btn-row-action"
|
|
data-bs-toggle="modal" data-bs-target="#deleteModal"
|
|
data-filename="{{ b.filename }}" data-machine="{{ b.machine }}" title="Delete">
|
|
<i class="bi bi-trash"></i> Delete
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="text-center text-muted py-5">
|
|
<i class="bi bi-hdd-stack" style="font-size: 2rem; opacity: 0.4;"></i>
|
|
<p class="mt-2 mb-0">No backups found. Upload a Clonezilla backup .zip to get started.</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="section-card mt-3">
|
|
<div class="section-title">Backup Naming Convention</div>
|
|
<p class="mb-0">
|
|
Name backup files with the machine number (e.g., <span class="mono">6501.zip</span>).
|
|
The Samba share <span class="mono">\\pxe-server\clonezilla</span> is also available on the network for direct Clonezilla save/restore operations.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Upload Modal -->
|
|
<div class="modal fade" id="uploadModal" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<form action="{{ url_for('clonezilla_upload') }}" method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Upload Backup</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="form-field mb-0">
|
|
<label for="backupFile" class="form-label">Backup File (.zip)</label>
|
|
<input type="file" class="form-control" id="backupFile" name="backup_file"
|
|
accept=".zip" required>
|
|
<div class="form-text">
|
|
Name the file with the machine number (e.g., <span class="mono">6501.zip</span>).
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="pxe-btn pxe-btn-ghost" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="pxe-btn pxe-btn-primary">
|
|
<i class="bi bi-upload"></i> Upload
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Delete Confirmation Modal -->
|
|
<div class="modal fade" id="deleteModal" tabindex="-1">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<form id="deleteForm" method="post">
|
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title">Confirm Delete</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p>Are you sure you want to delete the backup for machine <strong id="deleteMachine"></strong>?</p>
|
|
<p class="text-muted mb-0">This action cannot be undone.</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="pxe-btn pxe-btn-ghost" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="pxe-btn pxe-btn-danger">
|
|
<i class="bi bi-trash"></i> Delete
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block extra_scripts %}
|
|
<script>
|
|
document.getElementById('deleteModal').addEventListener('show.bs.modal', function (event) {
|
|
var btn = event.relatedTarget;
|
|
var filename = btn.getAttribute('data-filename');
|
|
var machine = btn.getAttribute('data-machine');
|
|
document.getElementById('deleteMachine').textContent = machine;
|
|
document.getElementById('deleteForm').action = "{{ url_for('clonezilla_delete', filename='__F__') }}".replace('__F__', encodeURIComponent(filename));
|
|
});
|
|
</script>
|
|
{% endblock %}
|