mirror of
https://github.com/openwrt/luci.git
synced 2026-08-29 08:31:46 +04:00
applications/luci-statistics: avoid global vars, avoid nil indexing, get rid of counter variable
This commit is contained in:
@@ -196,10 +196,12 @@ end
|
||||
function Instance.host_instances( self )
|
||||
local hosts_path = fs.glob(self._rrddir..'/*')
|
||||
local hosts = { }
|
||||
k = 1
|
||||
for v in hosts_path do
|
||||
hosts[k] = fs.basename(v)
|
||||
k=k+1
|
||||
|
||||
if hosts_path then
|
||||
local path
|
||||
for path in hosts_path do
|
||||
hosts[#hosts+1] = fs.basename(path)
|
||||
end
|
||||
end
|
||||
|
||||
return hosts
|
||||
|
||||
Reference in New Issue
Block a user