You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/docker/models/task.ts

37 lines
763 B

import { Task, TaskSpec, TaskState } from 'docker-types/generated/1.41';
export class TaskViewModel {
Id: string;
Created: string;
Updated: string;
Slot: number;
Spec?: TaskSpec;
Status: Task['Status'];
DesiredState: TaskState;
ServiceId: string;
NodeId: string;
ContainerId: string = '';
constructor(data: Task) {
this.Id = data.ID || '';
this.Created = data.CreatedAt || '';
this.Updated = data.UpdatedAt || '';
this.Slot = data.Slot || 0;
this.Spec = data.Spec;
this.Status = data.Status;
this.DesiredState = data.DesiredState || 'pending';
this.ServiceId = data.ServiceID || '';
this.NodeId = data.NodeID || '';
this.ContainerId = data.Status?.ContainerStatus?.ContainerID || '';
}
}