summaryrefslogtreecommitdiffstats
path: root/rc-status-html.lsp
blob: 119c306e0007734f5f7d0f4d56f875d5ad28eafb (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
<% local view, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>

<% displaycommandresults({"edit", "startstop"}, session) %>

<H1><%= html.html_escape(view.label) %></H1>
<DL>
<TABLE>
<TR>
<% if viewlibrary.check_permission("edit") then %>
<th>Action</th>
<% end %>
<th>Service Name</th>
<th>Status</th>
<th>Runlevels</th>
<th>Description</th>
</TR>
<%
for i,item in ipairs(view.value) do %>
	<TR>
	<% if viewlibrary.check_permission("edit") then %>
	<TD><%= html.link{value="edit?servicename="..item.servicename.."&redir="..page_info.orig_action, label="Edit " } %>
	<% end %>
	<% if viewlibrary.check_permission("startstop") and item.actions then
		for i,a in ipairs(item.actions) do
			print(html.link{value="startstop?servicename="..item.servicename.."&redir=status&submit=true&action="..a, label=a:gsub("^%l", string.upper).." " })
		end
	end %>
	<TD><%= html.html_escape(item.servicename) %></TD>
	<TD><%= html.html_escape(item.status) %></TD>
	<TD><%= html.html_escape(table.concat(item.runlevels, ", ")) %>&nbsp;</TD>
	<TD><%= html.html_escape(item.description) %></TD>
	</TR>
<% end %>
</TABLE>
</DL>