applications/luci-qos: revert accidentally committed tbl layout change
[project/luci.git] / applications / luci-qos / luasrc / model / cbi / qos / qos.lua
index 026099e..8d852e7 100644 (file)
@@ -24,7 +24,8 @@ s = m:section(TypedSection, "interface", translate("Interfaces"))
 s.addremove = true
 s.anonymous = false
 
-s:option(Flag, "enabled", translate("Enable"))
+e = s:option(Flag, "enabled", translate("Enable"))
+e.rmempty = false
 
 c = s:option(ListValue, "classgroup", translate("Classification group"))
 c:value("Default", translate("default"))
@@ -34,9 +35,9 @@ s:option(Flag, "overhead", translate("Calculate overhead"))
 
 s:option(Flag, "halfduplex", translate("Half-duplex"))
 
-s:option(Value, "download", translate("Download speed (kb/s)"))
+s:option(Value, "download", translate("Download speed (kbit/s)"))
 
-s:option(Value, "upload", translate("Upload speed (kb/s)"))
+s:option(Value, "upload", translate("Upload speed (kbit/s)"))
 
 s = m:section(TypedSection, "classify", translate("Classification Rules"))
 s.template = "cbi/tblsection"
@@ -63,13 +64,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(Value, "proto", translate("Protocol"))