summaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
authorfiredranzer <rupeshharode@gmail.com>2018-03-05 20:59:22 +0530
committerfiredranzer <rupeshharode@gmail.com>2018-03-05 20:59:22 +0530
commit8fdc57822563029b4013c9162057055182074346 (patch)
treefdd0b8daa4544c3011ac61072cf2022e49f659dd /interface
parenta659d1a9f04da051a45eb55e242bcec5491dca4e (diff)
downloadrspamd-8fdc57822563029b4013c9162057055182074346.tar.gz
rspamd-8fdc57822563029b4013c9162057055182074346.zip
Fixes greylist form vanish
Diffstat (limited to 'interface')
-rw-r--r--interface/js/app/config.js30
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");
+ }
});
},
});