luci-app-firewall: map proto '*' and 'any' to all on rule config 4652/head
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 11 Dec 2020 12:22:38 +0000 (13:22 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Wed, 16 Dec 2020 11:55:31 +0000 (12:55 +0100)
Before the change, the options '*' and 'any' in the drop down were not
recognized as valid options, when loaded from the uci. With this change,
the options '*' and 'any' are mapped to 'all' and saved as such. This
change is especially important if the proto option is changed manually
to '*' or 'any' in shell and then further configured via LuCI.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js

index 32998c2ff899a20050ab70d88e385b713b865344..d365467835fb1209e0dae7914238baeced317ee4 100644 (file)
@@ -522,6 +522,9 @@ return baseclass.extend({
                                }
                        }, this));
 
+                       if (cfgvalue == '*' || cfgvalue == 'any' || cfgvalue == 'all')
+                               cfgvalue = 'all';
+
                        return cfgvalue;
                },