|
本帖最后由 wulishui 于 2019-10-13 15:50 编辑
小弟身体出问题了,没什么心情也没什么精力,只粗略说一下
1.先说编译源码的修改
/package/0_NAS/luci-app-baidupcs-web/luasrc/controller
module("luci.controller.baidupcs-web", package.seeall)
function index()
if not nixio.fs.access("/etc/config/baidupcs-web") then
return
end
entry({"admin", "download"}, firstchild(), "Download", 46).dependent = false ########新增这一行,就会在菜单栏上添加一个新的Download菜单,46是这个菜单排列的位置,可以改变以调节在services和network之间或之后,如果要把Download显示成“下载”,还需要到/po/zh-cn的po文件按格式增加一个中文翻译。
local page
page = entry({"admin", "download", "baidupcs-web"}, cbi("baidupcs-web"), _("百度网盘管理"), 100) #######这一行中的"download"说明这个app菜单出现在Download下,名称为"百度网盘管理"(可以用中、英文)。
page.dependent = true
end
###有些更复杂,比如aria2:要把所有"admin"后面的都要改成download,然后luasrc下所有文件都要一个个打开来看,有看到这种绝对路径的都要修改(包括"admin/download/xxx"这种都要改),不然出现不能运行的情况。
local fs = require "nixio.fs"
local sys = require "luci.sys"
local http = require "luci.http"
local util = require "luci.util"
local uci = require "luci.model.uci".cursor()
module("luci.controller.aria2", package.seeall)
function index()
if not nixio.fs.access("/etc/config/aria2") then
return
end
entry({"admin", "download", "aria2"},
firstchild(), _("Aria2")).dependent = false
entry({"admin", "download", "aria2", "config"},
cbi("aria2/config"), _("Configuration"), 1)
entry({"admin", "download", "aria2", "file"},
form("aria2/files"), _("Files"), 2)
entry({"admin", "download", "aria2", "log"},
firstchild(), _("Log"), 3)
entry({"admin", "download", "aria2", "log", "view"},
template("aria2/log_template"))
entry({"admin", "download", "aria2", "log", "read"},
call("action_log_read"))
entry({"admin", "download", "aria2", "status"},
call("action_status"))
end
2.已经刷好的固件里面也是可以修改的,方法同样,只是新增的菜单你无法添加中文翻译。用winscp登录,进入目录usr/lib/lua/luci/controller,找到你要改的luci文件,改了之后刷新一下界面就出来了。
我的rom的菜单是这样的
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
评分
-
查看全部评分
|