feat: sync DB prefs, update history tab, configurable dashboard shortcuts

- auth store fetchMe(): sync theme/sidebar_position/lang from DB to localStorage+stores on login/refresh
- profilePage setters: PATCH /api/auth/preferences on every preference change
- updatesPage: add history tab (GET /api/updates/history) with job list, click to view output
- dashboardPage: load shortcuts from settings API, fall back to defaults if none configured
- settingsPage: new Raccourcis tab to add/remove/configure dashboard shortcuts (saved as JSON)
- settings.go: expose dashboard_shortcuts in publicSettings for GET/PUT access
- pages.css: add .history-table, .shortcut-row styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
enzo 2026-03-22 00:35:24 +01:00
parent 780e5ec81d
commit 21e1e0ed1e
6 changed files with 230 additions and 10 deletions

View file

@ -55,6 +55,17 @@
<main id="swup" class="page-content transition-fade">
<div x-data="updatesPage()" x-cloak>
<!-- Tabs -->
<div class="tabs">
<button class="tab-btn" :class="{ active: activeTab === 'targets' }" @click="activeTab = 'targets'">Cibles</button>
<button class="tab-btn" :class="{ active: activeTab === 'history' }" @click="activeTab = 'history'; loadHistory()">
<i class="lnid-clock-1"></i> Historique
</button>
</div>
<!-- Tab: Cibles -->
<div x-show="activeTab === 'targets'">
<!-- Actions globales -->
<div class="page-actions">
<div class="page-actions-left">
@ -150,6 +161,38 @@
</div>
<pre class="output-content" x-text="output" x-ref="output"></pre>
</div>
</div><!-- /tab targets -->
<!-- Tab: Historique -->
<div x-show="activeTab === 'history'">
<div class="loading-state" x-show="historyLoading">
<div class="spinner-lg"></div>
<span>Chargement…</span>
</div>
<div x-show="!historyLoading">
<p class="empty-state" x-show="history.length === 0">Aucune mise à jour effectuée</p>
<div class="history-table" x-show="history.length > 0">
<div class="history-header">
<span>Job</span>
<span>Cible</span>
<span>Statut</span>
<span>Date</span>
<span>Durée</span>
</div>
<template x-for="h in history" :key="h.job_id">
<div class="history-row" @click="output = h.output; currentJob = h.job_id; jobStatus = h.status; activeTab = 'targets'">
<span class="history-job" x-text="h.job_id.slice(0,8)"></span>
<span class="history-target" x-text="h.target"></span>
<span class="history-status badge" :class="h.status" x-text="h.status"></span>
<span class="history-date" x-text="formatDate(h.started_at)"></span>
<span class="history-dur" x-text="h.finished_at ? '' : '—'"></span>
</div>
</template>
</div>
</div>
</div><!-- /tab history -->
</div>
</main>
</div>