1
0
Fork 0
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:
Chaim Lev-Ari 2023-09-07 15:19:03 +01:00 committed by GitHub
parent c47a804c97
commit c3d266931f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 421 additions and 322 deletions

36
app/docker/models/task.ts Normal file
View 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 || '';
}
}