luci-base: Add missed config parameter for cbi when converting to JSON 3646/head
authorAnton Kikin <a.kikin@tano-systems.com>
Tue, 18 Feb 2020 11:00:01 +0000 (14:00 +0300)
committerAnton Kikin <a.kikin@tano-systems.com>
Tue, 18 Feb 2020 11:00:01 +0000 (14:00 +0300)
The cbi() function has a second argument 'config' in which various
configuration parameters can be passed. When converting the lua menu
to JSON, we must also convert this parameter.

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
modules/luci-base/luasrc/dispatcher.lua

index c227b68c858d00731a85010a9a5a8db7a5c7fa7b..118ca221aee66ff82f4e04041a7de9b8b9c6ee73 100644 (file)
@@ -193,7 +193,8 @@ local function target_to_json(target, module)
        elseif target.type == "cbi" then
                action = {
                        ["type"] = "cbi",
-                       ["path"] = target.model
+                       ["path"] = target.model,
+                       ["config"] = target.config
                }
        elseif target.type == "form" then
                action = {