Add admin deployment sync
Some checks failed
Build & Push Docker Image / build-and-push (push) Failing after 14s

This commit is contained in:
Tom Misch
2026-05-11 10:39:02 +02:00
parent a59457a8bb
commit 55f201da40
6 changed files with 84 additions and 2 deletions

View File

@@ -172,6 +172,30 @@ $(document).ready(function() {
});
});
// ==================== WEBSITE SYNC ====================
$('#sync-site').click(function() {
if (!confirm('Neueste Version laden und Website neu starten?')) return;
var $button = $(this);
var $status = $('#sync-status');
$button.prop('disabled', true);
$status.text('Sync laeuft...');
$.post('/api/admin/sync')
.done(function(res) {
$status.text(res.message || 'Sync gestartet. Website startet neu...');
window.setTimeout(function() {
window.location.reload();
}, 12000);
})
.fail(function(err) {
var msg = err.responseJSON ? err.responseJSON.error : 'Sync fehlgeschlagen';
$status.text(msg);
$button.prop('disabled', false);
});
});
// ==================== EIGENES PASSWORT ====================
$('#admin-pw-form').submit(function(e) {