summaryrefslogtreecommitdiff
path: root/templates/status.tpl
blob: b44bbc0b377c4cc4195798161ed75bba1a219abc (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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE HTML>
<html>
    <head>
        <title>Lorry Controller status</title>
        <link rel="stylesheet" href="/lc-static/style.css" type="text/css" />
    </head>
    <body>
        % import json

        <p>{{warning_msg}}</p>

        <h1>Status of Lorry Controller</h1>

% if links:
%   if running_queue:
        <form method="POST" action="/1.0/stop-queue">
          <p>New jobs are allowed.
            <input type="submit" name="submit" value="Don't allow new jobs" />
            <input type="hidden" name="redirect" value="/1.0/status-html" />
          </p>
        </form>
%   else:
        <form method="POST" action="/1.0/start-queue">
          <p>New jobs are NOT allowed.
            <input type="submit" name="submit" value="Allow new jobs" />
            <input type="hidden" name="redirect" value="/1.0/status-html" />
          </p>
        </form>
%   end
% else:
%   if running_queue:
        <p>New jobs are allowed.</p>
%   else:
        <p>New jobs are NOT allowed.</p>
%   end
% end

% if links:
    <form method="POST" action="/1.0/read-configuration">
      <p>
        <input type="submit" name="submit" value="Re-read configuration" />
        <input type="hidden" name="redirect" value="/1.0/status-html" />
      </p>
    </form>
% end

<p>Maximum number of jobs: {{max_jobs}}.</p>

        <p>Free disk space: {{disk_free_gib}} GiB.</p>

<h2>Remote Troves</h2>

<table>
<tr>
<th>Trove host</th>
<th>Due for re-scan of remote repositories</th>
</tr>
% for trove_info in troves:
<tr>
<td>{{trove_info['trovehost']}}</td>
<td>{{trove_info['ls_due_nice']}}</td>
</tr>
% end
</table>

        <h2>Currently running jobs</h2>

% if len(run_queue) == 0:
<p>There are no jobs running at this time.</p>
% else:
<table>
<tr>
<th>Job ID</th>
<th>path</th>
</tr>
%     for spec in run_queue:
%         if spec['running_job'] is not None:
%             if links:
<tr>
<td><a href="/1.0/job-html/{{spec['running_job']}}">{{spec['running_job']}}</a></td>
<td><a href="/1.0/lorry-html/{{spec['path']}}">{{spec['path']}}</a></td>
</tr>
%             else:
<tr>
<td>{{spec['running_job']}}</td>
<td>{{spec['path']}}</td>
</tr>
%             end
%         end
%     end
</table>
% end

% if links:
<p>See separate list of <a href="/1.0/list-jobs-html">all jobs that
    have ever been started</a>.</p>
% end

        <h2>Run-queue</h2>

<table>
<tr>
<th>Pos</th>
<th>Path</th>
<th>Interval</th>
<th>Due</th>
<th>Last run exit</th>
<th>Job?</th>

</tr>
% for i, spec in enumerate(run_queue):
%   obj = json.loads(spec['text'])
%   name = obj.keys()[0]
%   fields = obj[name]
<tr>
<td style="vertical-align:top">{{i+1}}</td>
%   if links:
<td style="vertical-align:top"><a href="/1.0/lorry-html/{{spec['path']}}">{{spec['path']}}</a></td>
%   else:
<td style="vertical-align:top">{{spec['path']}}</td>
%   end
<td style="vertical-align:top">{{spec['interval_nice']}}</td>
<td nowrap style="vertical-align:top">{{spec['due_nice']}}</td>
%   if publish_failures and spec['last_run_exit'] is not None and spec['last_run_exit'] is not "0":
<td><details>
  <summary>{{spec['last_run_exit']}}: Show log</summary>
  <p><pre>{{spec['last_run_error']}}</pre></p>
</details></td>
%   else:

<td style="vertical-align:top">{{spec['last_run_exit']}}</td>
%   end
%   if spec['running_job'] and links:
<td style="vertical-align:top"><a href="/1.0/job-html/{{spec['running_job']}}">{{spec['running_job']}}</a></td>
%   else:
<td></td>
%   end
</tr>
% end
</table>

        <hr />

        <p>Updated: {{timestamp}}</p>

    </body>
</html>