转载有道:http://blog.youkuaiyun.com/u013131156/article/details/45824203
说明:目前先保留来下自己使用,尚未亲测、。
LuCI 页面修改
简单的文件配置,路由上路径主要是
/usr/lib/lua/luci/
下子目录:/controller/
、/model/cbi/
、/view/
,或者根目录下的/www/
中.可以在路上修改查看效果.
如果想要编译自定义LuCI页面的固件,请尝试修改如下OpenWRT源码结构路径内的LuCI文件.
xxx/package/feeds/luci/luci/luci/libs/web/root/etc/config/luci --- AA 版本pakages/feeds/luci/中
xxx\feeds\luci\luci\luci\libs\web\root\etc\config\luci --- AA 版本的feeds/luci文件夹中
xxx/feeds/luci/modules/base/root/etc/config/luci --- BB 版本中feeds中,bb版本open修改了luci配置文件路径,并且pakages/feeds路径中也没有luci配置文件了.不知道这个路径是不是正确的.
再者就是修改 xxx/dl/ 下的源码压缩包,或者 xxx/build_dir/$target/下源码
注意
:如果在xxx/feeds 修改可能需要执行 ./scripts/feeds install luci 更新
主题Logo替换
源码路径:xxx/feeds/luci/luci/luci/themes/bootstrap/htdocs/luci-static/bootstrap/logo.jpg
路由路径:/www/luci-static/bootstrap/logo.jpg
Tips:
由于版本的更新,文件路径可能变更,此处列出的为BB版本的例子.如果找不到可以用命令手动在/feeds/中查找:find ./ -name logo.jpg.此处为bootstrap主题Logo,其他主题的Logo修改类似.
页面脚标信息
源码路径:xxx/feeds/luci/luci/luci/themes/bootstrap/luasrc/view/themes/bootstrap/footer.htm
路由路径:/usr/lib/lua/luci/view/themes/bootstrap/footer.htm
修改位置:
Powered by <%= luci.__appname__ .. " (" .. luci.__version__ .. ")" %>
<%=luci.version.distversion%>
status状态栏信息
源码路径:xxx/feeds/luci/modules/admin-full/luasrc/view/admin_status/index.htm
路由路径:/usr/lib/lua/luci/view/admin_status/index.html
修改位置:找到类似的代码段修改.
<%:System%>
<%:Hostname%><%=luci.sys.hostname() or "?"%>
<%:Model%><%=pcdata(model or "?")%>
<%:Firmware Version%>
<%=pcdata(luci.version.distname)%> <%=pcdata(luci.version.distversion)%> /
<%=pcdata(luci.version.luciname)%> (<%=pcdata(luci.version.luciversion)%>)
<%:Kernel Version%><%=luci.sys.exec("uname -r")%>
<%:Local Time%>-
<%:Uptime%>-
<%:Load Average%>-