From: Alexander Moisseev Date: Thu, 25 Jun 2026 15:26:57 +0000 (+0300) Subject: [Rework] WebUI: migrate symbols table to Tabulator X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c965607e0b8d135c8875b2ac3c4c3e7a41dcfbc0;p=thirdparty%2Frspamd.git [Rework] WebUI: migrate symbols table to Tabulator Phase 2 of the FooTable→Tabulator migration: - Replace FooTable.init with Tabulator in symbols.js: columns, local pagination (25/page), per-column header filters, responsive collapse - Custom group dropdown filter: native with distinct sorted groups from the + // table data, plus an empty option to clear the filter. + function formatFreq(value, params) { + return (value * params.mult).toFixed(2) + ((params.exp > 0) ? "e-" + params.exp : ""); } + + function populateGroupSelect(select, rows) { + const current = select.value; + select.innerHTML = ""; + select.appendChild(new Option("Any group", "")); + const data = rows || (common.tables.symbols && common.tables.symbols.getData()) || []; + [...new Set(data.map((r) => r.group))] + .sort((a, b) => a.localeCompare(b)) + .forEach((g) => select.appendChild(new Option(g, g))); + select.value = current; + } + // @get symbols into modal form ui.getSymbols = function () { $("#refresh, #updateSymbols").attr("disabled", true); @@ -113,111 +119,107 @@ define(["jquery", "app/common", "footable"], common.query("symbols", { success: function (json) { const [{data}] = json; - const items = process_symbols_data(data); + const [rows, , freqParams] = process_symbols_data(data); - /* eslint-disable consistent-this, no-underscore-dangle */ - FooTable.groupFilter = FooTable.Filtering.extend({ - construct: function (instance) { - this._super(instance); - [,this.groups] = items; - this.groups.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase())); - this.def = "Any group"; - this.$group = null; - }, - $create: function () { - this._super(); - const self = this; - const $form_grp = $("
", { - class: "form-group" - }).append($("