From: Alexander Moisseev Date: Thu, 30 Oct 2025 10:50:53 +0000 (+0300) Subject: [Minor] Replace deprecated `alert-error` class X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71f65d19c6338eb02596f07d7af134460eb6fcc0;p=thirdparty%2Frspamd.git [Minor] Replace deprecated `alert-error` class Replaces the old Bootstrap 2.x `alert-error` class with the modern `alert-danger` equivalent. Also removes unused `.alert h4` rules that are no longer used in the UI. This improves compatibility and ensures consistent styling with Bootstrap ≥3. --- diff --git a/interface/css/rspamd.css b/interface/css/rspamd.css index 592905012f..d23dddac16 100644 --- a/interface/css/rspamd.css +++ b/interface/css/rspamd.css @@ -173,6 +173,7 @@ table#symbolsTable input[type="number"] { } .alert { margin-bottom: 4px; + color: #c09853; } .alert.alert-modal { top: 0; @@ -181,39 +182,21 @@ table#symbolsTable input[type="number"] { display: inline-block; padding-left: 35px; } -.alert, -.alert h4 { - color: #c09853; -} -.alert h4 { - margin: 0; -} .alert-success { color: #468847; background: #dff0d8; border-color: #d6e9c6; } -.alert-success h4 { - color: #468847; -} -.alert-danger, -.alert-error { +.alert-danger { color: #b94a48; background: #f2dede; border-color: #eed3d7; } -.alert-danger h4, -.alert-error h4 { - color: #b94a48; -} .alert-info { color: #3a87ad; background: #d9edf7; border-color: #bce8f1; } -.alert-info h4 { - color: #3a87ad; -} #authInvalidCharFeedback, #authUnauthorizedFeedback { diff --git a/interface/index.html b/interface/index.html index c50d17fc63..1c12badf51 100644 --- a/interface/index.html +++ b/interface/index.html @@ -145,7 +145,7 @@
diff --git a/interface/js/app/common.js b/interface/js/app/common.js index 86c01273ca..da3a40b3cd 100644 --- a/interface/js/app/common.js +++ b/interface/js/app/common.js @@ -103,7 +103,7 @@ define(["jquery", "nprogress"], error: function (jqXHR, textStatus, errorThrown) { neighbours_status[ind].checked = true; function errorMessage() { - alertMessage("alert-error", neighbours_status[ind].name + " > " + + alertMessage("alert-danger", neighbours_status[ind].name + " > " + (o.errorMessage ? o.errorMessage : "Request failed") + (errorThrown ? ": " + errorThrown : "")); } @@ -129,7 +129,7 @@ define(["jquery", "nprogress"], alertMessage("alert-success", "Request completed"); } } else { - alertMessage("alert-error", "Request failed"); + alertMessage("alert-danger", "Request failed"); } if (o.complete) o.complete(); NProgress.done(); @@ -351,7 +351,7 @@ define(["jquery", "nprogress"], readFile(files, callback, index = 0) { const file = files[index]; const reader = new FileReader(); - reader.onerror = () => alertMessage("alert-error", `Error reading file: ${file.name}`); + reader.onerror = () => alertMessage("alert-danger", `Error reading file: ${file.name}`); reader.onloadend = () => callback(reader.result); reader.readAsText(file); }, diff --git a/interface/js/app/config.js b/interface/js/app/config.js index 65a3f5e877..d19724e63b 100644 --- a/interface/js/app/config.js +++ b/interface/js/app/config.js @@ -88,13 +88,13 @@ define(["jquery", "app/common"], // String to array for comparison const eltsArray = JSON.parse(elts); if (eltsArray[0] < 0) { - common.alertMessage("alert-modal alert-error", "Spam can not be negative"); + common.alertMessage("alert-modal alert-danger", "Spam can not be negative"); } else if (eltsArray[1] < 0) { - common.alertMessage("alert-modal alert-error", "Rewrite subject can not be negative"); + common.alertMessage("alert-modal alert-danger", "Rewrite subject can not be negative"); } else if (eltsArray[2] < 0) { - common.alertMessage("alert-modal alert-error", "Probable spam can not be negative"); + common.alertMessage("alert-modal alert-danger", "Probable spam can not be negative"); } else if (eltsArray[3] < 0) { - common.alertMessage("alert-modal alert-error", "Greylist can not be negative"); + common.alertMessage("alert-modal alert-danger", "Greylist can not be negative"); } else if (descending(eltsArray)) { common.query("saveactions", { method: "POST", @@ -105,7 +105,7 @@ define(["jquery", "app/common"], server: server }); } else { - common.alertMessage("alert-modal alert-error", "Incorrect order of actions thresholds"); + common.alertMessage("alert-modal alert-danger", "Incorrect order of actions thresholds"); } }; diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index dcd6d734e8..58dc45ad7e 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -216,7 +216,7 @@ define(["jquery", "app/common", "d3evolution", "d3pie", "d3", "footable"], if ((curr[0][0].x !== res[0][0].x) || (curr[0][curr[0].length - 1].x !== res[0][res[0].length - 1].x)) { time_match = false; - common.alertMessage("alert-error", + common.alertMessage("alert-danger", "Neighbours time extents do not match. Check if time is synchronized on all servers."); arr.splice(1); // Break out of .reduce() by mutating the source array } diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 2ed8d5605f..1e139d435d 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -164,7 +164,7 @@ define(["jquery", "app/common", "app/libft", "footable"], function differentVersions(neighbours_data) { const dv = neighbours_data.some((e) => e.version !== neighbours_data[0].version); if (dv) { - common.alertMessage("alert-error", + common.alertMessage("alert-danger", "Neighbours history backend versions do not match. Cannot display history."); return true; } diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index ae19aec003..ea19cc2ae1 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -335,7 +335,7 @@ define(["jquery", "app/common", "stickytabs", "visibility", if (textStatus.statusText === "Unauthorized") { invalidFeedback("#authUnauthorizedFeedback"); } else { - common.alertMessage("alert-modal alert-error", textStatus.statusText); + common.alertMessage("alert-modal alert-danger", textStatus.statusText); } $("#connectPassword").val(""); $("#connectPassword").focus(); diff --git a/interface/js/app/selectors.js b/interface/js/app/selectors.js index 4a1c6d0d05..6b287d6935 100644 --- a/interface/js/app/selectors.js +++ b/interface/js/app/selectors.js @@ -23,7 +23,7 @@ define(["jquery", "app/common"], $("#selectorsResArea") .val(Object.prototype.hasOwnProperty.call(json, "data") ? json.data.toString() : ""); } else { - common.alertMessage("alert-error", "Unexpected error processing message"); + common.alertMessage("alert-danger", "Unexpected error processing message"); } }, server: common.getServer() diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js index d7510b163a..e504aef799 100644 --- a/interface/js/app/stats.js +++ b/interface/js/app/stats.js @@ -328,7 +328,7 @@ define(["jquery", "app/common", "d3pie", "d3"], error: function (jqXHR, textStatus, errorThrown) { if (!(alerted in sessionStorage)) { sessionStorage.setItem(alerted, true); - common.alertMessage("alert-error", neighbours_status[e].name + " > " + + common.alertMessage("alert-danger", neighbours_status[e].name + " > " + "Cannot receive legacy stats data" + (errorThrown ? ": " + errorThrown : "")); } process_node_stat(e); diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js index 69a0e20d80..4c673639ca 100644 --- a/interface/js/app/upload.js +++ b/interface/js/app/upload.js @@ -121,20 +121,20 @@ define(["jquery", "app/common", "app/libft"], }); } } else { - common.alertMessage("alert-error", "Cannot scan data"); + common.alertMessage("alert-danger", "Cannot scan data"); } }, error: enable_disable_scan_btn, errorMessage: "Cannot upload data", statusCode: { 404: function () { - common.alertMessage("alert-error", "Cannot upload data, no server found"); + common.alertMessage("alert-danger", "Cannot upload data, no server found"); }, 500: function () { - common.alertMessage("alert-error", "Cannot tokenize message: no text data"); + common.alertMessage("alert-danger", "Cannot tokenize message: no text data"); }, 503: function () { - common.alertMessage("alert-error", "Cannot tokenize message: no text data"); + common.alertMessage("alert-danger", "Cannot tokenize message: no text data"); } }, server: common.getServer() @@ -166,7 +166,7 @@ define(["jquery", "app/common", "app/libft"], common.alertMessage("alert-success", "Message successfully processed"); fillHashTable(json.hashes); } else { - common.alertMessage("alert-error", "Unexpected error processing message"); + common.alertMessage("alert-danger", "Unexpected error processing message"); } }, server: common.getServer() @@ -237,7 +237,7 @@ define(["jquery", "app/common", "app/libft"], uploadText(data, source, headers); } } else { - common.alertMessage("alert-error", "Message source field cannot be blank"); + common.alertMessage("alert-danger", "Message source field cannot be blank"); } return false; }); diff --git a/interface/js/main.js b/interface/js/main.js index 4cf97ae4c7..64cee05a18 100644 --- a/interface/js/main.js +++ b/interface/js/main.js @@ -50,7 +50,7 @@ requirejs.onError = function (e) { "use strict"; document.getElementById("loading").classList.add("d-none"); document.getElementsByClassName("notification-area")[0].innerHTML = - "
" + + "
" + "Module loading error: " + e.requireType + ", module: " + e.requireModules + "" + "