diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index 4b2e0f65be28c17c4d7b956bc0d57eb0ab01bfb2..7b0d7804c80dedb717f3cd565003981ea1d2eab0 100644 --- a/atdb/taskdatabase/services/algorithms.py +++ b/atdb/taskdatabase/services/algorithms.py @@ -126,7 +126,7 @@ def aggregate_resources_logs(): # aggregate logentries per step for all active statusses for status in settings.ACTIVE_STATUSSES: record = {} - record['name'] = workflow.workflow_uri + record['name'] = str(workflow.id) +' - '+ workflow.workflow_uri record['status'] = status # aggregate logentries per step for all active statusses (expensive) @@ -198,6 +198,18 @@ def aggregate_resources_tasks(): return workflow_results +def construct_link(request, status, workflow_id, count): + link = str(count) + try: + query = "?status=" + status + "&workflow=" + str(workflow_id) + url = request.build_absolute_uri('/atdb/tasks') + query + if not "http" in url: + url = "https://" + url + link = '<a href="' + url + '" target="_blank">' + str(count) + "</a>" + except: + pass + return link + def convert_aggregation_to_html(request): # --- Progress of tasks per active workflow --- @@ -221,9 +233,8 @@ def convert_aggregation_to_html(request): style = "active" # bonus: add a query link - query = "?status="+key+ "&workflow="+str(workflow_result['id']) - url = request.build_absolute_uri('/atdb/tasks')+query - link = '<a href="' + url + '" target="_blank">' + str(d[key]) + "</a>" + link = construct_link(request, key, workflow_result['id'], d[key]) + values += "<td class=" + style + ">" + str(percentage) + "% (" + link + ")</td>" #values += "<td class="+style+">" + str(percentage) + "% ("+str(d[key])+")</td>" #values += "<td>" + str(d[key]) + "</td>" diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index f14ca702105e2022f01b2ce9a9f2090fa3f0b025..4f5157bc1ae027cfe1191e18277b1fb99eb4ded9 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -80,7 +80,7 @@ {% include 'taskdatabase/pagination.html' %} </div> </div> - <p class="footer"> Version 1.0.0 (12 mar 2021 - 15:00) + <p class="footer"> Version 1.0.0 (12 mar 2021 - 17:00) </div>