applications/luci-statistics: cope with uci list values, thanks Bluse for reporting...
[project/luci.git] / applications / luci-statistics / root / usr / bin / stat-genconfig
index 4c396ff..171c1ae 100755 (executable)
@@ -208,6 +208,13 @@ function _expand( s, n, nopad )
                end
 
                return str
+
+       elseif type(s) == "table" then
+               local str = ""
+
+               for i, v in ipairs(s) do
+                       str = str .. _string( v, n, nopad )
+               end
        end
 end
 
@@ -233,8 +240,8 @@ function _string( s, n, nopad )
        if not nopad then pad = "\t" end
 
        if s then
-               if s:find("[^%d]") then
-                       if not s:find("[^%w]") then
+               if s:find("[^%d]") or n == "Port" then
+                       if not s:find("[^%w]") and n ~= "Port" then
                                str = pad .. n .. " " .. luci.util.trim(s)
                        else
                                str = pad .. n .. ' "' .. luci.util.trim(s) .. '"'
@@ -257,6 +264,12 @@ plugins = {
                { }
        },
 
+       conntrack = {
+               { },
+               { },
+               { }
+       },
+
        cpu     = {
                { },
                { },
@@ -309,6 +322,12 @@ plugins = {
                { "Irqs" }
        },
 
+       iwinfo = {
+               { },
+               { "IgnoreSelected" },
+               { "Interfaces" }
+       },
+
        load    = {
                { },
                { },
@@ -321,6 +340,18 @@ plugins = {
                { }
        },
 
+       madwifi = {
+               { "WatchSet" },
+               { },
+               { "Interfaces", "WatchAdds" }
+       },
+
+       memory = { 
+               { },
+               { },
+               { }
+       },
+
        netlink = {
                { },
                { "IgnoreSelected" },
@@ -329,6 +360,12 @@ plugins = {
 
        network = config_network,
 
+       olsrd = {
+               { "Host", "Port", "CollectLinks","CollectRoutes","CollectTopology"},
+               { },
+               { }
+       },
+
        ping    = {
                { "TTL", "Interval" },
                { },