diff options
Diffstat (limited to 'rc-status-html.lsp')
-rw-r--r-- | rc-status-html.lsp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/rc-status-html.lsp b/rc-status-html.lsp index 446c826..b04913a 100644 --- a/rc-status-html.lsp +++ b/rc-status-html.lsp @@ -1,16 +1,19 @@ <% local view, viewlibrary, page_info, session = ... %> <% require("viewfunctions") %> -<% displaycommandresults({"edit"}, session) %> +<% displaycommandresults({"edit", "startstop"}, session) %> <H1><%= html.html_escape(view.label) %></H1> <DL> <TABLE> <TR> <% if viewlibrary.check_permission("edit") then %> -<TD class='header'>Action</TD> +<th>Action</th> <% end %> -<TD class='header'>Service Name</TD><TD class='header'>Runlevels</TD> +<th>Service Name</th> +<th>Status</th> +<th>Runlevels</th> +<th>Description</th> </TR> <% for i,item in ipairs(view.value) do %> @@ -18,7 +21,15 @@ for i,item in ipairs(view.value) do %> <% if viewlibrary.check_permission("edit") then %> <TD><%= html.link{value="edit?servicename="..item.servicename.."&redir="..page_info.orig_action, label="Edit " } %> <% end %> - <TD><%= html.html_escape(item.servicename) %></TD><TD><%= html.html_escape(table.concat(item.runlevels, ", ")) %> </TD> + <% 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, ", ")) %> </TD> + <TD><%= html.html_escape(item.description) %></TD> </TR> <% end %> </TABLE> |