feat: auto-install silencieux des mises à jour (téléchargement + relance auto)
This commit is contained in:
@@ -2002,6 +2002,35 @@
|
||||
})();
|
||||
|
||||
})();
|
||||
|
||||
// ---------- Progression de mise à jour ----------
|
||||
if (window.api && window.api.onUpdateProgress) {
|
||||
const overlay = document.createElement('div');
|
||||
overlay.id = 'updateOverlay';
|
||||
overlay.style.cssText = 'position:fixed;inset:0;background:rgba(11,15,12,0.94);z-index:9999;display:none;align-items:center;justify-content:center;flex-direction:column;gap:18px;';
|
||||
overlay.innerHTML =
|
||||
'<div style="font-family:var(--font-mono);color:var(--text);font-size:14px;letter-spacing:.04em;" id="updateOverlayText">Téléchargement de la mise à jour…</div>' +
|
||||
'<div style="width:320px;height:5px;background:var(--bg-panel-2);border:1px solid var(--border);">' +
|
||||
'<div id="updateProgressBar" style="height:100%;background:var(--corrupt);width:0%;transition:width .25s;"></div>' +
|
||||
'</div>' +
|
||||
'<div style="font-family:var(--font-mono);color:var(--text-dim);font-size:12px;" id="updateOverlayPct">0%</div>';
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
window.api.onUpdateProgress(({ percent, status, error }) => {
|
||||
const bar = document.getElementById('updateProgressBar');
|
||||
const pct = document.getElementById('updateOverlayPct');
|
||||
const txt = document.getElementById('updateOverlayText');
|
||||
if (status === 'error') {
|
||||
overlay.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
overlay.style.display = 'flex';
|
||||
bar.style.width = percent + '%';
|
||||
pct.textContent = percent + '%';
|
||||
txt.textContent = status === 'installing' ? 'Installation… l\'application va redémarrer.' : 'Téléchargement de la mise à jour…';
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user