From cea2acf3b4e1c6fb4b4df60828459a40fc978367 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Thu, 18 Nov 2021 18:27:35 +0000 Subject: Update admin interface to support raw-file --- lorrycontroller/showlorry.py | 5 ++++- templates/lorry.tpl | 12 +++++++++++- 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 @@ Path {{lorry['path']}} - URL {{lorry['url']}} + + % if "url" in lorry: + URL {{lorry['url']}} + % elif "urls" in lorry: + URLs + % for url in lorry['urls'].values(): + {{url}}
+ % end + + % end + Interval {{lorry['interval_nice']}} ({{lorry['interval']}} s) Last run {{lorry['last_run_nice']}} Due {{lorry['due_nice']}} -- cgit v1.2.1