admin: sort tasks api

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-04-05 19:20:26 +02:00
parent 61652406c7
commit f0ef2eea4f
2 changed files with 3 additions and 2 deletions

View File

@ -38,7 +38,8 @@ class TaskViewSet(ViewSet):
@swagger_auto_schema(responses={200: TaskSerializer(many=True)}) @swagger_auto_schema(responses={200: TaskSerializer(many=True)})
def list(self, request: Request) -> Response: def list(self, request: Request) -> Response:
"""List current messages and pass into Serializer""" """List current messages and pass into Serializer"""
return Response(TaskSerializer(TaskInfo.all().values(), many=True).data) tasks = sorted(TaskInfo.all().values(), key=lambda task: task.task_name)
return Response(TaskSerializer(tasks, many=True).data)
@action(detail=True, methods=["post"]) @action(detail=True, methods=["post"])
# pylint: disable=invalid-name # pylint: disable=invalid-name

View File

@ -51,7 +51,7 @@ export class SystemTaskListPage extends TablePage<Task> {
columns(): TableColumn[] { columns(): TableColumn[] {
return [ return [
new TableColumn(t`Identifier`, "task_name"), new TableColumn(t`Identifier`),
new TableColumn(t`Description`), new TableColumn(t`Description`),
new TableColumn(t`Last run`), new TableColumn(t`Last run`),
new TableColumn(t`Status`), new TableColumn(t`Status`),