applications/luci-firewall: fix rule table formatting, add mac & ip hints to various...
[project/luci.git] / applications / luci-firewall / luasrc / model / cbi / firewall / forward-details.lua
index c3618ec01b665dd1b6b353d52e3297120e69a1f2..162767f4db8c3cc82d4d7ed1b0786de86706de7c 100644 (file)
@@ -91,6 +91,10 @@ o.rmempty = true
 o.datatype = "macaddr"
 o.placeholder = translate("any")
 
+luci.sys.net.mac_hints(function(mac, name)
+       o:value(mac, "%s (%s)" %{ mac, name })
+end)
+
 
 o = s:option(Value, "src_ip",
        translate("Source IP address"),
@@ -99,6 +103,10 @@ o.rmempty = true
 o.datatype = "neg(ip4addr)"
 o.placeholder = translate("any")
 
+luci.sys.net.ipv4_hints(function(ip, name)
+       o:value(ip, "%s (%s)" %{ ip, name })
+end)
+
 
 o = s:option(Value, "src_port",
        translate("Source port"),
@@ -112,6 +120,11 @@ o = s:option(Value, "src_dip",
        translate("External IP address"),
        translate("Only match incoming traffic directed at the given IP address."))
 
+luci.sys.net.ipv4_hints(function(ip, name)
+       o:value(ip, "%s (%s)" %{ ip, name })
+end)
+
+
 o.rmempty = true
 o.datatype = "ip4addr"
 o.placeholder = translate("any")
@@ -134,9 +147,10 @@ o = s:option(Value, "dest_ip", translate("Internal IP address"),
        translate("Redirect matched incoming traffic to the specified \
                internal host"))
 o.datatype = "ip4addr"
-for i, dataset in ipairs(sys.net.arptable()) do
-       o:value(dataset["IP address"])
-end
+
+luci.sys.net.ipv4_hints(function(ip, name)
+       o:value(ip, "%s (%s)" %{ ip, name })
+end)
 
 
 o = s:option(Value, "dest_port",