diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua index 6b4319ef9..d825e8786 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl.lua @@ -48,7 +48,7 @@ o = s:option(DummyValue, "sources", translate("Source")) o.rawhtml = true o.cfgvalue = function(t, n) local e = '' - local v = Value.cfgvalue(t, n) or '' + local v = Value.cfgvalue(t, n) or '-' string.gsub(v, '[^' .. " " .. ']+', function(w) local a = w if mac_t[w] then @@ -62,6 +62,12 @@ o.cfgvalue = function(t, n) return e end +o = s:option(DummyValue, "interface", translate("Source Interface")) +o.cfgvalue = function(t, n) + local v = Value.cfgvalue(t, n) or '-' + return v +end + --[[ ---- TCP No Redir Ports o = s:option(Value, "tcp_no_redir_ports", translate("TCP No Redir Ports")) diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua index aaddfb65f..3bce1c883 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua @@ -54,6 +54,10 @@ o = s:option(Value, "remarks", translate("Remarks")) o.default = arg[1] o.rmempty = true +o = s:option(Flag, "use_interface", translate("Use Interface With ACLs")) +o.default = 0 +o.rmempty = false + local mac_t = {} sys.net.mac_hints(function(e, t) mac_t[#mac_t + 1] = { @@ -74,6 +78,17 @@ table.sort(mac_t, function(a,b) return false end) +local device_list = {} +device_list = sys.net.devices() +table.sort(device_list) +interface = s:option(ListValue, "interface", translate("Source Interface")) + +for k, name in ipairs(device_list) do + interface:value(name) +end + +interface:depends({ use_interface = 1 }) + ---- Source sources = s:option(DynamicList, "sources", translate("Source")) sources.description = "