Fix alert notifications: single instance, inline padding/sizing

Remove previous alert before showing new one to prevent stacking.
Add inline padding, border-radius, and font-size since WHM CSS
overrides DaisyUI alert defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shuki
2026-03-04 03:16:05 +02:00
parent 8f36cf94fc
commit 632309db0f
2 changed files with 8 additions and 2 deletions

View File

@@ -712,10 +712,13 @@ function gnizaTestConnection() {
}
function gnizaToast(type, msg) {
var prev = document.getElementById('gniza-alert');
if (prev) prev.remove();
var el = document.createElement('div');
el.id = 'gniza-alert';
el.className = 'alert alert-' + type;
el.textContent = msg;
el.style.cssText = 'position:fixed;top:24px;right:24px;z-index:9999;max-width:480px;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:opacity .3s';
el.style.cssText = 'position:fixed;top:24px;right:24px;z-index:9999;max-width:480px;padding:12px 20px;border-radius:8px;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:opacity .3s';
document.body.appendChild(el);
setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000);
setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500);

View File

@@ -314,10 +314,13 @@ function gnizaTestConnection() {
}
function gnizaToast(type, msg) {
var prev = document.getElementById('gniza-alert');
if (prev) prev.remove();
var el = document.createElement('div');
el.id = 'gniza-alert';
el.className = 'alert alert-' + type;
el.textContent = msg;
el.style.cssText = 'position:fixed;top:24px;right:24px;z-index:9999;max-width:480px;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:opacity .3s';
el.style.cssText = 'position:fixed;top:24px;right:24px;z-index:9999;max-width:480px;padding:12px 20px;border-radius:8px;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:opacity .3s';
document.body.appendChild(el);
setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000);
setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500);