From bd5a4aecb595a3783797ea10d8a22d5c73cade73 Mon Sep 17 00:00:00 2001 From: Tobias Block Date: Fri, 23 Aug 2024 23:28:13 +0000 Subject: [PATCH] Fix for showing job information for Studies queue. Change of icons. --- webinterface/queue.py | 12 +++++---- webinterface/templates/queue.html | 41 ++++++++++++++++--------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/webinterface/queue.py b/webinterface/queue.py index b104134c..9b97f6c1 100755 --- a/webinterface/queue.py +++ b/webinterface/queue.py @@ -386,10 +386,8 @@ async def set_queues_status(request): processing_halt_file = Path(config.mercure.processing_folder + "/" + mercure_names.HALT) routing_halt_file = Path(config.mercure.outgoing_folder + "/" + mercure_names.HALT) - form = dict(await request.form()) - print(form) - try: + form = dict(await request.form()) if form.get("suspend_processing", "false") == "true": processing_halt_file.touch() else: @@ -408,7 +406,7 @@ async def set_queues_status(request): return JSONResponse({"result": "OK"}) -@router.get("/jobinfo/{category}/{id}") +@router.post("/jobinfo/{category}/{id}") @requires("authenticated", redirect="login") async def get_jobinfo(request): try: @@ -425,6 +423,10 @@ async def get_jobinfo(request): elif job_category == "routing": job_pathstr = config.mercure.outgoing_folder + "/" + job_id elif job_category == "studies": + # Note: For studies, the job_id contains a dash character, which is removed from the URL. Thus, + # take the information from the request body instead. + params = dict(await request.form()) + job_id = params["jobId"] job_pathstr = config.mercure.studies_folder + "/" + job_id elif job_category == "failure": job_pathstr = config.mercure.error_folder + "/" + job_id @@ -447,4 +449,4 @@ async def get_jobinfo(request): else: return PlainTextResponse("Task not found. Refresh view!") -queue_app = Starlette(routes=router) \ No newline at end of file +queue_app = Starlette(routes=router) diff --git a/webinterface/templates/queue.html b/webinterface/templates/queue.html index f663f413..00695922 100755 --- a/webinterface/templates/queue.html +++ b/webinterface/templates/queue.html @@ -244,7 +244,7 @@
- +
@@ -267,7 +267,7 @@
- +
@@ -296,7 +296,7 @@
- +
@@ -311,7 +311,7 @@
- +
@@ -326,7 +326,7 @@
- +
@@ -602,7 +602,7 @@
', + text: '', titleAttr: 'Job information', action: function ( e, dt, node, config ) { var jid = $('#jobs_processing').DataTable().rows( { selected: true } ).data()[0][5]; @@ -610,7 +610,7 @@
', + text: '', titleAttr: 'Cancel job', action: function ( e, dt, node, config ) { alert("Coming soon!"); @@ -649,7 +649,7 @@
', + text: '', titleAttr: 'Job information', action: function ( e, dt, node, config ) { var jid = $('#jobs_routing').DataTable().rows( { selected: true } ).data()[0][5]; @@ -657,7 +657,7 @@
', + text: '', titleAttr: 'Cancel job', action: function ( e, dt, node, config ) { alert("Coming soon!"); @@ -700,21 +700,22 @@
', + text: '', titleAttr: 'Job information', action: function ( e, dt, node, config ) { - showJobInformation("","studies"); + var jid = $('#jobs_studies').DataTable().rows( { selected: true } ).data()[0][0]; + showJobInformation(jid,"studies"); } }, { - text: '', + text: '', titleAttr: 'Cancel study', action: function ( e, dt, node, config ) { alert("Coming soon!"); } }, { - text: '', + text: '', titleAttr: 'Force study completion', action: function ( e, dt, node, config ) { @@ -785,7 +786,7 @@
', + text: '', titleAttr: 'Job information', action: function ( e, dt, node, config ) { var jid = $('#jobs_fail').DataTable().rows( { selected: true } ).data()[0][4]; @@ -793,7 +794,7 @@
', + text: '', titleAttr: 'Restart job', action: function ( e, dt, node, config ) { alert("Coming soon!"); @@ -842,7 +843,7 @@
', + text: '', titleAttr: 'Job information', action: function ( e, dt, node, config ) { var jid = $('#jobs_archive').DataTable().rows( { selected: true } ).data()[0].slice(-1)[0]; @@ -850,7 +851,7 @@
', + text: '', titleAttr: 'Audit trail', action: function ( e, dt, node, config ) { var jid = $('#jobs_archive').DataTable().rows( { selected: true } ).data()[0].slice(-1)[0]; @@ -858,7 +859,7 @@
', + text: '', titleAttr: 'Processing log', action: function ( e, dt, node, config ) { var jid = $('#jobs_archive').DataTable().rows( { selected: true } ).data()[0].slice(-1)[0]; @@ -1110,9 +1111,9 @@