mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(docker/services): convert service tasks table to react [EE-4674] (#10188)
This commit is contained in:
parent
c47a804c97
commit
c3d266931f
26 changed files with 421 additions and 322 deletions
36
app/docker/models/task.ts
Normal file
36
app/docker/models/task.ts
Normal file
|
@ -0,0 +1,36 @@
|
|||
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 || '';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue