diff --git a/src/projects/models.ts b/src/projects/models.ts index e9d8e1e..47fee5f 100644 --- a/src/projects/models.ts +++ b/src/projects/models.ts @@ -83,15 +83,26 @@ export class Project { async _getContainers(): Promise { const result = this.composeExecutor.getPs2(); - return result.map((container) => { - return new Container( + //controlla se result รจ un array + if (Array.isArray(result)) { + return result.map((container) => { + return new Container( + this.dockerExecutor, + container.Name, + container.Command, + container.Status, + [] + ); + }); + } else { + return [new Container( this.dockerExecutor, - container.Name, - container.Command, - container.Status, + result["Name"], + result["Command"], + result["Status"], [] - ); - }); + )]; + } } public filterServiceContainers(serviceName: string, containers: Container[]): Container[] {