From: Alexander Moisseev Date: Sat, 17 Jan 2026 16:45:44 +0000 (+0300) Subject: [Minor] Unify sortValue functions to arrow functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd91693a4f968d0dc781cdc16c80d56ad9ae1f04;p=thirdparty%2Frspamd.git [Minor] Unify sortValue functions to arrow functions Convert all sortValue functions in FooTable column definitions to arrow functions with consistent parameter naming for consistency across the codebase. --- diff --git a/interface/js/app/history.js b/interface/js/app/history.js index e35f51fea8..42980237d6 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -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", diff --git a/interface/js/app/libft.js b/interface/js/app/libft.js index 0e32932d1b..b24e0d466f 100644 --- a/interface/js/app/libft.js +++ b/interface/js/app/libft.js @@ -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", diff --git a/interface/js/app/symbols.js b/interface/js/app/symbols.js index c6fe74240e..f14a608002 100644 --- a/interface/js/app/symbols.js +++ b/interface/js/app/symbols.js @@ -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: {