]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Unify sortValue functions to arrow functions
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 17 Jan 2026 16:45:44 +0000 (19:45 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 17 Jan 2026 16:45:44 +0000 (19:45 +0300)
Convert all sortValue functions in FooTable column definitions to
arrow functions with consistent parameter naming for consistency
across the codebase.

interface/js/app/history.js
interface/js/app/libft.js
interface/js/app/symbols.js

index e35f51fea85b82dea35cf1bf4bf6fb3a6bf0aab0..42980237d6180e8c4e509e868ee743286967ab59 100644 (file)
@@ -69,7 +69,7 @@ define(["jquery", "app/common", "app/libft", "footable"],
                 name: "score",
                 title: "Score",
                 style: {maxWidth: 110},
-                sortValue: function (val) { return Number(val.options.sortValue); }
+                sortValue: (val) => Number(val.options.sortValue)
             }, {
                 name: "symbols",
                 title: "Symbols",
@@ -86,13 +86,13 @@ define(["jquery", "app/common", "app/libft", "footable"],
                 title: "Scan time",
                 breakpoints: "md",
                 style: {maxWidth: 80},
-                sortValue: function (val) { return Number(val); }
+                sortValue: (val) => Number(val)
             }, {
                 sorted: true,
                 direction: "DESC",
                 name: "time",
                 title: "Time",
-                sortValue: function (val) { return Number(val.options.sortValue); }
+                sortValue: (val) => Number(val.options.sortValue)
             }, {
                 name: "user",
                 title: "Authenticated user",
@@ -207,7 +207,7 @@ define(["jquery", "app/common", "app/libft", "footable"],
                         name: "ts",
                         title: "Time",
                         style: {width: 300, maxWidth: 300},
-                        sortValue: function (val) { return Number(val.options.sortValue); }},
+                        sortValue: (val) => Number(val.options.sortValue)},
                     {name: "type",
                         title: "Worker type",
                         breakpoints: "md",
index 0e32932d1bdb1687bea0c9bfc9735a17b09d794b..b24e0d466f1e8dddef0a41e4f4953c11901cbb79 100644 (file)
@@ -128,7 +128,7 @@ define(["jquery", "app/common", "footable"],
                     "text-align": "right",
                     "white-space": "nowrap"
                 },
-                sortValue: function (val) { return Number(val.options.sortValue); }
+                sortValue: (val) => Number(val.options.sortValue)
             }, {
                 name: "symbols",
                 title: "Symbols" +
@@ -156,14 +156,14 @@ define(["jquery", "app/common", "footable"],
                 title: "Scan time",
                 breakpoints: "lg",
                 style: {maxWidth: 72},
-                sortValue: function (val) { return Number(val); }
+                sortValue: (val) => Number(val)
             }, {
                 classes: "history-col-time",
                 sorted: true,
                 direction: "DESC",
                 name: "time",
                 title: "Time",
-                sortValue: function (val) { return Number(val.options.sortValue); }
+                sortValue: (val) => Number(val.options.sortValue)
             }, {
                 name: "user",
                 title: "Authenticated user",
index c6fe74240e351fdf2a74ffd326f1b44df2c2255d..f14a6080029663120af4568b503157f26be134f0 100644 (file)
@@ -180,7 +180,7 @@ define(["jquery", "app/common", "footable"],
                             {name: "time",
                                 title: "Avg. time",
                                 breakpoints: "md",
-                                sortValue: function (value) { return parseFloat(value); }},
+                                sortValue: (val) => parseFloat(val)},
                         ],
                         rows: items[0],
                         paging: {