diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-04-23 16:38:47 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2014-04-23 16:38:47 +0000 |
commit | 5e2584a7936af5413588232be1f0df7b4cef18c1 (patch) | |
tree | 54f30c0282eba421ee720bafd23e0bfe1f8d61ff /templates | |
parent | 627c50633977804e6a10bafad81e72ae376b1cf6 (diff) | |
parent | ca8eaccfd8c0d89c91873dbfe4f5d33d479d2913 (diff) | |
download | lorry-controller-5e2584a7936af5413588232be1f0df7b4cef18c1.tar.gz |
Merge branch 'baserock/liw/new-lc-2'
Reviewed by Daniel and Richard on the mailing list, and then
my changes based on review feedback by Richard on IRC.
Reviewed-by: Daniel Silverstone
Reviewed-by: Richard Maw
Diffstat (limited to 'templates')
-rw-r--r-- | templates/job.tpl | 20 | ||||
-rw-r--r-- | templates/list-jobs.tpl | 32 | ||||
-rw-r--r-- | templates/lorry.tpl | 44 | ||||
-rw-r--r-- | templates/status.tpl | 113 |
4 files changed, 209 insertions, 0 deletions
diff --git a/templates/job.tpl b/templates/job.tpl new file mode 100644 index 0000000..33fe909 --- /dev/null +++ b/templates/job.tpl @@ -0,0 +1,20 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Lorry Controller: Job {{job_id}}</title> + <link rel="stylesheet" href="/lc-static/style.css" type="text/css" /> + </head> + <body> +<h1>Status of job {{job_id}}</h1> +<p>Path of git repo: <code>{{path}}</code></p> +<p>Started: {{job_started}}</p> +<p>Ended: {{job_ended}}</p> +<p>MINION: <code>{{host}}:{{pid}}</code></p> +<p>Exit code: <code>{{exit}}</code></p> +<p>Lorry disk usage (after job's finished): {{disk_usage_nice}}</p> +<p>Output:</p> +<pre>{{output}}</pre> +<hr /> +<p>Updated: {{timestamp}}</p> + </body> +</html> diff --git a/templates/list-jobs.tpl b/templates/list-jobs.tpl new file mode 100644 index 0000000..1d530aa --- /dev/null +++ b/templates/list-jobs.tpl @@ -0,0 +1,32 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Lorry Controller: ALL the jobs</title> + <link rel="stylesheet" href="/lc-static/style.css" type="text/css" /> + </head> + <body> + % import json + + <h1>ALL the jobs</h2> + +<table> +<tr> +<th>Job ID</th> +<th>path</th> +<th>exit?</th> +</tr> +% for job in job_infos: +<tr> +<td><a href="/1.0/job-html/{{job['job_id']}}">{{job['job_id']}}</a></td> +<td><a href="/1.0/lorry-html/{{job['path']}}">{{job['path']}}</a></td> +<td>{{job['exit']}}</td> +</tr> +% end +</table> + + <hr /> + + <p>Updated: {{timestamp}}</p> + + </body> +</html> diff --git a/templates/lorry.tpl b/templates/lorry.tpl new file mode 100644 index 0000000..fad85cd --- /dev/null +++ b/templates/lorry.tpl @@ -0,0 +1,44 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Lorry {{lorry['path']}}</title> + <link rel="stylesheet" href="/lc-static/style.css" type="text/css" /> + </head> + <body> + % import json + + <h1>Lorry {{lorry['path']}}</h1> + +<table> + +<tr> <th>Path</th> + <td><a href="{{http_server_root}}/cgi-bin/cgit.cgi/{{lorry['path']}}.git/">{{lorry['path']}}</a></td> </tr> +<tr> <th>URL</th> <td>{{lorry['url']}}</td> </tr> +<tr> <th>Interval</th> <td>{{lorry['interval_nice']}} ({{lorry['interval']}} s)</td> </tr> +<tr> <th>Last run</th> <td>{{lorry['last_run_nice']}}</td> </tr> +<tr> <th>Due</th> <td>{{lorry['due_nice']}}</td> </tr> +<tr> <th>From Trove</th> <td>{{lorry['from_trovehost']}}</td> </tr> +<tr> <th>Disk usage</th> <td>{{lorry['disk_usage_nice']}}</td> </tr> + +<tr> <th>Job?</th> +% if lorry['running_job']: +<td><a href="/1.0/job/{{lorry['running_job']}}">{{lorry['running_job']}}</a></td> +% else: +<td></td> +% end +</tr> + +</table> + +<h2>Full Lorry text</h2> + +<blockquote> +<pre>{{lorry['text']}}</pre> +</blockquote> + + <hr /> + + <p>Updated: {{timestamp}}</p> + + </body> +</html> 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> |