captsa add alert
This commit is contained in:
@@ -172,3 +172,31 @@ window.cancelCommand = async function(id) {
|
||||
await fetch(`/dashboard/commands/${id}`, { method: 'DELETE' });
|
||||
window.fetchLog();
|
||||
};
|
||||
|
||||
window.fetchCaptchaStatus = async function() {
|
||||
try {
|
||||
const res = await fetch('/dashboard/captcha-status');
|
||||
const data = await res.json();
|
||||
const banner = document.getElementById('captcha-banner');
|
||||
if (!banner) return;
|
||||
|
||||
if (data.captcha_active) {
|
||||
// Only show it if the user hasn't explicitly clicked 'close' for this specific alert
|
||||
if (banner.dataset.dismissed !== '1') {
|
||||
banner.style.display = 'flex';
|
||||
}
|
||||
} else {
|
||||
// Captcha cleared from the game - hide banner and reset dismiss state for next time
|
||||
banner.style.display = 'none';
|
||||
banner.dataset.dismissed = '0';
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
|
||||
window.dismissCaptchaBanner = function() {
|
||||
const banner = document.getElementById('captcha-banner');
|
||||
if (banner) {
|
||||
banner.style.display = 'none';
|
||||
banner.dataset.dismissed = '1';
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user