]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Fix saving actions from web interface (#769) 781/head
authorAndrew Lewis <nerf@judo.za.org>
Mon, 1 Aug 2016 09:53:39 +0000 (11:53 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 1 Aug 2016 09:53:39 +0000 (11:53 +0200)
interface/js/rspamd.js

index be73bf368cec2865c4c18c16b5caa5e83a879914..7c4284c575679933e34e65c3c1cdcefb6bcc8187 100644 (file)
                                 html: '<div class="form-group">' +
                                     '<label class="control-label col-sm-2">' + label + '</label>' +
                                     '<div class="controls slider-controls col-sm-10">' +
-                                    '<input class="slider" type="slider" value="' + item.value + '">' +
+                                    '<input class="slider" type="slider" value="' + item.value + '" id="' + item.action + '">' +
                                     '</div>' +
                                     '</div>'
                             });
             var url = 'saveactions';
             var values = [];
             // Rspamd order: [spam,probable_spam,greylist]
-            values[0] = parseFloat(inputs[2].value);
-            values[1] = parseFloat(inputs[1].value);
-            values[2] = parseFloat(inputs[0].value);
+            values[0] = parseFloat(document.getElementById('reject').value);
+            values[1] = parseFloat(document.getElementById('add header').value);
+            values[2] = parseFloat(document.getElementById('greylist').value);
             $.ajax({
                 data: JSON.stringify(values),
                 dataType: 'json',