diff options
author | Florian Eckert <fe@dev.tdt.de> | 2019-01-21 14:18:12 +0100 |
---|---|---|
committer | Florian Eckert <fe@dev.tdt.de> | 2019-01-21 14:44:06 +0100 |
commit | b8aa3ebced39a9e82dbd3751d5ed28092aa02233 (patch) | |
tree | fe22db34e3726a226ab91897ea69005f701ecd83 /applications/luci-app-statistics | |
parent | 6e8c99714edb8aedc57f6c2bf5efa833a1559f6c (diff) |
luci-app-statistics: only include lua modules into local scope
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-statistics')
5 files changed, 12 insertions, 13 deletions
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua index 663a3f12d..b380febac 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua @@ -1,7 +1,7 @@ -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. -require("luci.sys") +local sys = require("luci.sys") m = Map("luci_statistics", @@ -17,7 +17,7 @@ s = m:section( NamedSection, "collectd", "luci_statistics" ) -- general.hostname (Hostname) hostname = s:option( Value, "Hostname", translate("Hostname") ) -hostname.default = luci.sys.hostname() +hostname.default = sys.hostname() hostname.optional = true -- general.basedir (BaseDir) diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua index dafcc452c..424501866 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua @@ -1,7 +1,7 @@ -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. -require("luci.sys") +local sys = require("luci.sys") m = Map("luci_statistics", @@ -24,7 +24,7 @@ interfaces.widget = "select" interfaces.size = 5 interfaces:depends( "enable", 1 ) interfaces:value("any") -for k, v in pairs(luci.sys.net.devices()) do +for k, v in pairs(sys.net.devices()) do interfaces:value(v) end diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua index 752212f4d..60c88d072 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua @@ -1,7 +1,7 @@ -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. -require("luci.sys") +local sys = require("luci.sys") m = Map("luci_statistics", @@ -23,7 +23,7 @@ interfaces = s:option( MultiValue, "Interfaces", translate("Monitor interfaces") interfaces.widget = "select" interfaces.size = 5 interfaces:depends( "enable", 1 ) -for k, v in pairs(luci.sys.net.devices()) do +for k, v in pairs(sys.net.devices()) do interfaces:value(v) end diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua index ded3f7f99..375a15bf1 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua @@ -1,13 +1,12 @@ -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. -require("luci.sys.iptparser") +local ip = require("luci.sys.iptparser").IptParser() -ip = luci.sys.iptparser.IptParser() -chains = { } -targets = { } +local chains = { } +local targets = { } -for i, rule in ipairs( ip:find() ) do +for i, rule in ipairs( ip:find() ) do if rule.chain and rule.target then chains[rule.chain] = true targets[rule.target] = true diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua index 66449ec46..784ad1fdb 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua @@ -1,9 +1,9 @@ -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org> -- Licensed to the public under the Apache License 2.0. -require("luci.sys") +local sys = require("luci.sys") -local devices = luci.sys.net.devices() +local devices = sys.net.devices() m = Map("luci_statistics", |