Client-side rendering of the LuCI web interface

Hello everyone,

I am new to OpenWrt and I need some help.

The OpenWrt 19.07.2 release notes are stating that the new version of LuCI implements client-side rendering of views and some of the work, which was previously done on the server using Lua code is now moving to the browser with the use of Javascript.

My question is, where can I see examples of how this is actually done and what new functionality LuCI offers?

I would really appreciate your help, thank you in advance.

Ideally you don't 'see' it at all, aside from some tiny visible tweaks. For the details you'll have to follow the code.

Hello slh, thank you for your answer.

Under 'see' I meant if there are some LuCI modules which are written in the new style,
so I can look at the code as an example.
Sorry if my question is stupid, it is just that there is not a lot of information and practical examples
about how to work with this new client-side rendering feature.

Here's an example conversion: https://github.com/openwrt/luci/commit/9ae591b38fedf16c3e5c97350b7182c5e28ed71f#diff-27855472049b664538cca7ef50c43df8

1 Like

Thank you, jow, that was a very useful link.

May I ask, since in the example, UCI data is set directly from the Javascript code, how is the data validated at the back-end before inserting it in the UCI configuration file?

Syntactic validity is checked by rpcd which provides the ubus uci namespace. Semantic validity is not verified.

1 Like