feat(ui): refresh auth, entry, admin, and secondary pages
Apply the new design-system primitives across the remaining pages so the whole app shares one visual language: - Auth/entry: redesigned index, login, register (centered card layout, SVG icons, semantic tokens) - Admin: sidebar nav with icons, cohesive admin dashboard/users/library/ processing-issues/settings (tables use border-line + hover states; scan/websocket attributes preserved) - Secondary: analytics (stat cards), devices, progress, conflicts, queue, profile + form/modal all migrated to .card/.btn/.input primitives and SVG action icons - Docs + API explorer + setup wizard + collection/rules/modals + unlinked books + book-detail modals: consistent chrome, modal scrims use --surface-overlay, close buttons use icon-btn - reader.templ and error.templ intentionally left unchanged
This commit is contained in:
+49
-47
@@ -18,49 +18,48 @@ templ Queue(user User, queueItems []handlers.QueueItemResponse, stats handlers.Q
|
||||
<div class="mb-8">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<h1 class="text-3xl font-bold" style="color: var(--text-primary)">Sync Queue</h1>
|
||||
<p style="color: var(--text-secondary)">Monitor and manage offline sync queue</p>
|
||||
<h1 class="text-2xl font-bold tracking-tight text-content">Sync Queue</h1>
|
||||
<p class="text-content-muted">Monitor and manage offline sync queue</p>
|
||||
</div>
|
||||
<div class="flex space-x-3">
|
||||
<button @click="processPendingItems()" class="btn-primary px-4 py-2 rounded-lg">
|
||||
<button @click="processPendingItems()" class="btn btn-primary">
|
||||
Process Queue
|
||||
</button>
|
||||
<button @click="clearFailedItems()" class="btn-secondary px-4 py-2 rounded-lg">
|
||||
<button @click="clearFailedItems()" class="btn btn-secondary">
|
||||
Clear Failed
|
||||
</button>
|
||||
<button @click="clearAllItems()" class="btn-danger px-4 py-2 rounded-lg">
|
||||
<button @click="clearAllItems()" class="btn btn-danger">
|
||||
Clear All
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="stats-bar" class="mt-4 grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<div class="card p-4 rounded-lg border text-center" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div class="text-3xl font-bold" style="color: #f59e0b;">{ stats.PendingCount }</div>
|
||||
<div class="text-sm" style="color: var(--text-secondary);">Pending</div>
|
||||
<div class="card p-5 text-center">
|
||||
<div class="text-2xl font-bold text-warning">{ stats.PendingCount }</div>
|
||||
<div class="text-xs font-semibold uppercase tracking-wide text-content-muted">Pending</div>
|
||||
</div>
|
||||
<div class="card p-4 rounded-lg border text-center" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div class="text-3xl font-bold" style="color: #3b82f6;">{ stats.ProcessingCount }</div>
|
||||
<div class="text-sm" style="color: var(--text-secondary);">Processing</div>
|
||||
<div class="card p-5 text-center">
|
||||
<div class="text-2xl font-bold text-info">{ stats.ProcessingCount }</div>
|
||||
<div class="text-xs font-semibold uppercase tracking-wide text-content-muted">Processing</div>
|
||||
</div>
|
||||
<div class="card p-4 rounded-lg border text-center" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div class="text-3xl font-bold" style="color: #10b981;">{ stats.CompletedCount }</div>
|
||||
<div class="text-sm" style="color: var(--text-secondary);">Completed</div>
|
||||
<div class="card p-5 text-center">
|
||||
<div class="text-2xl font-bold text-success">{ stats.CompletedCount }</div>
|
||||
<div class="text-xs font-semibold uppercase tracking-wide text-content-muted">Completed</div>
|
||||
</div>
|
||||
<div class="card p-4 rounded-lg border text-center" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div class="text-3xl font-bold" style="color: #ef4444;">{ stats.FailedCount }</div>
|
||||
<div class="text-sm" style="color: var(--text-secondary);">Failed</div>
|
||||
<div class="card p-5 text-center">
|
||||
<div class="text-2xl font-bold text-danger">{ stats.FailedCount }</div>
|
||||
<div class="text-xs font-semibold uppercase tracking-wide text-content-muted">Failed</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card p-4 rounded-lg border mb-6" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div class="card p-4 mb-6">
|
||||
<div class="flex flex-wrap gap-4 items-center">
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Status Filter</label>
|
||||
<label class="mb-1.5 block text-xs font-semibold uppercase tracking-wide text-content-muted">Status Filter</label>
|
||||
<select
|
||||
id="status-filter"
|
||||
onchange="filterQueue()"
|
||||
class="px-4 py-2 border rounded-lg"
|
||||
style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
|
||||
class="input w-auto"
|
||||
>
|
||||
<option value="all">All Items</option>
|
||||
<option value="pending" selected>Pending</option>
|
||||
@@ -70,12 +69,11 @@ templ Queue(user User, queueItems []handlers.QueueItemResponse, stats handlers.Q
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Sync Type</label>
|
||||
<label class="mb-1.5 block text-xs font-semibold uppercase tracking-wide text-content-muted">Sync Type</label>
|
||||
<select
|
||||
id="type-filter"
|
||||
onchange="filterQueue()"
|
||||
class="px-4 py-2 border rounded-lg"
|
||||
style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
|
||||
class="input w-auto"
|
||||
>
|
||||
<option value="all">All Types</option>
|
||||
<option value="progress">Progress</option>
|
||||
@@ -85,78 +83,82 @@ templ Queue(user User, queueItems []handlers.QueueItemResponse, stats handlers.Q
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Device</label>
|
||||
<label class="mb-1.5 block text-xs font-semibold uppercase tracking-wide text-content-muted">Device</label>
|
||||
<select
|
||||
id="device-filter"
|
||||
onchange="filterQueue()"
|
||||
class="px-4 py-2 border rounded-lg"
|
||||
style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
|
||||
class="input w-auto"
|
||||
>
|
||||
<option value="all">All Devices</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="flex-1"></div>
|
||||
<button @click="refreshQueue()" class="btn-secondary px-4 py-2 rounded-lg">
|
||||
<button @click="refreshQueue()" class="btn btn-secondary">
|
||||
@Icon("refresh", "h-4 w-4")
|
||||
Refresh
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="loading" class="hidden text-center py-16" style="color: var(--text-secondary)">
|
||||
<div id="loading" class="hidden text-center py-16 text-content-muted">
|
||||
<div class="loading-spinner mx-auto mb-4"></div>
|
||||
<p>Loading queue...</p>
|
||||
</div>
|
||||
<div id="empty-state" class="hidden text-center py-16" style="color: var(--text-secondary)">
|
||||
<div class="text-6xl mb-4">📭</div>
|
||||
<h3 class="text-xl font-semibold mb-2" style="color: var(--text-primary)">Queue Empty</h3>
|
||||
<div id="empty-state" class="hidden text-center py-16 text-content-muted">
|
||||
<div class="mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-brand/15 text-brand">
|
||||
@Icon("sync", "h-7 w-7")
|
||||
</div>
|
||||
<h3 class="text-xl font-semibold mb-2 text-content">Queue Empty</h3>
|
||||
<p>No items in the sync queue</p>
|
||||
</div>
|
||||
<div id="queue-list" class="space-y-3">
|
||||
if len(queueItems) == 0 {
|
||||
<div class="text-center py-16" style="color: var(--text-secondary)">
|
||||
<div class="text-6xl mb-4">📭</div>
|
||||
<h3 class="text-xl font-semibold mb-2" style="color: var(--text-primary)">Queue Empty</h3>
|
||||
<div class="text-center py-16 text-content-muted">
|
||||
<div class="mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-brand/15 text-brand">
|
||||
@Icon("sync", "h-7 w-7")
|
||||
</div>
|
||||
<h3 class="text-xl font-semibold mb-2 text-content">Queue Empty</h3>
|
||||
<p>No items in the sync queue</p>
|
||||
</div>
|
||||
}
|
||||
for _, item := range queueItems {
|
||||
<div class="card p-4 rounded-lg border" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div class="card p-4">
|
||||
<div class="flex justify-between items-start mb-2">
|
||||
<div class="flex items-center space-x-3">
|
||||
<span class="inline-block px-2 py-0.5 rounded text-[11px] font-semibold uppercase status-{ item.Status }">{ item.Status }</span>
|
||||
<span class="text-sm" style="color: var(--text-secondary)">{ item.SyncType }</span>
|
||||
<span class="text-sm text-content-muted">{ item.SyncType }</span>
|
||||
</div>
|
||||
<span class="inline-block px-2 py-0.5 rounded text-[10px] font-semibold priority-{ item.Priority }">P{ item.Priority }</span>
|
||||
</div>
|
||||
<div class="text-sm mb-2" style="color: var(--text-secondary)">
|
||||
<div class="text-sm mb-2 text-content-muted">
|
||||
Device ID: { item.DeviceID }
|
||||
if item.MediaTitle != nil {
|
||||
| Book: { *item.MediaTitle }
|
||||
}
|
||||
</div>
|
||||
<div class="flex justify-between items-center text-sm" style="color: var(--text-secondary)">
|
||||
<div class="flex justify-between items-center text-sm text-content-muted">
|
||||
<span>Attempts: { item.Attempts }/{ item.MaxAttempts }</span>
|
||||
<span>{ item.CreatedAt }</span>
|
||||
</div>
|
||||
if item.ErrorMessage != nil {
|
||||
<div class="mt-2 text-sm" style="color: #ef4444;">
|
||||
<div class="mt-2 text-sm text-danger">
|
||||
Error: { *item.ErrorMessage }
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div id="queue-item-modal" class="hidden fixed inset-0 z-50 flex items-center justify-center overflow-y-auto" style="background-color: rgba(0, 0, 0, 0.7);">
|
||||
<div class="card rounded-lg p-6 w-full max-w-2xl mx-4 my-8" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div id="queue-item-modal" class="hidden fixed inset-0 z-50 flex items-center justify-center overflow-y-auto" style="background-color: var(--surface-overlay);">
|
||||
<div class="card p-6 w-full max-w-2xl mx-4 my-8">
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-2xl font-bold" style="color: var(--text-primary)">Queue Item Details</h2>
|
||||
<button @click="hideQueueItemModal()" class="p-2 hover:opacity-80 rounded-lg" style="color: var(--text-primary); background-color: var(--bg-primary);">
|
||||
X
|
||||
<h2 class="text-2xl font-bold tracking-tight text-content">Queue Item Details</h2>
|
||||
<button @click="hideQueueItemModal()" class="icon-btn" aria-label="Close">
|
||||
@Icon("close", "h-5 w-5")
|
||||
</button>
|
||||
</div>
|
||||
<div id="queue-item-details"></div>
|
||||
<div class="flex justify-end space-x-3 mt-6">
|
||||
<button @click="hideQueueItemModal()" class="btn-secondary px-4 py-2 rounded-lg">Close</button>
|
||||
<button @click="retryQueueItem()" class="btn-primary px-4 py-2 rounded-lg">Retry</button>
|
||||
<button @click="hideQueueItemModal()" class="btn btn-secondary">Close</button>
|
||||
<button @click="retryQueueItem()" class="btn btn-primary">Retry</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user