summaryrefslogtreecommitdiffstats
path: root/rc-status-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-10-11 12:57:42 +0000
committerTed Trask <ttrask01@yahoo.com>2008-10-11 12:57:42 +0000
commitea59dcbdbed15ca5bd60f50cd8107451e74928dd (patch)
tree4f2103a8f01953cdc8d201cbc22c585a42a3a5cd /rc-status-html.lsp
parentecdbb8c4d4a9aa37f6c3e1ece96f0cf7f3c8fd6b (diff)
downloadacf-alpine-baselayout-ea59dcbdbed15ca5bd60f50cd8107451e74928dd.tar.bz2
acf-alpine-baselayout-ea59dcbdbed15ca5bd60f50cd8107451e74928dd.tar.xz
Added rc controller to alpine-baselayout and rc functionality to processinfo library. Changed status Enabled/Disabled to Running/Stopped. Added links to status pages to install package and schedule autostart.
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1552 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'rc-status-html.lsp')
-rw-r--r--rc-status-html.lsp40
1 files changed, 40 insertions, 0 deletions
diff --git a/rc-status-html.lsp b/rc-status-html.lsp
new file mode 100644
index 0000000..1ea448a
--- /dev/null
+++ b/rc-status-html.lsp
@@ -0,0 +1,40 @@
+<% local view, viewlibrary, page_info, session = ... %>
+<% require("viewfunctions") %>
+
+<% if session.editresult then %>
+ <H1>Command Result</H1>
+ <% if session.editresult.errtxt then io.write('<P CLASS="error">' .. string.gsub(session.editresult.errtxt, "\n", "<BR>") .. "</P>\n") end
+ if session.editresult.descr then io.write('<P CLASS="descr">' .. string.gsub(session.editresult.descr, "\n", "<BR>") .. "</P>\n") end
+ for name,val in pairs(session.editresult.value) do
+ if val.errtxt then io.write('<P CLASS="error">' .. string.gsub(val.errtxt, "\n", "<BR>") .. "</P>\n") end
+ end
+ session.editresult = nil
+end %>
+
+<H1><%= view.label %></H1>
+<TABLE>
+<TR><TD class='header'>Service Name</TD><TD class='header'>Sequence</TD>
+<TD class='header'>Kill on shutdown</TD><TD class='header'>System init service</TD>
+<% if session.permissions[page_info.controller].edit then %>
+<TD class='header'>Update</TD>
+<% end %>
+</TR>
+<%
+for i,item in ipairs(view.value) do %>
+ <TR>
+ <% if session.permissions[page_info.controller].edit then
+ local result = viewlibrary.dispatch_component(page_info.controller.."/edit", {servicename=item.servicename}, true)
+ for name,val in pairs(result.value) do val.name=name end
+ if result.value.kill.value then result.value.kill.checked = "" end
+ if result.value.system.value then result.value.system.checked = "" end %>
+ <form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/edit" %>" method="POST">
+ <TD><%= item.servicename %><%= html.form.hidden(result.value.servicename) %></TD><TD><%= html.form.text(result.value.sequence) %></TD>
+ <TD><%= html.form.checkbox(result.value.kill) %></TD><TD><%= html.form.checkbox(result.value.system) %></TD>
+ <TD><input class="submit" type="submit" name="<%= result.option %>" value="<%= result.submit or result.option %>"></TD>
+ </form></TR>
+ <% else %>
+ <TD><%= item.servicename %></TD><TD><%= item.sequence %></TD>
+ <TD><%= item.kill %></TD><TD><%= item.system %></TD></TR>
+ <% end %>
+<% end %>
+</TABLE>