Improve admin snapshot list/grid views with better UX

- Add prominent view mode switcher with List/Grid toggle buttons
- Improve filter sidebar CSS with modern styling, rounded corners
- Add live progress bar for in-progress snapshots showing hooks status
- Show plugin icons only when output directory has content
- Display archive result output_size sum from new field
- Show hooks succeeded/total count in size column
- Add get_progress_stats() method to Snapshot model
- Add CSS for progress spinner and status badges
- Update grid view template with progress indicator for archiving cards
- Add tests for admin views, search, and progress stats
This commit is contained in:
Claude
2025-12-31 11:28:03 +00:00
parent 7dd2d65770
commit 2e6dcb2b87
6 changed files with 607 additions and 19 deletions

View File

@@ -126,6 +126,21 @@
.cards .card .card-info .timestamp {
font-weight: 600;
}
.cards .card .card-progress {
display: flex;
align-items: center;
gap: 6px;
padding: 4px 0;
}
.cards .card .card-progress .progress-text {
font-size: 11px;
color: #3b82f6;
font-weight: 500;
}
.cards .card.archiving {
border-color: #3b82f6;
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.cards .card .card-footer code {
display: inline-block;
width: 100%;
@@ -145,14 +160,21 @@
{% block content %}
<section class="cards">
{% for obj in results %}
<div class="card">
<div class="card{% if obj.status == 'started' %} archiving{% endif %}">
<div class="card-info">
<a href="{% url 'admin:core_snapshot_change' obj.pk %}">
<span class="timestamp">{{obj.bookmarked_at}}</span>
</a>
<div style="padding: 4px 0;">
{{ obj.icons|safe }}
</div>
{% if obj.status == 'started' %}
<div class="card-progress">
<span class="snapshot-progress-spinner"></span>
<span class="progress-text">Archiving...</span>
</div>
{% else %}
<div style="padding: 4px 0;">
{{ obj.icons|safe }}
</div>
{% endif %}
<label>
<span>🗄&nbsp; {{ obj.archive_size | file_size }}</span>
<input type="checkbox" name="_selected_action" value="{{obj.pk}}"/>