Commit graph

4 commits

Author SHA1 Message Date
Jo-Philipp Wich
a98e2ea17d luci-lua-runtime: render cbi header/footer templates via ucode runtime
Trigger rendering of CBI header and footer templates via the ucode runtime
`include()` in order to ensure that scope data is properly inherited from
Lua templates (`cbi/header`) including ucode templates (`header`).

This fixes automatic triggering of the config apply flow on legacy Lua CBI
forms.

Ref: https://github.com/openwrt/luci/pull/6056#issuecomment-1292396588
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-26 22:02:16 +02:00
Jo-Philipp Wich
81f204d38f luci-lua-runtime: fix loading header/footer templates for SimpleForms
Fixes: #6054
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-26 15:30:11 +02:00
Jo-Philipp Wich
ca57291bdd luci-lua-runtime: ensure proper forwarding of route arguments to cbi action
Ensure that the optional cbi() `config` argument is set to an empty table
if unspecified to ensure that the static call argument array is exactly
two elements long, otherwise call arguments are shifted and the invoked
method might not receive the expected parameter.

This fixes, among others, the dispatching of `arcombine()` targets.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-26 15:12:17 +02:00
Jo-Philipp Wich
673f38246a treewide: separate Lua runtime resources
Move classes required for Lua runtime support into a new `luci-lua-runtime`
package. Also replace the `luci.http` and `luci.util` classes in
`luci-lib-base` with stubbed versions interacting with the ucode based
runtime environment.

Finally merge `luci-base-ucode` into the remainders of `luci-base`.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Renamed from modules/luci-base-ucode/luasrc/ucodebridge/luci/dispatcher.lua (Browse further)