X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-mod-admin-full%2Fluasrc%2Fview%2Fadmin_network%2Fiface_overview.htm;h=2512a35b3cdfd5ebf9f0c11b1764f651f0e6b0ac;hp=1de349856ee1b7a1ce07d954ca2b909c1015a9d6;hb=a1ee8e16b66ac9f0c6bf8b7b5f421f79cf1e1587;hpb=41d2b33087da393453c45f5d923d690c88ee5474 diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm index 1de349856..2512a35b3 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm @@ -49,7 +49,7 @@ s.innerHTML = '<%:Waiting for changes to be applied...%>'; } - XHR.get('<%=luci.dispatcher.build_url("admin", "network")%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, null, + (new XHR()).post('<%=url('admin/network')%>/iface_' + (reconnect ? 'reconnect' : 'shutdown') + '/' + id, { token: '<%=token%>' }, function(x) { if (s) @@ -66,12 +66,22 @@ ); } + function iface_delete(id) { + if (!confirm('<%:Really delete this interface? The deletion cannot be undone!\nYou might lose access to this device if you are connected via this interface.%>')) + return; + + (new XHR()).post('<%=url('admin/network/iface_delete')%>/' + id, { token: '<%=token%>' }, + function(x) { + location.href = '<%=url('admin/network/network')%>'; + } + ); + } var iwxhr = new XHR(); var wifidevs = <%=luci.http.write_json(netdevs)%>; var arptable = <%=luci.http.write_json(arpcache)%>; - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(ifaces, ","))%>', null, + XHR.poll(5, '<%=url('admin/network/iface_status', table.concat(ifaces, ","))%>', null, function(x, ifcs) { if (ifcs) @@ -125,7 +135,7 @@ html += String.format('<%:Uptime%>: %t
', ifc.uptime); } - if (ifc.type != 'tunnel') + if (ifc.macaddr) { html += String.format('<%:MAC-Address%>: %s
', ifc.macaddr); } @@ -139,32 +149,25 @@ if (ifc.ipaddrs && ifc.ipaddrs.length) { - html += '<%:IPv4%>: '; - for (var i = 0; i < ifc.ipaddrs.length; i++) html += String.format( - '%s%s/%d', - i ? ', ' : '', - ifc.ipaddrs[i].addr, - ifc.ipaddrs[i].prefix + '<%:IPv4%>: %s
', + ifc.ipaddrs[i] ); - - html += '
'; } if (ifc.ip6addrs && ifc.ip6addrs.length) { - html += '<%:IPv6%>: '; - for (var i = 0; i < ifc.ip6addrs.length; i++) html += String.format( - '%s%s/%d', - i ? ', ' : '', - ifc.ip6addrs[i].addr.toUpperCase(), - ifc.ip6addrs[i].prefix + '<%:IPv6%>: %s
', + ifc.ip6addrs[i] ); - - html += '
'; + } + + if (ifc.ip6prefix) + { + html += String.format('<%:IPv6-PD%>: %s
', ifc.ip6prefix); } d.innerHTML = html; @@ -178,14 +181,14 @@ d.innerHTML = String.format( '<%:Unsupported protocol type.%>
' + '<%:Install protocol extensions...%>', - '<%=luci.dispatcher.build_url("admin/system/packages")%>?query=luci-proto&display=available' + '<%=url("admin/system/packages")%>?query=luci-proto&display=available' ); } else if (d && !ifc.ifname) { d.innerHTML = String.format( '<%:Network without interfaces.%>
' + - '?tab.network.%s=physical"><%:Assign interfaces...%>', + '?tab.network.%s=physical"><%:Assign interfaces...%>', ifc.name, ifc.name ); } @@ -239,13 +242,13 @@ - '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" /> - '" title="<%:Delete this interface%>" value="<%:Delete%>" /> + '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" /> + <% end %> - '" /> + '" />