diff --git a/ogWebconsole/src/app/components/commands/commands-task/task-logs/task-logs.component.ts b/ogWebconsole/src/app/components/commands/commands-task/task-logs/task-logs.component.ts index 90caece..37b65e1 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/task-logs/task-logs.component.ts +++ b/ogWebconsole/src/app/components/commands/commands-task/task-logs/task-logs.component.ts @@ -33,7 +33,7 @@ export class TaskLogsComponent implements OnInit { { columnDef: 'command', header: 'Comando', - cell: (trace: any) => `${trace.command?.name}` + cell: (trace: any) => `${trace.command}` }, { columnDef: 'client', @@ -69,7 +69,7 @@ export class TaskLogsComponent implements OnInit { filteredCommands!: Observable; commandControl = new FormControl(); - constructor(private http: HttpClient, + constructor(private http: HttpClient, private joyrideService: JoyrideService) {} ngOnInit(): void { @@ -205,5 +205,5 @@ export class TaskLogsComponent implements OnInit { themeColor: '#3f51b5' }); } - + } diff --git a/ogWebconsole/src/app/components/images/images.component.html b/ogWebconsole/src/app/components/images/images.component.html index 1e19332..581bcd5 100644 --- a/ogWebconsole/src/app/components/images/images.component.html +++ b/ogWebconsole/src/app/components/images/images.component.html @@ -32,22 +32,34 @@ {{ image[column.columnDef] ? 'check_circle' : 'cancel' }} - + + + {{ getStatusLabel(image[column.columnDef]) }} + + + {{ column.cell(image) }} ->>>>>>> c168c87fc9ebcc4b5cf9a68effa16bdb2a848e00 - Acciones - - + + - + + + + + + diff --git a/ogWebconsole/src/app/components/images/images.component.ts b/ogWebconsole/src/app/components/images/images.component.ts index 6c41a62..dce66e3 100644 --- a/ogWebconsole/src/app/components/images/images.component.ts +++ b/ogWebconsole/src/app/components/images/images.component.ts @@ -79,6 +79,25 @@ export class ImagesComponent implements OnInit { this.search(); } + getStatusLabel(status: string): string { + switch (status) { + case 'pending': + return 'Pendiente'; + case 'in-progress': + return 'En progreso'; + case 'aux-file-pending': + return 'Archivos auxiliares pendientes'; + case 'success': + return 'Creado con éxito'; + case 'trash': + return 'Papelera temporal'; + case 'failed': + return 'Fallido'; + default: + return 'Estado desconocido'; + } + } + addImage(): void { const dialogRef = this.dialog.open(CreateImageComponent, { width: '800px' @@ -175,6 +194,28 @@ export class ImagesComponent implements OnInit { } }); break; + case 'delete-trash': + this.http.post(`${this.baseUrl}/images/server/${image.uuid}/delete-trash`, {}).subscribe({ + next: () => { + this.toastService.success('Petición de eliminación de la papelera temporal enviada'); + this.search() + }, + error: (error) => { + this.toastService.error(error.error['hydra:description']); + } + }); + break; + case 'recover': + this.http.post(`${this.baseUrl}/images/server/${image.uuid}/recover`, {}).subscribe({ + next: () => { + this.toastService.success('Petición de recuperación de la imagen enviada'); + this.search() + }, + error: (error) => { + this.toastService.error(error.error['hydra:description']); + } + }); + break; default: console.error('Acción no soportada:', action); break;