Skip to content
Snippets Groups Projects
Commit de6a45a0 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

bonus link in dashboard

parent 51593f98
No related branches found
No related tags found
3 merge requests!74Acceptance,!73Master,!61bonus link in dashboard
......@@ -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>"
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment