diff --git a/VERSION b/VERSION index 5caee15..84f8aa5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1-beta.6 \ No newline at end of file +0.3.1-beta.7 \ No newline at end of file diff --git a/bookkeeping/query.py b/bookkeeping/query.py index b7f3760..1b91b0f 100644 --- a/bookkeeping/query.py +++ b/bookkeeping/query.py @@ -137,7 +137,7 @@ async def get_dicom_files(request) -> JSONResponse: @router.get("/task_process_logs") @requires("authenticated") async def get_task_process_logs(request) -> JSONResponse: - """Endpoint for getting all events related to one series.""" + """Endpoint for getting all processing logs related to one series.""" task_id = request.query_params.get("task_id", "") subtask_query = ( @@ -149,7 +149,7 @@ async def get_task_process_logs(request) -> JSONResponse: subtasks = await database.fetch_all(subtask_query) subtask_ids = [row[0] for row in subtasks] - query = processor_logs_table.select(processor_logs_table.c.task_id.in_(subtask_ids)) + query = processor_logs_table.select(processor_logs_table.c.task_id.in_(subtask_ids)).order_by(processor_logs_table.c.id) results = [dict(r) for r in await database.fetch_all(query)] for result in results: if result["logs"] == None: @@ -160,6 +160,17 @@ async def get_task_process_logs(request) -> JSONResponse: return CustomJSONResponse(results) +@router.get("/task_process_results") +@requires("authenticated") +async def get_task_process_results(request) -> JSONResponse: + """Endpoint for getting all processing results from a task.""" + task_id = request.query_params.get("task_id", "") + + query = processor_outputs_table.select().where(processor_outputs_table.c.task_id == task_id).order_by(processor_outputs_table.c.id) + results = [dict(r) for r in await database.fetch_all(query)] + return CustomJSONResponse(results) + + @router.get("/find_task") @requires("authenticated") async def find_task(request) -> JSONResponse: diff --git a/common/monitor.py b/common/monitor.py index d1e1c74..ce0300c 100755 --- a/common/monitor.py +++ b/common/monitor.py @@ -258,5 +258,9 @@ async def task_process_logs(task_id="") -> Any: return await get("query/task_process_logs", {"task_id": task_id}) +async def task_process_results(task_id="") -> Any: + return await get("query/task_process_results", {"task_id": task_id}) + + async def get_task_info(task_id="") -> Any: return await get("query/get_task_info", {"task_id": task_id}) diff --git a/webinterface/api.py b/webinterface/api.py index 5d767a9..ce7d943 100644 --- a/webinterface/api.py +++ b/webinterface/api.py @@ -87,6 +87,16 @@ async def task_process_logs(request): return JSONResponse({"error": e.status_code}, status_code=e.status_code) +@router.get("/task-process-results") +@requires(["authenticated"]) +async def task_process_results(request): + task_id = request.query_params.get("task_id", "") + try: + return JSONResponse(await monitor.task_process_results(task_id)) + except monitor.MonitorHTTPError as e: + return JSONResponse({"error": e.status_code}, status_code=e.status_code) + + @router.get("/get-task-info") @requires(["authenticated"]) async def get_task_info(request): diff --git a/webinterface/statics/css/custom.css b/webinterface/statics/css/custom.css index a346111..65dd8b9 100755 --- a/webinterface/statics/css/custom.css +++ b/webinterface/statics/css/custom.css @@ -381,14 +381,14 @@ table.dataTable tbody tr.selected th, table.dataTable tbody tr.selected td { height: 14px; } -.process-logs-output { +.process-logs-output, .process-results-output { font-family: monospace; background-color: #0a0a0a; color: #fff; padding: 8px; } -.process-logs-output::selection { +.process-logs-output::selection, .process-results-output::selection { background-color: rgb(50, 115, 220); color: #fff; } diff --git a/webinterface/templates/queue.html b/webinterface/templates/queue.html index 293576f..7b01180 100755 --- a/webinterface/templates/queue.html +++ b/webinterface/templates/queue.html @@ -315,6 +315,20 @@
Processing Results
+