效果:
在status栏增加两个入口Call Test 、View Test ;
点击call test可以调用函数将系统重启
点击view test 可以跳转网页到hello.htm
修改:
1、在文件 /usr/lib/lua/luci/controller/admin/status.lua中加入以下内容:
--add singcol
entry({"admin","status","test1"},call("func"),_("Call Test"),8)
entry({"admin","status","test2"},template("admin_status/hello"),_("View Test"),9)
2、在文件 /usr/lib/lua/luci/controller/admin/status.lua中加入以下内容:
function func()
luci.http.prepare_content("text/plain")
luci.http.write("My test call func :rebooting system now...!")
-- luci.sys.reboot()
end
3、在目录/usr/lib/lua/luci/view/admin_status中添加文件hello.htm
内容:
<%+header%>
<h1><%:Hello World%></h1>
<%+footer%>
4、重启系统