luci-app-openvpn: do not show all boolean option by default 2317/head
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 22 Nov 2018 09:53:55 +0000 (10:53 +0100)
committerFlorian Eckert <fe@dev.tdt.de>
Thu, 22 Nov 2018 10:29:44 +0000 (11:29 +0100)
If a new instance is edit then all boolean option are shown on the LuCI.
This is confusing. To fix this hide all boolean ellements on the config
page which are not enabled by default. They must be add first.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
applications/luci-app-openvpn/luasrc/model/cbi/openvpn-advanced.lua
applications/luci-app-openvpn/luasrc/model/cbi/openvpn-basic.lua

index a693e0cf0ced7ba4dbb3d6b4b386f6c20bae9176..9a37ba80221185be4919e7c3e8afd739b29d3498 100644 (file)
@@ -772,6 +772,8 @@ for _, option in ipairs(params) do
                        end
                        return AbstractValue.remove(self, section)
                end
+       elseif option[1] == Flag then
+               o.default = nil
        else
                if option[1] == DynamicList then
                        function o.cfgvalue(...)
index cee5f9d31d3982f05a6bdd5edfb48129736ef013..3be274dc8b0bd6aba914b046687613ba1503a7f3 100644 (file)
@@ -148,6 +148,8 @@ for _, option in ipairs(basicParams) do
                        end
                        return AbstractValue.remove(self, section)
                end
+       elseif option[1] == Flag then
+               o.default = nil
        else
                if option[1] == DynamicList then
                        function o.cfgvalue(...)