aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app/upload.js
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2023-11-17 13:02:41 +0300
committermoisseev <moiseev@mezonplus.ru>2023-11-17 13:02:41 +0300
commit2bed972703dfe52206eb06e8583eb39b38596cc4 (patch)
tree78ac0be55f2f4fc9dfa59ced581d77d725e308b7 /interface/js/app/upload.js
parent66620b534846573efd0222e3d6980b54b5259c20 (diff)
downloadrspamd-2bed972703dfe52206eb06e8583eb39b38596cc4.tar.gz
rspamd-2bed972703dfe52206eb06e8583eb39b38596cc4.zip
[Minor] Get rid of 'var' declarations
Diffstat (limited to 'interface/js/app/upload.js')
-rw-r--r--interface/js/app/upload.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js
index 269d32460..26bb82e8d 100644
--- a/interface/js/app/upload.js
+++ b/interface/js/app/upload.js
@@ -27,7 +27,7 @@
define(["jquery", "app/rspamd"],
function ($, rspamd) {
"use strict";
- var ui = {};
+ const ui = {};
function cleanTextUpload(source) {
$("#" + source + "TextSource").val("");
@@ -35,7 +35,7 @@ define(["jquery", "app/rspamd"],
// @upload text
function uploadText(data, source, headers) {
- var url = null;
+ let url = null;
if (source === "spam") {
url = "learnspam";
} else if (source === "ham") {
@@ -142,7 +142,7 @@ define(["jquery", "app/rspamd"],
}
function get_server() {
- var checked_server = rspamd.getSelector("selSrv");
+ const checked_server = rspamd.getSelector("selSrv");
return (checked_server === "All SERVERS") ? "local" : checked_server;
}
@@ -166,13 +166,13 @@ define(["jquery", "app/rspamd"],
});
}
- var json = neighbours_status[0].data;
+ const json = neighbours_status[0].data;
if (json.action) {
rspamd.alertMessage("alert-success", "Data successfully scanned");
- var rows_total = $("#historyTable_scan > tbody > tr:not(.footable-detail-row)").length + 1;
- var o = rspamd.process_history_v2({rows:[json]}, "scan");
- var items = o.items;
+ const rows_total = $("#historyTable_scan > tbody > tr:not(.footable-detail-row)").length + 1;
+ const o = rspamd.process_history_v2({rows:[json]}, "scan");
+ const items = o.items;
rspamd.symbols.scan.push(o.symbols[0]);
if (Object.prototype.hasOwnProperty.call(rspamd.tables, "scan")) {
@@ -228,7 +228,7 @@ define(["jquery", "app/rspamd"],
},
method: "POST",
success: function (neighbours_status) {
- var json = neighbours_status[0].data;
+ const json = neighbours_status[0].data;
if (json.success) {
rspamd.alertMessage("alert-success", "Message successfully processed");
fillHashTable(json.hashes);
@@ -277,13 +277,13 @@ define(["jquery", "app/rspamd"],
});
$("[data-upload]").on("click", function () {
- var source = $(this).data("upload");
- var data = $("#scanMsgSource").val();
- var headers = {};
+ const source = $(this).data("upload");
+ const data = $("#scanMsgSource").val();
+ let headers = {};
if ($.trim(data).length > 0) {
if (source === "scan") {
headers = ["IP", "User", "From", "Rcpt", "Helo", "Hostname"].reduce(function (o, header) {
- var value = $("#scan-opt-" + header.toLowerCase()).val();
+ const value = $("#scan-opt-" + header.toLowerCase()).val();
if (value !== "") o[header] = value;
return o;
}, {});