]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Sort symbols in webui
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 23 Mar 2016 10:16:55 +0000 (10:16 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 23 Mar 2016 10:16:55 +0000 (10:16 +0000)
interface/js/rspamd.js

index 0f01dccd9f22303402a55e9448a5e5c240aeb6e9..3d6484cd8243091947384b71da751781d61ce8f9 100644 (file)
                 },
                 success: function (data) {
                     $('#modalBody').empty();
+                    data.sort(function(a, b) {
+                        return a.group.localeCompare(b.group);
+                    });
                     $.each(data, function (i, group) {
                         items.push('   <div class="row row-bordered" data-slider="hover">' +
                             '<h4>' + group.group + '</h4>' +
                             '</div>');
+                        group.rules.sort(function(a, b) {
+                            return a.symbol.localeCompare(b.symbol);
+                        });
                         $.each(group.rules, function (i, item) {
                             var max = 20;
                             var min = -20;