summaryrefslogtreecommitdiffstats
path: root/cron-listjobs-html.lsp
blob: 6f2167366461b969dc271056fce0f2e62407f709 (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
<% local view, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>

<% displaycommandresults({"editjob", "deletejob"}, session) %>
<% displaycommandresults({"createjob"}, session, true) %>

<% if viewlibrary and viewlibrary.dispatch_component then
	viewlibrary.dispatch_component("status")
end %>

<H1>Cron Jobs</H1>
<% for i,tabl in ipairs(view.value) do %>
<H2><%= tabl.period %></H2>
	<% if #tabl.jobs == 0 then %>
No jobs
	<% else %>
<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="white-space:nowrap;text-align:left;" class="header">Job</TD>
	</TR>
		<% for i,job in ipairs(tabl.jobs) do %>
	<TR>
		<TD style="padding-right:20px;white-space:nowrap;">
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editjob?name="..job.."&redir="..page_info.orig_action, label="Edit "} %>
			<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletejob?name="..job, label="Delete "} %>
		</TD>
		<TD style="white-space:nowrap;"><%= string.gsub(job, "^.*/", "") %></TD>
	</TR>
		<% end %>
</TABLE>
	<% end %>
<% end %>

<% if viewlibrary and viewlibrary.dispatch_component and session.permissions.cron.createjob then
	viewlibrary.dispatch_component("createjob")
end %>