summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-01-20 14:24:27 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-04-15 13:29:27 +0000
commit4fc162b07b2e9d8489e16ed647e5d96f5c66e10a (patch)
treeac2a2a5b86a5d789bd28b383851b28d7f293b928 /templates
parent716ad28c18ac00c52797dc42c843569b1834fb88 (diff)
downloadlorry-controller-4fc162b07b2e9d8489e16ed647e5d96f5c66e10a.tar.gz
Add new Lorry Controller
Diffstat (limited to 'templates')
-rw-r--r--templates/job.tpl20
-rw-r--r--templates/list-jobs.tpl32
-rw-r--r--templates/lorry.tpl44
-rw-r--r--templates/status.tpl115
4 files changed, 211 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..80f1ff7
--- /dev/null
+++ b/templates/status.tpl
@@ -0,0 +1,115 @@
+<!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>Scotty says: {{quote}}</p>
+
+ <p>Updated: {{timestamp}}</p>
+
+ </body>
+</html>