feat(ota): add 1-click update UI & API with changelog display

This commit is contained in:
sorcier committed 2026-11-04 01:20:38 +01:00
1 parent 2376e7eebb
commit 5d60e66518
3 files changed
+230 -1

No files matched your search

+42 -1
View File
@@ -207,7 +207,7 @@ $currentUser = Auth::getUsername();
<div class="font-black text-white text-2xl tracking-tight leading-none">
Nexus<span class="text-indigo-400">PBX</span>
</div>
<span class="px-1.5 py-0.5 text-[10px] font-mono font-bold tracking-wider rounded bg-indigo-500/20 text-indigo-300 border border-indigo-500/30">v1.2.0</span>
<span id="app-version-badge" class="px-1.5 py-0.5 text-[10px] font-mono font-bold tracking-wider rounded bg-indigo-500/20 text-indigo-300 border border-indigo-500/30">v1.3.0</span>
</div>
<div class="text-[10px] text-slate-400 font-medium tracking-wide mt-0.5">Moteur VoIP & Téléphonie IP</div>
</div>
@@ -1560,6 +1560,47 @@ $currentUser = Auth::getUsername();
</div>
</div>
<!-- Mises à Jour du Système NexusPBX (OTA) -->
<div class="bg-gradient-to-r from-anthracite-800 to-indigo-950/40 border border-indigo-500/30 rounded-2xl p-6 shadow-xl space-y-4">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4 pb-4 border-b border-anthracite-700/80">
<div>
<div class="flex items-center gap-2.5">
<span class="flex h-3 w-3 relative">
<span id="update-ping" class="hidden animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span id="update-dot" class="relative inline-flex rounded-full h-3 w-3 bg-emerald-500"></span>
</span>
<h3 class="text-base font-bold text-white">Mises à Jour du Système NexusPBX</h3>
<span id="system-version-tag" class="px-2 py-0.5 text-xs font-mono font-bold rounded-lg bg-indigo-500/20 text-indigo-300 border border-indigo-500/30">v1.3.0</span>
</div>
<p class="text-xs text-slate-300 mt-1">Vérifiez les nouvelles versions officielles et mettez à jour votre PBX en 1 clic sans coupure de service.</p>
</div>
<div class="flex items-center gap-2">
<button type="button" onclick="checkSystemUpdate(true)" id="btn-check-update"
class="inline-flex items-center gap-2 px-3.5 py-2 rounded-xl text-xs font-semibold bg-anthracite-900 hover:bg-anthracite-750 text-slate-200 border border-anthracite-700 transition">
<svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/></svg>
<span>Vérifier les mises à jour</span>
</button>
<button type="button" onclick="runSystemUpdate()" id="btn-run-update" style="display:none;"
class="inline-flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-600/30 transition animate-pulse">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/></svg>
<span>Mettre à jour maintenant (1-Clic)</span>
</button>
</div>
</div>
<!-- État & Changelog -->
<div id="update-status-box" class="p-4 rounded-xl bg-anthracite-950/80 border border-anthracite-700 text-xs space-y-2">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-1 text-slate-300">
<span>Statut : <strong id="update-status-text" class="text-emerald-400">Votre PBX est à jour avec la dernière version officielle.</strong></span>
<span id="update-last-checked" class="text-[11px] text-slate-500 font-mono">Dernière vérification : À l'instant</span>
</div>
<div id="update-changelog-container" class="hidden pt-2 border-t border-anthracite-800 space-y-1.5">
<span class="font-bold text-white text-[11px] uppercase tracking-wider block">Nouveautés de la version :</span>
<ul id="update-changelog-list" class="list-disc list-inside text-slate-300 space-y-1 text-[11px]"></ul>
</div>
</div>
</div>
<!-- Prévisualisation en direct des fichiers natifs Asterisk -->
<div class="grid grid-cols-1 xl:grid-cols-2 gap-6">
<div class="bg-anthracite-800 border border-anthracite-700 rounded-2xl overflow-hidden shadow-lg">