Update: version 1.2.0, new version UI features, CSP hash auto-update, bug fixes

This commit is contained in:
Krystie
2026-05-14 21:04:35 -07:00
parent a216dd882d
commit 947007438f
12 changed files with 385 additions and 44 deletions
+7 -2
View File
@@ -396,7 +396,7 @@
}
async function dcApplyUpdate() {
if (!confirm('Apply DashCaddy update? The API container will restart.')) return;
if (!confirm('Apply DashCaddy update? The API container will restart.')) return false;
dcApplyBtn.textContent = 'Updating...';
dcApplyBtn.disabled = true;
dcShowStatus('Downloading and applying update...', 'info');
@@ -408,6 +408,7 @@
dcApplyBtn.textContent = 'Applied!';
// Remove notification dots
document.querySelectorAll('.update-dot').forEach(d => d.remove());
return true;
} else {
throw new Error(data.error || 'Update failed');
}
@@ -415,6 +416,7 @@
dcShowStatus('Update failed: ' + e.message, 'error');
dcApplyBtn.textContent = 'Update Now';
dcApplyBtn.disabled = false;
throw e;
}
}
@@ -486,7 +488,7 @@
}
dcCheckBtn?.addEventListener('click', () => dcCheckForUpdate(false));
dcApplyBtn?.addEventListener('click', dcApplyUpdate);
dcApplyBtn?.addEventListener('click', () => dcApplyUpdate().catch(() => {}));
dcRollbackBtn?.addEventListener('click', dcShowRollback);
checkBtn?.addEventListener('click', checkForUpdates);
@@ -505,6 +507,9 @@
if (!dcLastCheck) dcCheckForUpdate(true);
});
window.dcApplyUpdate = dcApplyUpdate;
window.dcCheckForUpdate = dcCheckForUpdate;
// Non-blocking check on page load — just adds notification dot if update available
setTimeout(() => dcCheckForUpdate(true), 5000);
})();