blob: 156fa81fcc4a11514d6da254458237f6b19a9d27 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<% local data, viewlibrary, page_info, session = ...
require("htmlviewfunctions")
%>
<% htmlviewfunctions.displaycommandresults({"enable","config","expert","startstop"}, session) %>
<% viewlibrary.dispatch_component("status") %>
<H2><%= html.html_escape(data.label) %></H2>
<DL><TABLE>
<TR style="background:#eee;font-weight:bold;">
<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Interface</TD>
<TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Status</TD>
<TD style="white-space:nowrap;text-align:left;" class="header"></TD>
</TR>
<% for i,intf in ipairs(data.value) do %>
<TR>
<TD style="padding-right:20px;white-space:nowrap;">
<% if intf.enabled then %>
<% io.write(html.link{value = "config?DEV="..intf.interface.."&redir="..page_info.orig_action, label="Edit " }) %>
<% io.write(html.link{value = "expert?interface="..intf.interface.."&redir="..page_info.orig_action, label="Expert " }) %>
<% io.write(html.link{value = page_info.script .. "/alpine-baselayout/rc/edit?servicename="..intf.init.."&redir=".. page_info.orig_action, label="Autostart " }) %>
<% else %>
<% io.write(html.link{value = "enable?interface="..intf.interface.."&redir="..page_info.orig_action, label="Enable " }) %>
<% end %>
</TD>
<TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(intf.interface) %></TD>
<TD style="white-space:nowrap;" width="90%"><%= html.html_escape(intf.status) %></TD>
<% if intf.enabled then %>
<TD><form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/startstop") %>" method="POST">
<input type="hidden" name="init" value="<%= intf.init %>">
<input class="submit" type="submit" name="action" value="Start">
<input class="submit" type="submit" name="action" value="Stop">
<input class="submit" type="submit" name="action" value="Restart">
</form></TD>
<% end %>
</TR>
<% end %>
</TABLE></DL>
|