aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js/app/rspamd.js
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2023-11-20 15:58:06 +0300
committermoisseev <moiseev@mezonplus.ru>2023-11-20 15:58:06 +0300
commiteab17b201a5ec7cbe13c15a7cf2b1bbd9480816a (patch)
tree74c111256ad419c5744b9d0196910fdebefad2d6 /interface/js/app/rspamd.js
parent4d10f4efe643a84da936f29d48cc28ad70803ab0 (diff)
downloadrspamd-eab17b201a5ec7cbe13c15a7cf2b1bbd9480816a.tar.gz
rspamd-eab17b201a5ec7cbe13c15a7cf2b1bbd9480816a.zip
[Minor] Use destructuring
Diffstat (limited to 'interface/js/app/rspamd.js')
-rw-r--r--interface/js/app/rspamd.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js
index 26bd6c40d..64eab27a0 100644
--- a/interface/js/app/rspamd.js
+++ b/interface/js/app/rspamd.js
@@ -492,7 +492,7 @@ function ($, NProgress) {
Password: password
},
success: function (json) {
- const data = json[0].data;
+ const [{data}] = json;
$("#connectPassword").val("");
if (data.auth === "ok") {
sessionStorage.setItem("read_only", data.read_only);
@@ -563,7 +563,7 @@ function ($, NProgress) {
if (o.server === "All SERVERS") {
queryServer(neighbours_status, 0, "neighbours", {
success: function (json) {
- const data = json[0].data;
+ const [{data}] = json;
if (jQuery.isEmptyObject(data)) {
neighbours = {
local: {
@@ -695,7 +695,7 @@ function ($, NProgress) {
});
},
_onStatusDropdownChanged: function (e) {
- const self = e.data.self;
+ const {self} = e.data;
const selected = self.$action.val();
if (selected !== self.def) {
const not = self.$not.is(":checked");
@@ -1054,7 +1054,7 @@ function ($, NProgress) {
$(".dropdown-menu a").click(function (e) {
e.preventDefault();
const classList = $(this).attr("class");
- const menuClass = (/\b(?:dynamic|history|preset)\b/).exec(classList)[0];
+ const [menuClass] = (/\b(?:dynamic|history|preset)\b/).exec(classList);
$(".dropdown-menu a.active." + menuClass).removeClass("active");
$(this).addClass("active");
tabClick("#autoRefresh");