s.addremove = true
t = s:option(ListValue, "target")
-t:value("Priority")
-t:value("Express")
-t:value("Normal")
-t:value("Bulk")
+t:value("Priority", translate("qos_priority"))
+t:value("Express", translate("qos_express"))
+t:value("Normal", translate("qos_normal"))
+t:value("Bulk", translate("qos_bulk"))
t.default = "Normal"
s:option(Value, "srchost").optional = true
s:option(Value, "dsthost").optional = true
-s:option(Value, "layer7", "Layer 7").optional = true
+
+l7 = s:option(ListValue, "layer7", translate("service"))
+l7.optional = true
+l7:value("")
+local pats = luci.fs.dir("/etc/l7-protocols")
+if pats then
+ for i,f in ipairs(pats) do
+ if f:sub(-4) == ".pat" then
+ l7:value(f:sub(1, #f-4))
+ end
+ end
+end
p2p = s:option(ListValue, "ipp2p", "P2P")
p2p:value("")