Commit graph

7 commits

Author SHA1 Message Date
Jo-Philipp Wich
9763e3e9d3 luci-base: runtime.uc: fix error500() invocation on theme failure
In case no single theme could be loaded successfully, the runtime class
failed to properly invoke the `error500()` method, which is only available
through the passed environment at this point.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-08-07 23:36:36 +02:00
Jo-Philipp Wich
bed67dc000 luci-base: only render theme specific sysauth template when it exists
Avoid displaying non-fatal "File not found" exceptions when a theme is not
shipping an own sysauth template.

Fixes: #6118
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-25 15:30:20 +01:00
Jo-Philipp Wich
a5d21dadbd luci-base: fix rendering ucode templates from template target
A previous commit inadvertently broke support for rendering ucode templates
from the `template` dispatcher target.

Fixes: #6111
Fixes: fa17c1573f ("luci-base, luci-lua-runtime: adjust Lua template environment")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-22 09:41:31 +01:00
Jo-Philipp Wich
e7afd0d327 luci-base: fix luci.http.close()
Ensure that `http.write()` or template rendering operations after a call
to `http.close()` do not produce additional output. This is required for
certain legacy Lua apps which invoke write and close operations in the
middle of a server side cbi rendering process.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-03 00:38:00 +01:00
Jo-Philipp Wich
815028ef93 luci-base: runtime.uc: avoid Lua not installed exeption from trycompile()
Make sure to request loading the Lua bridge as optional when initializing
the Lua VM context from trycompile() in order to not raise a fatal exception
in case the Lua runtime support is not present.

Ref: https://forum.openwrt.org/t/x/141426
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-02 10:21:05 +01:00
Jo-Philipp Wich
1eea6c0ce8 luci-base: add ui indicator when fallback theme is used
Add a ui indicator displaying error details when the configured theme
failed to load and the next available one is being used instead.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-27 11:14:52 +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/ucode/runtime.uc (Browse further)