summaryrefslogtreecommitdiff
path: root/modules/luci-lua-runtime/luasrc/template.lua
Commit message (Collapse)AuthorAgeFilesLines
* luci-base, luci-lua-runtime: adjust Lua template environmentJo-Philipp Wich2022-11-211-1/+1
| | | | | | | | | | 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>
* luci-lua-runtime: also search luci.dispatcher scope when looking up valuesJo-Philipp Wich2022-11-091-1/+1
| | | | | | | | | | | 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>
* lua-runtime: template: fix "tpl" refactoringKarl Palsson2022-11-081-1/+1
| | | | | | This fixes crashes on "tpl" being undefined. Signed-off-by: Karl Palsson <karlp@etactica.com>
* treewide: separate Lua runtime resourcesJo-Philipp Wich2022-10-251-0/+184
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>