summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-lua-runtime/luasrc/template.lua
AgeCommit message (Collapse)Author
2022-11-21luci-base, luci-lua-runtime: adjust Lua template environmentJo-Philipp Wich
To maintain full compatibility with the old Lua runtime, templates rendered from a menu `template()` action must implicitly inherit the `luci.dispatcher` namespace as scope while other indirectly included templates must not. Fixes: #6105 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-09luci-lua-runtime: also search luci.dispatcher scope when looking up valuesJo-Philipp Wich
Some legacy templates access dispatcher functions such as `build_url()` without explicit scope, which worked in the old runtime since the template view namespace was instantiated from the dispatcher. Ensure that this continues to function in the emulated runtime. Fixes: #6082 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-08lua-runtime: template: fix "tpl" refactoringKarl Palsson
This fixes crashes on "tpl" being undefined. Signed-off-by: Karl Palsson <karlp@etactica.com>
2022-10-25treewide: separate Lua runtime resourcesJo-Philipp Wich
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>