diff --git a/app/api/tasks.py b/app/api/tasks.py index 9f1f4979..1c29eb2b 100644 --- a/app/api/tasks.py +++ b/app/api/tasks.py @@ -24,9 +24,16 @@ class TaskIDsSerializer(serializers.BaseSerializer): class TaskSerializer(serializers.ModelSerializer): project = serializers.PrimaryKeyRelatedField(queryset=models.Project.objects.all()) processing_node = serializers.PrimaryKeyRelatedField(queryset=ProcessingNode.objects.all()) + processing_node_name = serializers.SerializerMethodField() images_count = serializers.SerializerMethodField() can_rerun_from = serializers.SerializerMethodField() + def get_processing_node_name(self, obj): + if obj.processing_node is not None: + return str(obj.processing_node) + else: + return None + def get_images_count(self, obj): return obj.imageupload_set.count() diff --git a/app/static/app/js/components/TaskListItem.jsx b/app/static/app/js/components/TaskListItem.jsx index a021146e..14981cf1 100644 --- a/app/static/app/js/components/TaskListItem.jsx +++ b/app/static/app/js/components/TaskListItem.jsx @@ -474,7 +474,7 @@ class TaskListItem extends React.Component { ); })} ); - + expanded = (
@@ -482,6 +482,9 @@ class TaskListItem extends React.Component {
Created on: {(new Date(task.created_at)).toLocaleString()}
+
+ Processing Node: {task.processing_node_name || "-"} ({task.auto_processing_node ? "auto" : "manual"})
+
{status ?
Status: {status}
diff --git a/slate/source/includes/reference/_task.md b/slate/source/includes/reference/_task.md index 148be960..e0370522 100644 --- a/slate/source/includes/reference/_task.md +++ b/slate/source/includes/reference/_task.md @@ -7,6 +7,7 @@ "id": 134, "project": 27, "processing_node": 10, + "processing_node_name": "localhost:3000", "images_count": 48, "can_rerun_from": [], "available_assets": [ @@ -43,6 +44,7 @@ Field | Type | Description id | int | Unique identifier project | int | [Project](#project) ID the task belongs to processing_node | int | The ID of the [Processing Node](#processing-node) this task has been assigned to, or `null` if no [Processing Node](#processing-node) has been assigned. +processing_node_name | string | The name of the processing node below, or `null` if no [Processing Node](#processing-node) has been assigned. images_count | int | Number of images can_rerun_from | string[] | List of possible "rerun-from" options that this task could restart from, given its currently assigned processing node. If this is an empty list, the task can only be restarted from the start of the pipeline. available_assets | string[] | List of [assets](#download-assets) available for download @@ -91,6 +93,7 @@ Parameters are the same as above. "id": 6, "project": 2, "processing_node": 2, + "processing_node_name": "localhost:3000", "images_count": 89, "uuid": "2e8b687d-c269-4e2f-91b3-5a2cd51b5321", "name": "Test name",