]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] More fixes to symbols config
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 1 Nov 2016 11:59:13 +0000 (11:59 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 1 Nov 2016 11:59:13 +0000 (11:59 +0000)
interface/index.html
interface/js/rspamd.js

index 98b6557c5792d9b375fd1f34c1da007c89392475..f93adabd205a02b936a43eb41611e8f37caa4618 100644 (file)
                                        <div class="widget-content nopadding">
                                                <table class="table table-log table-hover" id="symbolsTable">
                                                        <thead>
-                                                               <th class="col1" title="Symbol">Symbol name</th>
-                                                               <th class="col2" title="Group">Group</th>
-                                                               <th class="col2" title="Description">Description</th>
-                                                               <th class="col3" title="Score">Score</th>
-                                                               <th class="col4" title="Hits">Hits</th>
-                                                               <th class="col5" title="Avg.time">Avg.time</th>
-                                                               <th class="col6" title="Save data">Save data</th>
+                                                               <th title="Symbol">Symbol name</th>
+                                                               <th title="Group">Group</th>
+                                                               <th title="Description">Description</th>
+                                                               <th title="Score">Score</th>
+                                                               <th title="Hits">Hits</th>
+                                                               <th title="Avg.time">Avg.time</th>
+                                                               <th title="Save data">Save data</th>
                                                        </thead>
                                                </table>
                                        </div>
index 15aa47b7c17601f6e86df4979260bcf1884ff06f..96add8257957a2f47df6e7f4ee274902c2bc24f3 100644 (file)
         }
         // @get symbols into modal form
         function getSymbols() {
-            var symbols_length = 50;
-
             if (symbols) {
-                var sl = document.getElementsByName('symbols_length')[0];
-                if (sl !== undefined) {
-                    symbols_length = parseInt(sl.value);
-                } else {
-                    symbols_length = 50;
-                }
                 symbols.destroy();
                 symbols = null;
                 $('#symbolsTable').children('tbody').remove();
                                 item.frequency = 0;
                             }
                             items.push('<tr>' +
-                                '<td data-order="' + item.symbol + '">' + item.symbol + '</td>' +
+                                '<td data-order="' + item.symbol + '"><strong>' + item.symbol + '</strong></td>' +
                                 '<td data-order="' + group.group + '"><div class="cell-overflow" tabindex="1" title="' + group.group + '">' + group.group + '</div></td>' +
                                 '<td data-order="' + item.description + '"><div class="cell-overflow" tabindex="1" title="' + item.description + '">' + item.description + '</div></td>' +
                                 '<td data-order="' + item.weight + '"><input class="numeric" data-role="numerictextbox" autocomplete="off" "type="number" class="input" min="' +
                         html: items.join('')
                     }).insertAfter('#symbolsTable thead');
                     symbols = $('#symbolsTable').DataTable({
-                        "aLengthMenu": [
-                            [50, 100, 200, -1],
-                            [50, 100, 200, "All"]
-                        ],
+                        "paging": false,
                         "orderMulti": true,
                         "order": [
                             [1, "asc"],
                             [0, "asc"],
                             [3, "desc"]
                         ],
-                        "pageLength": symbols_length,
+                        "info": false,
                         "columns": [
-                            {"width": "30%", "searchable": true, "orderable": true},
+                            {"width": "25%", "searchable": true, "orderable": true},
                             {"width": "10%", "searchable": true, "orderable": true},
-                            {"width": "30%", "searchable": false, "orderable": false},
-                            {"searchable": false, "orderable": true, "type": "num"},
+                            {"width": "25%", "searchable": false, "orderable": false},
+                            {"width": "10%", "searchable": false, "orderable": true, "type": "num"},
                             {"searchable": false, "orderable": true, "type": "num"},
                             {"searchable": false, "orderable": true, "type": "num"},
-                            {"width": "10%", "searchable": false, "orderable": false, "type": "html"}
-                        ]
+                            {"width": "5%", "searchable": false, "orderable": false, "type": "html"}
+                        ],
                     });
                     symbols.columns.adjust().draw();
                     $('#symbolsTable :button').on('click',
                         function(){saveSymbols("/savesymbols", "symbolsTable")});
-                    $('#symbolsTable').on( 'page.dt', function () {
-                        $('#symbolsTable :button').on('click',
-                            function(){saveSymbols("/savesymbols", "symbolsTable")});
-                    });
                 },
                 error: function (data) {
                     alertMessage('alert-modal alert-error', data.statusText);