From 56bff936e759d85cd6de765b1f4cf4f485497ab8 Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Fri, 17 Dec 2010 03:35:17 +0000 Subject: modules/freifunk: Fix a problem that happened when ipv6 was not enabled by adding checks --- .../luasrc/view/freifunk/public_status.htm | 93 ++++++++++++---------- 1 file changed, 50 insertions(+), 43 deletions(-) (limited to 'modules/freifunk/luasrc/view') diff --git a/modules/freifunk/luasrc/view/freifunk/public_status.htm b/modules/freifunk/luasrc/view/freifunk/public_status.htm index 5cfc0c72d5..94ca2cd21e 100644 --- a/modules/freifunk/luasrc/view/freifunk/public_status.htm +++ b/modules/freifunk/luasrc/view/freifunk/public_status.htm @@ -133,59 +133,66 @@ local defroutev6 = sys.net.defaultroute6 () u.innerHTML = st[i].mem; } - var u = document.getElementById('v4dst'); - if (u) - { - u.innerHTML = st[i].defroutev4.dest; - } - - var u = document.getElementById('v4gw'); - if (u) - { - u.innerHTML = st[i].defroutev4.gateway; - } - - var u = document.getElementById('v4dev'); - if (u) - { - u.innerHTML = st[i].defroutev4.dev; - } - - var u = document.getElementById('v4metr'); - if (u) - { - u.innerHTML = st[i].defroutev4.metr; - } - - var u = document.getElementById('v6dst'); - if (u) - { - u.innerHTML = st[i].defroutev6.dest; - } - - var u = document.getElementById('v6gw'); + var u = document.getElementById('dyntime'); if (u) { - u.innerHTML = st[i].defroutev6.gateway; + u.innerHTML = st[i].time; } - var u = document.getElementById('v6dev'); - if (u) + if (st[i].defroutev4) { - u.innerHTML = st[i].defroutev6.dev; + var u = document.getElementById('v4dst'); + if (u) + { + u.innerHTML = st[i].defroutev4.dest; + } + + var u = document.getElementById('v4gw'); + if (u) + { + u.innerHTML = st[i].defroutev4.gateway; + } + + var u = document.getElementById('v4dev'); + if (u) + { + u.innerHTML = st[i].defroutev4.dev; + } + + var u = document.getElementById('v4metr'); + if (u) + { + u.innerHTML = st[i].defroutev4.metr; + } } - var u = document.getElementById('v6metr'); - if (u) + if (st[i].defroutev6) { - u.innerHTML = st[i].defroutev6.metr; + var u = document.getElementById('v6dst'); + if (u) + { + u.innerHTML = st[i].defroutev6.dest; + } + + var u = document.getElementById('v6gw'); + if (u) + { + u.innerHTML = st[i].defroutev6.gateway; + } + + var u = document.getElementById('v6dev'); + if (u) + { + u.innerHTML = st[i].defroutev6.dev; + } + + var u = document.getElementById('v6metr'); + if (u) + { + u.innerHTML = st[i].defroutev6.metr; + } } - var u = document.getElementById('dyntime'); - if (u) - { - u.innerHTML = st[i].time; - } } window.setTimeout(update_wifi_status, <%=interval%>); } -- cgit v1.2.3