Update action-collector.js

This commit is contained in:
SubleXBle
2025-08-06 12:50:47 +02:00
committed by GitHub
parent 95acf41075
commit 505bc015c9

View File

@@ -35,15 +35,18 @@ function collectAndExecuteActions(ip, jail = '') {
const message = data.message || 'No message returned.';
let type;
if (action === 'report') {
type = 'info';
// check fo type
if (data.type) {
type = data.type; // from backend
} else {
type = data.success ? "success" : "error";
// fallback:
type = data.success ? 'success' : 'error';
}
showNotification(prefix + message, type);
})
.catch(err => {
const errorMsg = `[${action.toUpperCase()}] Error processing IP ${ip}: ${err}`;
showNotification(errorMsg, "error");
@@ -63,7 +66,7 @@ function showNotification(message, type = "info") {
if (!container) return;
const note = document.createElement('div');
note.className = 'notification ' + type; // CSS notification success/error/info
note.className = 'notification ' + type; // CSS Klassen wie notification success/error/info
note.innerText = message;
container.appendChild(note);