| Both sides previous revision Previous revision Next revision | Previous revision |
| docs:techref:luci2 [2018/10/25 19:29] – stokito | docs:techref:luci2 [2021/03/18 12:48] (current) – Add warning, remove old luci2 feed hnyman |
|---|
| ====== LuCI2 (OpenWrt web user interface) ====== | ====== LuCI2 (OpenWrt web user interface) ====== |
| | {{page>meta:infobox:outdated&noheader&nofooter&noeditbtn}} |
| | |
| | ==== NOTE: This page currently mixes the five+ years old abandoned original "luci2" and the new JavaScript based standard LuCI implementation. Information on this page can be partially misleading==== |
| | |
| |
| For years OpenWrt was using [[LuCI]], a web user interface written in [[http://en.wikipedia.org/wiki/Lua_(programming_language)|Lua]]. It required several Lua extensions (like ''ubus'', ''luci.model.uci'', ''nixio.fs'', etc.) to access system info and settings. Unfortunately this solution appeared to be quite resource consuming and didn't work well on devices with slow CPU and little amount of RAM. | For years OpenWrt was using [[LuCI]], a web user interface written in [[http://en.wikipedia.org/wiki/Lua_(programming_language)|Lua]]. It required several Lua extensions (like ''ubus'', ''luci.model.uci'', ''nixio.fs'', etc.) to access system info and settings. Unfortunately this solution appeared to be quite resource consuming and didn't work well on devices with slow CPU and little amount of RAM. |
| |
| This lead to developing LuCI2, a new web interface with a different architecture. It doesn't use Lua anymore, but static HTML page and [[http://en.wikipedia.org/wiki/XMLHttpRequest|JavaScript XHR]] method. It means building HTML pages is done on client (browser) side offloading OpenWrt device. To access any kind of system data [[ubus]] is used (with the help of [[ubus#access_to_ubus_over_http|uhttpd-mod-ubus]] to provide HTTP based API). | This led to developing LuCI2, a new web interface with a different architecture. It doesn't use Lua anymore, but static HTML page and [[http://en.wikipedia.org/wiki/XMLHttpRequest|JavaScript XHR]] method. It means building HTML pages is done on client (browser) side offloading OpenWrt device. To access any kind of system data [[ubus]] is used (with the help of [[ubus#access_to_ubus_over_http|uhttpd-mod-ubus]] to provide HTTP based API). |
| |
| LuCI2 is still experimental. Its predecessor is still used by default in all builds, including the trunk. | LuCI2 is still experimental. Its predecessor is still used by default in all builds, including the trunk. |
| console.log(memory); | console.log(memory); |
| });</code> | });</code> |
| |
| ==== How to test ==== | |
| Add new feed into "feeds.conf": | |
| <code> | |
| src-git luci2 git://git.openwrt.org/project/luci2/ui.git | |
| </code> | |
| |
| Install luci2 packages: | |
| <code>./scripts/feeds update | |
| ./scripts/feeds install luci2 | |
| </code> | |
| |
| Select package Luci2 in menuconfig and compile new image. | |
| |
| |
| ==== Dependencies of LuCI2 ==== | ==== Dependencies of LuCI2 ==== |
| The idea for LuCI2 and its different components started a long time ago: [[http://luci.subsignal.org/trac/browser/luci2]]; Code is being developed [[http://nbd.name/gitweb.cgi|here]]; | |
| |
| * ''[[docs:techref:libubox]]'' (~ 12KiB) is a general purpose library which provides things like an event loop, binary blob message formatting and handling, the Linux linked list implementation, and some JSON helpers. The functions in ''libubox'' are used to write the other software in LuCI2 | * ''[[docs:techref:libubox]]'' (~ 12KiB) is a general purpose library which provides things like an event loop, binary blob message formatting and handling, the Linux linked list implementation, and some JSON helpers. The functions in ''libubox'' are used to write the other software in LuCI2 |
| * ''[[docs:techref:ubox]]'' | * ''[[docs:techref:ubox]]'' |