Display processing node information next to task info

pull/571/head
Piero Toffanin 2018-12-04 13:04:22 -05:00
rodzic dfd1695c11
commit b310453f32
3 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -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()

Wyświetl plik

@ -474,7 +474,7 @@ class TaskListItem extends React.Component {
</div>);
})}
</div>);
expanded = (
<div className="expanded-panel">
<div className="row">
@ -482,6 +482,9 @@ class TaskListItem extends React.Component {
<div className="labels">
<strong>Created on: </strong> {(new Date(task.created_at)).toLocaleString()}<br/>
</div>
<div className="labels">
<strong>Processing Node: </strong> {task.processing_node_name || "-"} ({task.auto_processing_node ? "auto" : "manual"})<br/>
</div>
{status ? <div className="labels">
<strong>Status: </strong> {status}<br/>
</div>

Wyświetl plik

@ -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",