summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben@demerara.io>2021-11-18 18:27:35 +0000
committerBen Brown <ben@demerara.io>2021-11-18 18:27:46 +0000
commitcea2acf3b4e1c6fb4b4df60828459a40fc978367 (patch)
tree79030293e928dfd9796db1cb9ca8d25010238c3a
parentb49d223bd8c2ba2bfd6ce97059fd67902e0e2a8d (diff)
downloadlorry-controller-cea2acf3b4e1c6fb4b4df60828459a40fc978367.tar.gz
Update admin interface to support raw-file
-rw-r--r--lorrycontroller/showlorry.py5
-rw-r--r--templates/lorry.tpl12
2 files changed, 15 insertions, 2 deletions
diff --git a/lorrycontroller/showlorry.py b/lorrycontroller/showlorry.py
index b553b9c..ca0ac59 100644
--- a/lorrycontroller/showlorry.py
+++ b/lorrycontroller/showlorry.py
@@ -66,7 +66,10 @@ class ShowLorryHTML(ShowLorryBase, lorrycontroller.LorryControllerRoute):
shower = lorrycontroller.JobShower()
lorry_obj = list(json.loads(lorry_info['text']).values())[0]
- lorry_info['url'] = lorry_obj['url']
+ if "url" in lorry_obj:
+ lorry_info['url'] = lorry_obj['url']
+ elif "urls" in lorry_obj:
+ lorry_info['urls'] = lorry_obj['urls']
lorry_info['interval_nice'] = renderer.format_secs_nicely(
lorry_info['interval'])
diff --git a/templates/lorry.tpl b/templates/lorry.tpl
index 22760d4..b9b74fa 100644
--- a/templates/lorry.tpl
+++ b/templates/lorry.tpl
@@ -13,7 +13,17 @@
<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>
+ % if "url" in lorry:
+ <th>URL</th> <td>{{lorry['url']}}</td>
+ % elif "urls" in lorry:
+ <th>URLs</th> <td>
+ % for url in lorry['urls'].values():
+ {{url}}<BR>
+ % end
+ </td>
+ % end
+</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>