如何在 OpenWRT Luci Web Interface 中添加新页面?

Posted

技术标签:

【中文标题】如何在 OpenWRT Luci Web Interface 中添加新页面?【英文标题】:How to add new pages in OpenWRT Luci Web Interface? 【发布时间】:2017-09-20 17:26:10 【问题描述】:

我是 Luci openwrt 的新手。我想在 openwrt Luci Web Interface 添加一个新页面或新标签。这是现有的 WebUI 界面,我想添加一个标记为红色文本的 page1。

我可以看到 lib/lua/luci/controller/admin path 中的所有主页。比如/usr/lib/lua/luci/controller/admin/status.lua。它是/usr/lib/lua/luci/view/admin_status/syslog.htm 中的查看页面代码。这可以 。我明白。 这些是我的疑问:

现在我想知道如何在 lib/lua/luci/controller/admin 。我可以添加喜欢吗 lib/lua/luci/controller/admin/page1.lua 它的视图就像 /usr/lib/lua/luci/view/admin_status/page1.htm ?

我在哪里可以得到 Luci 中的主要 html 页面?

我应该遵循哪些步骤在 openwrt 中添加新页面?有什么建议 ?

【问题讨论】:

我不是 Luci 专家,但我可以回答你的第二个问题,一旦你编译了 openwrt 构建,你可以在 "Openwrt/stagging_dir/target_...target_board/架构/root_board_type/www" 目录。 【参考方案1】:

我通过在 /lua/luci/controller/admin 中添加新的 .lua 代码解决了

【讨论】:

以上是关于如何在 OpenWRT Luci Web Interface 中添加新页面?的主要内容,如果未能解决你的问题,请参考以下文章

openwrt luci web分析

更新openwrt web界面luci中的变量信息

如何利用openwrt的web配置界面来配置端口映射

如何为 OpenWrt 自定义 Luci UI?

OpenWRT Luci 持久安装

OpenWRT UCI API的使用