summaryrefslogtreecommitdiffstats
path: root/qos-details-html.lsp
blob: 50f488b4e828e0c7bac6d3dd7088abefe7481ccb (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
41
<% local data, viewlibrary, page_info, session = ... 
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>

<% htmlviewfunctions.displaycommandresults({"enable","config","expert","startstopinterface"}, 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?filename="..intf.filename.."&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?submit=true&interface="..intf.interface, 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 .. "/startstopinterface") %>" method="POST">
			<input type="hidden" name="init" value="<%= intf.init %>">
			<input class="submit" type="submit" name="submit" value="Start">
			<input class="submit" type="submit" name="submit" value="Stop">
			<input class="submit" type="submit" name="submit" value="Restart">
			</form></TD>
		<% end %>
	</TR>
<% end %>
</TABLE></DL>