Changeset 2132


Ignore:
Timestamp:
Aug 21, 2012, 2:42:38 PM (6 years ago)
Author:
matthijs
Message:

luci: Only show existing interfaces in traffic status.

Before, alle networks in /etc/config/network were shown, even when the
corresponding interface did not exist (and thus produces no data). Since
the OpenVPN network is always listed in the configuration, but does not
exist when OpenVPN is not enabled, this would cause the status display
to break, since there was no data for the tun-ovpn interface (breaking
all others graphs as well).

This change makes sure that only graphs for existing interfaces are
shown, making the graphs work again when OpenVPN is enabled. I'm not
entirely sure when this got broken exactly, but this seems like the
proper fix for the problem.

Closes: #1137

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/luci/modules/admin-fon/luasrc/view/fon_status/main.htm

    r1597 r2132  
    1616        uci:foreach("network", "interface",
    1717                function(s)
    18                         if s.ifname ~= "lo" and s[".name"] ~= "hotspotwifi" then
     18                        if s.ifname ~= "lo" and s[".name"] ~= "hotspotwifi" and os.execute("ifconfig " .. s.ifname) == 0 then
    1919                                table.insert( interfaces,
    2020                                        "'" .. ( s.ifname or s['.name'] ) .. "'"
Note: See TracChangeset for help on using the changeset viewer.