-
Notifications
You must be signed in to change notification settings - Fork 223
/
scheduled.ego
74 lines (67 loc) · 2.28 KB
/
scheduled.ego
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<%
package webui
import (
"net/http"
"github.com/contribsys/faktory/client"
"github.com/contribsys/faktory/storage"
)
func ego_listScheduled(w io.Writer, req *http.Request, set storage.SortedSet, count, currentPage uint64) {
totalSize := uint64(set.Size(req.Context()))
%>
<% ego_layout(w, req, func() { %>
<header class="row">
<div class="col-5">
<h3><%= t(req, "ScheduledJobs") %></h3>
</div>
<% if totalSize > 0 && totalSize > count { %>
<div class="col-7 d-flex justify-content-end">
<% ego_paging(w, req, "/scheduled", totalSize, count, currentPage) %>
</div>
<% } %>
<%= filtering("scheduled") %>
</header>
<% if totalSize > 0 { %>
<form action="<%= root(req) %>/scheduled" method="post">
<%== csrfTag(req) %>
<div class="table-responsive">
<table class="table table-striped table-bordered table-light">
<thead>
<tr>
<th class="checkbox-column">
<input type="checkbox" class="check_all" />
</th>
<th><%= t(req, "When") %></th>
<th><%= t(req, "Queue") %></th>
<th><%= t(req, "Job") %></th>
<th><%= t(req, "Arguments") %></th>
</tr>
</thead>
<% setJobs(req, set, count, currentPage, func(idx int, key []byte, job *client.Job) { %>
<tr>
<td>
<input type="checkbox" name="key" value="<%= string(key) %>" />
</td>
<td>
<a href="<%= root(req) %>/scheduled/<%= string(key) %>"><%= relativeTime(job.At) %></a>
</td>
<td>
<a href="<%= root(req) %>/queues/<%= job.Queue %>"><%= job.Queue %></a>
</td>
<td><code><%= displayJobType(job) %></code></td>
<td>
<div class="args"><%= displayArgs(job.Args) %></div>
</td>
</tr>
<% }) %>
</table>
</div>
<div class="pull-right">
<button class="btn btn-primary" type="submit" name="action" value="add_to_queue"><%= t(req, "AddToQueue") %></button>
<button class="btn btn-danger" type="submit" name="action" value="delete"><%= t(req, "Delete") %></button>
</div>
</form>
<% } else { %>
<div class="alert alert-success"><%= t(req, "NoScheduledFound") %></div>
<% } %>
<% }) %>
<% } %>