admin: sort tasks api
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
61652406c7
commit
f0ef2eea4f
|
@ -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
|
||||||
|
|
|
@ -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`),
|
||||||
|
|
Reference in New Issue