diff options
Diffstat (limited to 'templates/status.tpl')
-rw-r--r-- | templates/status.tpl | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/templates/status.tpl b/templates/status.tpl new file mode 100644 index 0000000..e583883 --- /dev/null +++ b/templates/status.tpl @@ -0,0 +1,113 @@ +<!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 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 + +<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> + +<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: +<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> +% end +% end +</table> +% end + +<p>See separate list of <a href="/1.0/list-jobs-html">all jobs that + have ever been started.</a>.</p> + + <h2>Run-queue</h2> + +<table> +<tr> +<th>Pos</th> +<th>Path</th> +<th>Interval</th> +<th>Due</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>{{i+1}}</td> +<td><a href="/1.0/lorry-html/{{spec['path']}}">{{spec['path']}}</a></td> +<td>{{spec['interval_nice']}}</td> +<td>{{spec['due_nice']}}</td> +% if spec['running_job']: +<td><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> |