summaryrefslogtreecommitdiffstats
path: root/rc-status-html.lsp
blob: b04913abb052c31d3a857cd2a7e2924711351460 (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.."&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>