diff options
Diffstat (limited to 'applications/luci-qos')
-rw-r--r-- | applications/luci-qos/luasrc/controller/qos.lua | 4 | ||||
-rw-r--r-- | applications/luci-qos/luasrc/model/cbi/qos/qos.lua | 13 | ||||
-rw-r--r-- | applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua | 13 |
3 files changed, 18 insertions, 12 deletions
diff --git a/applications/luci-qos/luasrc/controller/qos.lua b/applications/luci-qos/luasrc/controller/qos.lua index 970dd3d60..af9b11499 100644 --- a/applications/luci-qos/luasrc/controller/qos.lua +++ b/applications/luci-qos/luasrc/controller/qos.lua @@ -14,7 +14,7 @@ $Id$ module("luci.controller.qos", package.seeall) function index() - if not luci.fs.access("/etc/config/qos") then + if not nixio.fs.access("/etc/config/qos") then return end @@ -26,4 +26,4 @@ function index() local page = entry({"mini", "network", "qos"}, cbi("qos/qosmini", {autoapply=true}), "QoS") page.i18n = "qos" page.dependent = true -end
\ No newline at end of file +end diff --git a/applications/luci-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-qos/luasrc/model/cbi/qos/qos.lua index 22dfbea5f..ec450cf6e 100644 --- a/applications/luci-qos/luasrc/model/cbi/qos/qos.lua +++ b/applications/luci-qos/luasrc/model/cbi/qos/qos.lua @@ -11,7 +11,10 @@ You may obtain a copy of the License at $Id$ ]]-- -require("luci.tools.webadmin") + +local wa = require "luci.tools.webadmin" +local fs = require "nixio.fs" + m = Map("qos") s = m:section(TypedSection, "interface", translate("interfaces")) @@ -46,19 +49,19 @@ t.default = "Normal" srch = s:option(Value, "srchost") srch.rmempty = true srch:value("", translate("all")) -luci.tools.webadmin.cbi_add_knownips(srch) +wa.cbi_add_knownips(srch) dsth = s:option(Value, "dsthost") dsth.rmempty = true dsth:value("", translate("all")) -luci.tools.webadmin.cbi_add_knownips(dsth) +wa.cbi_add_knownips(dsth) l7 = s:option(ListValue, "layer7", translate("service")) l7.rmempty = true l7:value("", translate("all")) -local pats = luci.fs.dir("/etc/l7-protocols") +local pats = fs.dir("/etc/l7-protocols") if pats then - for i,f in ipairs(pats) do + for f in pats do if f:sub(-4) == ".pat" then l7:value(f:sub(1, #f-4)) end diff --git a/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua b/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua index ec93694c2..cb7968264 100644 --- a/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua +++ b/applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua @@ -12,7 +12,10 @@ You may obtain a copy of the License at $Id$ ]]-- -require("luci.tools.webadmin") + +local wa = require "luci.tools.webadmin" +local fs = require "nixio.fs" + m = Map("qos") s = m:section(NamedSection, "wan", "interface", translate("m_n_inet")) @@ -37,19 +40,19 @@ t.default = "Normal" srch = s:option(Value, "srchost") srch.rmempty = true srch:value("", translate("all")) -luci.tools.webadmin.cbi_add_knownips(srch) +wa.cbi_add_knownips(srch) dsth = s:option(Value, "dsthost") dsth.rmempty = true dsth:value("", translate("all")) -luci.tools.webadmin.cbi_add_knownips(dsth) +wa.cbi_add_knownips(dsth) l7 = s:option(ListValue, "layer7", translate("service")) l7.rmempty = true l7:value("", translate("all")) -local pats = luci.fs.dir("/etc/l7-protocols") +local pats = fs.dir("/etc/l7-protocols") if pats then - for i,f in ipairs(pats) do + for f in pats do if f:sub(-4) == ".pat" then l7:value(f:sub(1, #f-4)) end |