luci-app-statistics: only include lua modules into local scope

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2019-01-21 14:18:12 +01:00
parent 6e8c99714e
commit b8aa3ebced
5 changed files with 12 additions and 13 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -1,11 +1,10 @@
-- 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
if rule.chain and rule.target then

View file

@ -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",