diff options
author | firedranzer <rupeshharode@gmail.com> | 2018-03-05 20:59:22 +0530 |
---|---|---|
committer | firedranzer <rupeshharode@gmail.com> | 2018-03-05 20:59:22 +0530 |
commit | 8fdc57822563029b4013c9162057055182074346 (patch) | |
tree | fdd0b8daa4544c3011ac61072cf2022e49f659dd /interface | |
parent | a659d1a9f04da051a45eb55e242bcec5491dca4e (diff) | |
download | rspamd-8fdc57822563029b4013c9162057055182074346.tar.gz rspamd-8fdc57822563029b4013c9162057055182074346.zip |
Fixes greylist form vanish
Diffstat (limited to 'interface')
-rw-r--r-- | interface/js/app/config.js | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/interface/js/app/config.js b/interface/js/app/config.js index 3346d3936..c6d4a9b48 100644 --- a/interface/js/app/config.js +++ b/interface/js/app/config.js @@ -217,17 +217,31 @@ function($) { $('#saveActionsClusterBtn').on('click', function() { var elts = loadActionsFromForm(); - rspamd.queryNeighbours('saveactions', null, null, "POST", {}, { - data: elts, - dataType: "json", - }); + // String to array for comparison + var eltsArray = JSON.parse(loadActionsFromForm()); + if(eltsArray[2]>=0){ + rspamd.queryNeighbours('saveactions', null, null, "POST", {}, { + data: elts, + dataType: "json", + }); + } + else{ + alert("Greylist can not be negative"); + } }); $('#saveActionsBtn').on('click', function() { var elts = loadActionsFromForm(); - rspamd.queryLocal('saveactions', null, null, "POST", {}, { - data: elts, - dataType: "json", - }); + // String to array for comparison + var eltsArray = JSON.parse(loadActionsFromForm()); + if(eltsArray[2]>=0){ + rspamd.queryLocal('saveactions', null, null, "POST", {}, { + data: elts, + dataType: "json", + }); + } + else{ + alert("Greylist can not be negative"); + } }); }, }); |