% local view, viewlibrary, page_info, session = ...
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
<% showoption = function(option)
if option.errtxt or option.value ~= "" then %>
<%= html.html_escape(option.label) %> |
>
<%= string.gsub(html.html_escape(tostring(option.value)), "\n", " ") %>
<% if option.errtxt then io.write(" "..html.html_escape(option.errtxt)) end %>
|
<% end %>
<% end %>
<% htmlviewfunctions.displaycommandresults({"update", "delete", "ifup", "ifdown", "restart"}, session) %>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("status")
end %>
<% htmlviewfunctions.displayheader(view, page_info) %>
<% for i,entry in ipairs(view.value) do
local interface = entry.value %>
 %>/tango/16x16/devices/network-wired.png)
<%= html.html_escape(interface.name.value) %>
<% if viewlibrary.check_permission("update") or viewlibrary.check_permission("delete") or viewlibrary.check_permission("ifup") or viewlibrary.check_permission("ifdown") then %>
<% if viewlibrary.check_permission("update") then %>
Edit
<% end
if viewlibrary.check_permission("delete") then %>
Delete
<% end
if viewlibrary.check_permission("ifup") then %>
ifup
<% end
if viewlibrary.check_permission("ifdown") then %>
ifdown
<% end %>
|
<% end %>
<%
showoption(interface.family)
if interface.method then showoption(interface.method) end
for name,option in pairs(interface) do
if name~="name" and name~="family" and name~="method" then
showoption(option)
end
end %>
<% end %>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("restart")
end %>