diff --git a/whm/gniza-whm/remotes.cgi b/whm/gniza-whm/remotes.cgi index f5861ac..c2e129a 100644 --- a/whm/gniza-whm/remotes.cgi +++ b/whm/gniza-whm/remotes.cgi @@ -601,6 +601,8 @@ sub render_remote_form { print qq{ Cancel\n}; print qq{\n}; + print qq{
\n}; + print qq{\n}; print <<'JS'; @@ -712,19 +714,16 @@ function gnizaTestConnection() { } function gnizaToast(type, msg) { - var prev = document.getElementById('gniza-alert'); - if (prev) prev.remove(); - var container = document.querySelector('[data-theme]'); - if (!container) return; - container.style.position = 'relative'; + var area = document.getElementById('gniza-alert-area'); + if (!area) return; + area.innerHTML = ''; var el = document.createElement('div'); - el.id = 'gniza-alert'; el.className = 'alert alert-' + type; - el.style.cssText = 'position:sticky;top:12px;margin-left:auto;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'; + el.style.cssText = 'padding:12px 20px;border-radius:8px;font-size:14px'; el.textContent = msg; - container.appendChild(el); + area.appendChild(el); setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000); - setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500); + setTimeout(function() { area.innerHTML = ''; }, type === 'error' ? 6500 : 3500); } JS diff --git a/whm/gniza-whm/setup.cgi b/whm/gniza-whm/setup.cgi index b2bc36b..adbc2d6 100644 --- a/whm/gniza-whm/setup.cgi +++ b/whm/gniza-whm/setup.cgi @@ -273,6 +273,8 @@ sub handle_step2 { print qq{ Back\n}; print qq{\n}; + print qq{\n}; + print qq{\n}; print <<'JS'; @@ -314,19 +316,16 @@ function gnizaTestConnection() { } function gnizaToast(type, msg) { - var prev = document.getElementById('gniza-alert'); - if (prev) prev.remove(); - var container = document.querySelector('[data-theme]'); - if (!container) return; - container.style.position = 'relative'; + var area = document.getElementById('gniza-alert-area'); + if (!area) return; + area.innerHTML = ''; var el = document.createElement('div'); - el.id = 'gniza-alert'; el.className = 'alert alert-' + type; - el.style.cssText = 'position:sticky;top:12px;margin-left:auto;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'; + el.style.cssText = 'padding:12px 20px;border-radius:8px;font-size:14px'; el.textContent = msg; - container.appendChild(el); + area.appendChild(el); setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000); - setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500); + setTimeout(function() { area.innerHTML = ''; }, type === 'error' ? 6500 : 3500); } JS