summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-qos/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-07-19 00:24:58 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-07-19 00:24:58 +0000
commit8fcd841aa9af96c8a4a4d3c1a555d2d1ed42332c (patch)
treecf6466b373236442e63742cb4f73b22579940784 /applications/luci-qos/luasrc
parent6abba6163290b58cd9ebae98d8459ac38ef52a4b (diff)
convert luci.fs users to nixio.fs api
Diffstat (limited to 'applications/luci-qos/luasrc')
-rw-r--r--applications/luci-qos/luasrc/controller/qos.lua4
-rw-r--r--applications/luci-qos/luasrc/model/cbi/qos/qos.lua13
-rw-r--r--applications/luci-qos/luasrc/model/cbi/qos/qosmini.lua13
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