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

Merge branch 'webdav-link-to-jobs' into 'master'

add status count of jobs per task in details screen

See merge request !309
parents e0e2d1a5 9039235c
No related branches found
No related tags found
1 merge request!309add status count of jobs per task in details screen
Pipeline #53015 passed
......@@ -159,6 +159,28 @@ class Task(models.Model):
def get_absolute_url(self):
return reverse('task-detail-view-api', kwargs={'pk': self.pk})
def get_jobs_statusses(self):
statusses = {}
# check the statusses of all the jobs of this id
jobs = Job.objects.filter(task_id=self.id)
for job in jobs:
try:
key = job.metadata['status'].lower()
# if key doesn't exist, add a new one
try:
statusses[key] = statusses[key] + 1
except:
statusses.update({ key : 0 })
statusses[key] = statusses[key] + 1
except:
pass
return statusses
@property
def predecessor_status(self):
try:
......@@ -382,6 +404,7 @@ class Job(models.Model):
except:
return "N/A"
class PostProcessingRule(models.Model):
aggregation_key = models.CharField(db_index=True, max_length=20, default=None,null=True, blank=True)
trigger_status = models.CharField(db_index=True, default="unknown", max_length=50, blank=True, null=True)
......
......@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p class="footer"> Version 6 July 2023
<p class="footer"> Version 7 July 2023
</div>
{% include 'taskdatabase/refresh.html' %}
......
......@@ -5,7 +5,7 @@
<table class="table table-striped">
<tbody>
<tr><td><b>id</b></td><td><a href="{% url 'task-detail-view-api' task.pk %}" target="_blank">{{ task.id }} </a></td></tr>
<tr><td><b>slurm jobs</b></td><td><a href="{% url 'job-list-view-api' %}?task_id={{ task.id }}" {{ task.id }} target="_blank">jobs for task {{ task.id }} </a></td></tr>
<tr><td><b>slurm jobs</b></td><td><a href="{% url 'job-list-view-api' %}?task_id={{ task.id }}" {{ task.id }} target="_blank">jobs for task {{ task.id }} </a> {{ task.get_jobs_statusses }}</td></tr>
<tr><td><b>priority</b></td><td>
{% if user.is_authenticated %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment