diff --git a/atdb/atdb/static/taskdatabase/new_ldv_logo.png b/atdb/atdb/static/taskdatabase/new_ldv_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..988f5a373338d6866a2ec5fc0bedb2f325fa7a26 Binary files /dev/null and b/atdb/atdb/static/taskdatabase/new_ldv_logo.png differ diff --git a/atdb/atdb/static/taskdatabase/style.css b/atdb/atdb/static/taskdatabase/style.css index 9919c7054fb401f417b73dcac632f70b272727e5..3eb74069d3c02a1910104389e4da9f11977f1d21 100644 --- a/atdb/atdb/static/taskdatabase/style.css +++ b/atdb/atdb/static/taskdatabase/style.css @@ -20,7 +20,6 @@ TD { .error,.failed,.staging_failed,.processed_failed { color: red; font-weight: bold; - background-color: lemonchiffon; } .processed { diff --git a/atdb/taskdatabase/services/algorithms.py b/atdb/taskdatabase/services/algorithms.py index 90a1308f2524362dda975051e1fbd9596cbb0f72..c408d6a024c7e315de1322eeaebfb27e25422734 100644 --- a/atdb/taskdatabase/services/algorithms.py +++ b/atdb/taskdatabase/services/algorithms.py @@ -142,6 +142,9 @@ def aggregate_resources_tasks(): sum_size_processed = tasks_per_workflow.aggregate(Sum('size_processed')) workflow_result['size_processed'] = sum_size_processed['size_processed__sum'] + sum_total_processing_time = tasks_per_workflow.aggregate(Sum('total_processing_time')) + workflow_result['total_processing_time'] = sum_total_processing_time['total_processing_time__sum'] + # all the active tasks active_tasks_per_workflow = tasks_per_workflow.filter(status__in=settings.ACTIVE_STATUSSES) nr_of_active_tasks_per_workflow = active_tasks_per_workflow.count() @@ -150,9 +153,10 @@ def aggregate_resources_tasks(): nr_per_status = {} for status in settings.ALL_STATUSSES: - nr_for_this_status = Task.objects.filter(workflow=workflow, status=status).count() + nr_for_this_status = tasks_per_workflow.filter(status=status).count() nr_per_status[status] = nr_for_this_status + nr_per_status['failed'] = tasks_per_workflow.filter(status__icontains='failed').count() nr_per_status['active'] = nr_of_active_tasks_per_workflow nr_per_status['total'] = nr_of_tasks_per_workflow @@ -261,7 +265,14 @@ def aggregate_resources_logs_version1(): def construct_link_to_tasks_api(request, status, workflow_id, count): link = str(count) try: - query = "?status=" + status + "&workflow__id=" + str(workflow_id) + if status in settings.ACTIVE_STATUSSES: + query = "?status=" + status + "&workflow__id=" + str(workflow_id) + else: + if 'failed' in status: + query = "?status__icontains=failed&workflow__id=" + str(workflow_id) + else: + query = "?workflow__id=" + str(workflow_id) + if settings.DEV == True: url = request.build_absolute_uri('/atdb/tasks') + query else: @@ -312,17 +323,19 @@ def construct_tasks_per_workflow_html(request, workflow_results): results_tasks = "<p>Progress of tasks per workflow</p>" # construct the header - header = "<th>Workflow</th>" + ##header = "<th>Workflow</th>" + header = "" for status in settings.ALL_STATUSSES: header += "<th>" + status + "</th>" - results_tasks += header + '<th class="active">active</th><th>total</th><th>to process</th><th>processed</th>' + results_tasks += header + '<th class="failed">failed</th><th class="active">active</th><th>total</th><th>to process</th><th>processed</th><th>processing time</th>' for workflow_result in workflow_results: d = workflow_result['nr_of_tasks_per_status'] link = construct_link_to_workflow_api(request, workflow_result) - values = "<td><b>" + link + "</b></td>" + ##values = "<tr><td><b>" + link + "</b></td></tr><tr>" + values = "<tr><td colspan='5'><b>" + link + "</b></td></tr><tr>" for key in d: try: @@ -346,8 +359,9 @@ def construct_tasks_per_workflow_html(request, workflow_results): except: percentage = 0 values += "<td>" + str(human_readable(workflow_result['size_processed'])) + " ("+ str(percentage) + "%) </td>" + values += "<td>" + str(workflow_result['total_processing_time']) + "</td>" - results_tasks += "<tr>" + values + "</tr>" + results_tasks += "</tr><tr>" + values + "</tr>" results_tasks = "<tbody>" + results_tasks + "</tbody>" return results_tasks diff --git a/atdb/taskdatabase/static/taskdatabase/new_ldv_logo.png b/atdb/taskdatabase/static/taskdatabase/new_ldv_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..e3ce16e02241ab40b6b0c5cbac4ef4b8bd92b97e Binary files /dev/null and b/atdb/taskdatabase/static/taskdatabase/new_ldv_logo.png differ diff --git a/atdb/taskdatabase/static/taskdatabase/style.css b/atdb/taskdatabase/static/taskdatabase/style.css index 9919c7054fb401f417b73dcac632f70b272727e5..3eb74069d3c02a1910104389e4da9f11977f1d21 100644 --- a/atdb/taskdatabase/static/taskdatabase/style.css +++ b/atdb/taskdatabase/static/taskdatabase/style.css @@ -20,7 +20,6 @@ TD { .error,.failed,.staging_failed,.processed_failed { color: red; font-weight: bold; - background-color: lemonchiffon; } .processed { diff --git a/atdb/taskdatabase/templates/taskdatabase/base.html b/atdb/taskdatabase/templates/taskdatabase/base.html index a81c0c385aeebc857eef181887f8c35b2be3666e..beab93fece61ef8ecc63ee9e4ab51b5e58587646 100644 --- a/atdb/taskdatabase/templates/taskdatabase/base.html +++ b/atdb/taskdatabase/templates/taskdatabase/base.html @@ -34,8 +34,8 @@ <ul class="nav navbar-nav"> <!-- Header --> <li><a class="navbar-brand" href="{% url 'homepage' %}"> - <img src="{% static 'taskdatabase/ldvlogo_small.png' %}" height="30" alt=""> - ATDB-LDV</a> + <img src="{% static 'taskdatabase/new_ldv_logo.png' %}" height="30" alt=""> + ATDB</a> </li> <li><a class="nav-link" href="{% url 'homepage' %}">Tasks</a></li> diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index cbc2e5bec97019bf074aa464d53250d36d7ec8e2..7305c6513d7dbd1e329736ff983b8ffbcc9a03e3 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 (18 mar 2021 - 14:00) + <p class="footer"> Version 1.0.0 (19 mar 2021 - 08:00) </div>