当前位置:首页 > 知识探索 > 正文

修改luci-app-frpc让其设置http/https支持远程端口

简介修改 /usr/lib/lua/luci/model/cbi/frp 下的 basic.lua和config.lua 修...

修改

/usr/lib/lua/luci/model/cbi/frp

下的

basic.lua和config.lua

修改basic.lua

搜索定位到 e = t:option(DummyValue, "remote_port", translate("Remote Port"))

修改这段为

e = t:option(DummyValue, "remote_port", translate("Remote Port"))
e.width = "10%"
e.cfgvalue = function(t,b)
local t = a.uci:get(i,b,"type")or""
if t==""or b==""then return""end
if t=="tcp" or t=="udp" or t=="http" or t=="https" then
local b = a.uci:get(i,b,"remote_port")or"" return b end
end

修改config.lua

搜索定位到 e = t:taboption("base", Value, "remote_port", translate("Remote Port"))

修改这段为

e = t:taboption("base", Value, "remote_port", translate("Remote Port"))
e.datatype = "port"
e:depends("type", "tcp")
e:depends("type", "udp")
e:depends("type", "http")
e:depends("type", "https")

OK大功告成

 修改luci-app-frpc让其设置http/https支持远程端口 知识探索

发表评论