Commit from LuCI Translation Portal by user jow.: 23 of 23 messages translated (0...
[project/luci.git] / applications / luci-qos / luasrc / model / cbi / qos / qosmini.lua
index 503ad10..0c5766f 100644 (file)
@@ -21,14 +21,19 @@ m = Map("qos")
 s = m:section(NamedSection, "wan", "interface", translate("Internet Connection"))
 
 s:option(Flag, "enabled", translate("Quality of Service"))
-s:option(Value, "download", translate("Downlink"), "kb/s")
-s:option(Value, "upload", translate("Uplink"), "kb/s")
+
+dl = s:option(Value, "download", translate("Downlink"), "kbit/s")
+dl.datatype = "and(uinteger,min(1))"
+
+ul = s:option(Value, "upload", translate("Uplink"), "kbit/s")
+ul.datatype = "and(uinteger,min(1))"
 
 s = m:section(TypedSection, "classify")
 s.template = "cbi/tblsection"
 
 s.anonymous = true
 s.addremove = true
+s.sortable  = true
 
 t = s:option(ListValue, "target")
 t:value("Priority", translate("priority"))
@@ -50,13 +55,20 @@ wa.cbi_add_knownips(dsth)
 l7 = s:option(ListValue, "layer7", translate("Service"))
 l7.rmempty = true
 l7:value("", translate("all"))
-local pats = fs.dir("/etc/l7-protocols")
+
+local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'")
 if pats then
-       for f in pats do
-               if f:sub(-4) == ".pat" then
-                       l7:value(f:sub(1, #f-4))
+       local l
+       while true do
+               l = pats:read("*l")
+               if not l then break end
+
+               l = l:match("([^/]+)%.pat$")
+               if l then
+                       l7:value(l)
                end
        end
+       pats:close()
 end
 
 p = s:option(ListValue, "proto", translate("Protocol"))