summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full/luasrc
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-10-18 13:20:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-10-18 13:20:43 +0000
commit9c97cdb7b6edcc62d29a72ca64cd682503e693f6 (patch)
treebc679e53137a5e00bad8c6480417ee9b5acc807a /modules/admin-full/luasrc
parent0efea1babc41a888c307af6d79cfd1447b32dde6 (diff)
modules/admin-full: better handle interfaces with unsupported protocols
Diffstat (limited to 'modules/admin-full/luasrc')
-rw-r--r--modules/admin-full/luasrc/controller/admin/network.lua6
-rw-r--r--modules/admin-full/luasrc/view/admin_network/iface_overview.htm16
2 files changed, 20 insertions, 2 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua
index 9d9aab4a2c..1e6892e16e 100644
--- a/modules/admin-full/luasrc/controller/admin/network.lua
+++ b/modules/admin-full/luasrc/controller/admin/network.lua
@@ -269,6 +269,12 @@ function iface_status()
end
rv[#rv+1] = data
+ else
+ rv[#rv+1] = {
+ id = iface,
+ name = iface,
+ type = "ethernet"
+ }
end
end
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(
+ '<em><%:Unsupported protocol type.%></em><br />' +
+ '<a href="%h"><%:Install protocol extensions...%></a>',
+ '<%=luci.dispatcher.build_url("admin/system/packages")%>?query=luci-proto&display=available'
+ );
+ }
else if (d)
{
d.innerHTML = '<em><%:Interface not present or not connected yet.%></em>';
@@ -214,7 +226,7 @@ $Id$
<td style="width:420px">
<input type="button" class="cbi-button cbi-button-add" style="width:100px; background-image:url(<%=resource%>/cbi/reload.gif)" onclick="iface_shutdown('<%=net%>', true)" title="<%:Reconnect this interface%>" value="<%:Connect%>" />
<input type="button" class="cbi-button cbi-button-add" style="width:100px; background-image:url(<%=resource%>/cbi/reset.gif)" onclick="iface_shutdown('<%=net%>', false)" title="<%:Shutdown this interface%>" value="<%:Stop%>" />
- <input type="button" class="cbi-button cbi-button-add" style="width:100px; background-image:url(<%=resource%>/cbi/edit.gif)" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/network", net)%>'" title="<%:Edit this interface%>" value="<%:Edit%>" />
+ <input type="button" class="cbi-button cbi-button-add" style="width:100px; background-image:url(<%=resource%>/cbi/edit.gif)" onclick="location.href='<%=luci.dispatcher.build_url("admin/network/network", net)%>'" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net%>-ifc-edit" />
<input type="button" class="cbi-button cbi-button-add" style="width:100px; background-image:url(<%=resource%>/cbi/remove.gif)" onclick="if (confirm('<%:Really delete this interface? The deletion cannot be undone!\nYou might lose access to this router if you are connected via this interface.%>')) location.href='<%=luci.dispatcher.build_url("admin/network/iface_delete", net)%>'" title="<%:Delete this interface%>" value="<%:Delete%>" />
</td>
</tr>