]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Improve visual representation of symbols table
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 2 Nov 2016 17:09:50 +0000 (17:09 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 2 Nov 2016 17:09:50 +0000 (17:09 +0000)
interface/css/rspamd.css
interface/index.html
interface/js/rspamd.js

index eb6c9c0c838280404198d83823234752812071e3..62501df4829c438198ab852d57cb6551a1d8905b 100644 (file)
@@ -552,3 +552,11 @@ td.maps-cell {
     width: auto;
     border: 1px solid grey;
 }
+
+.scorebar-spam {
+       background-color: rgba(240, 0, 0, 0.1);
+}
+
+.scorebar-ham {
+       background: rgba(100, 230, 80, 0.1)
+}
index 611f86290f79e0e7077dfc1509a0b8234d031c66..502e5791c6caff1d6b3a64d0390d3f4515e34420 100644 (file)
                                        <div class="widget-content nopadding">
                                                <table class="table table-log table-hover" id="symbolsTable">
                                                        <thead>
-                                                               <th title="Symbol">Symbol name</th>
                                                                <th title="Group">Group</th>
+                                                               <th title="Symbol">Symbol</th>
                                                                <th title="Description">Description</th>
                                                                <th title="Score">Score</th>
                                                                <th title="Hits">Hits</th>
index 96add8257957a2f47df6e7f4ee274902c2bc24f3..77fe5e867dd29dd0477eadf35b9a7c6e6981b49c 100644 (file)
                             }
                             var label;
                             if (item.weight < 0) {
-                                label = 'label-success';
+                                label_class = 'scorebar-ham';
                             } else {
-                                label = 'label-danger';
+                                label_class = 'scorebar-spam';
                             }
 
                             if (!item.time) {
                                 item.frequency = 0;
                             }
                             items.push('<tr>' +
-                                '<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.symbol + '"><strong>' + item.symbol + '</strong></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="' +
+                                '<td data-order="' + item.weight + '"><input class="numeric ' + label_class +
+                                '" data-role="numerictextbox" autocomplete="off" "type="number" class="input" min="' +
                                 min + '" max="' +
                                 max + '" step="' + decimalStep(item.weight) +
                                 '" tabindex="1" value="' + Number(item.weight).toFixed(3) +
-                                '" id="_sym_' + item.symbol + '"><span class="label ' + label + '">●' +
-                                '</span></td>' +
+                                '" id="_sym_' + item.symbol + '"></span></td>' +
                                 '<td data-order="' + item.frequency + '">' + item.frequency + '</td>' +
                                 '<td data-order="' + item.time + '">' + Number(item.time).toFixed(2) + 'ms</td>' +
                                 '<td><button type="button" class="btn btn-primary btn-sm">Save</button></td>' +
                         "paging": false,
                         "orderMulti": true,
                         "order": [
-                            [1, "asc"],
                             [0, "asc"],
+                            [1, "asc"],
                             [3, "desc"]
                         ],
                         "info": false,
                         "columns": [
-                            {"width": "25%", "searchable": true, "orderable": true},
-                            {"width": "10%", "searchable": true, "orderable": true},
-                            {"width": "25%", "searchable": false, "orderable": false},
-                            {"width": "10%", "searchable": false, "orderable": true, "type": "num"},
+                            {"width": "7%", "searchable": true, "orderable": true},
+                            {"width": "20%", "searchable": true, "orderable": true},
+                            {"width": "30%", "searchable": false, "orderable": false},
+                            {"width": "7%", "searchable": false, "orderable": true, "type": "num"},
                             {"searchable": false, "orderable": true, "type": "num"},
                             {"searchable": false, "orderable": true, "type": "num"},
                             {"width": "5%", "searchable": false, "orderable": false, "type": "html"}