From 9c97cdb7b6edcc62d29a72ca64cd682503e693f6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 18 Oct 2011 13:20:43 +0000 Subject: modules/admin-full: better handle interfaces with unsupported protocols --- .../luasrc/view/admin_network/iface_overview.htm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'modules/admin-full/luasrc/view') diff --git a/modules/admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/admin-full/luasrc/view/admin_network/iface_overview.htm index 0ead36837f..21990bb7dd 100644 --- a/modules/admin-full/luasrc/view/admin_network/iface_overview.htm +++ b/modules/admin-full/luasrc/view/admin_network/iface_overview.htm @@ -113,7 +113,7 @@ $Id$ } var d = document.getElementById(ifc.id + '-ifc-description'); - if (d && ifc.ifname) + if (d && ifc.proto && ifc.ifname) { if (ifc.is_up) { @@ -164,6 +164,18 @@ $Id$ d.innerHTML = html; } + else if (d && !ifc.proto) + { + var e = document.getElementById(ifc.id + '-ifc-edit'); + if (e) + e.disabled = true; + + d.innerHTML = String.format( + '<%:Unsupported protocol type.%>
' + + '<%:Install protocol extensions...%>', + '<%=luci.dispatcher.build_url("admin/system/packages")%>?query=luci-proto&display=available' + ); + } else if (d) { d.innerHTML = '<%:Interface not present or not connected yet.%>'; @@ -214,7 +226,7 @@ $Id$ - '" title="<%:Edit this interface%>" value="<%:Edit%>" /> + '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net%>-ifc-edit" /> '" title="<%:Delete this interface%>" value="<%:Delete%>" /> -- cgit v1.2.3