modules/admin-full: use get_wannet() and get_wan6net() to find wan networks on status...
[project/luci.git] / modules / admin-full / luasrc / view / admin_status / index.htm
index e54ee9a..1ef90ad 100644 (file)
@@ -24,19 +24,8 @@ $Id$
 
        if luci.http.formvalue("status") == "1" then
                local ntm = require "luci.model.network".init()
-               local dr4 = luci.sys.net.defaultroute()
-               local dr6 = luci.sys.net.defaultroute6()
-               local wan, wan6
-
-               if dr4 and dr4.device then
-                       wan = ntm:get_interface(dr4.device)
-                       wan = wan and wan:get_network()
-               end
-
-               if dr6 and dr6.device then
-                       wan6 = ntm:get_interface(dr6.device)
-                       wan6 = wan6 and wan6:get_network()
-               end
+               local wan = ntm:get_wannet()
+               local wan6 = ntm:get_wan6net()
 
                local _, _, memtotal, memcached, membuffers, memfree = luci.sys.sysinfo()
 
@@ -176,7 +165,7 @@ $Id$
                        else
                        {
                                si.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
-                               ss.innerHTML = '<em>Not connected</em>';
+                               ss.innerHTML = '<em><%:Not connected%></em>';
                        }
 
                        <% if has_ipv6 then %>
@@ -219,7 +208,7 @@ $Id$
                        else
                        {
                                si6.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
-                               ss6.innerHTML = '<em>Not connected</em>';
+                               ss6.innerHTML = '<em><%:Not connected%></em>';
                        }
                        <% end %>