From 805c0026bc63871007a8786329066750c052e2b1 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Thu, 13 Feb 2025 07:45:39 +0100 Subject: [PATCH] refs #1472. Changes in images and imageRepo --- .../export-image/export-image.component.ts | 4 +- .../components/images/images.component.html | 9 ----- .../app/components/images/images.component.ts | 37 ------------------- .../repository-images.component.ts | 21 +++++++++-- 4 files changed, 19 insertions(+), 52 deletions(-) diff --git a/ogWebconsole/src/app/components/images/export-image/export-image.component.ts b/ogWebconsole/src/app/components/images/export-image/export-image.component.ts index e6cf530..e54e919 100644 --- a/ogWebconsole/src/app/components/images/export-image/export-image.component.ts +++ b/ogWebconsole/src/app/components/images/export-image/export-image.component.ts @@ -26,12 +26,13 @@ export class ExportImageComponent implements OnInit { } ngOnInit(): void { + console.log(this.data); this.loading = true; this.loadRepositories(); } loadRepositories() { - const excludedIds = this.data?.image?.imageRepositories?.map((repository: any) => repository.id) || null; + const excludedIds = this.data?.image?.imageRepositories?.map((repository: any) => repository.imageRepository?.id) || null; let url = `${this.baseUrl}/image-repositories?page=1&itemsPerPage=50`; @@ -52,7 +53,6 @@ export class ExportImageComponent implements OnInit { ); } - save() { this.loading = true; this.http.post(`${this.baseUrl}${this.data.image['@id']}/transfer-image`, { diff --git a/ogWebconsole/src/app/components/images/images.component.html b/ogWebconsole/src/app/components/images/images.component.html index 989b53a..b921d68 100644 --- a/ogWebconsole/src/app/components/images/images.component.html +++ b/ogWebconsole/src/app/components/images/images.component.html @@ -60,15 +60,6 @@ Acciones - - - - - diff --git a/ogWebconsole/src/app/components/images/images.component.ts b/ogWebconsole/src/app/components/images/images.component.ts index aa3cfb3..28e41a7 100644 --- a/ogWebconsole/src/app/components/images/images.component.ts +++ b/ogWebconsole/src/app/components/images/images.component.ts @@ -131,43 +131,6 @@ export class ImagesComponent implements OnInit { this.search(); } - toggleAction(image: any, action:string): void { - switch (action) { - 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 'delete-permanent': - this.http.post(`${this.baseUrl}/images/server/${image.uuid}/delete-permanent`, {}).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 'transfer': - this.dialog.open(ExportImageComponent, { - width: '600px', - data: { - image: image - } - }); - break; - default: - console.error('Acción no soportada:', action); - break; - } - } iniciarTour(): void { this.joyrideService.startTour({ steps: [ diff --git a/ogWebconsole/src/app/components/repositories/repository-images/repository-images.component.ts b/ogWebconsole/src/app/components/repositories/repository-images/repository-images.component.ts index 0362379..6e64a71 100644 --- a/ogWebconsole/src/app/components/repositories/repository-images/repository-images.component.ts +++ b/ogWebconsole/src/app/components/repositories/repository-images/repository-images.component.ts @@ -48,6 +48,11 @@ export class RepositoryImagesComponent implements OnInit { header: 'Estado', cell: (image: any) => `${image.status}` }, + { + columnDef: 'imageFullsum', + header: 'Fullsum', + cell: (image: any) => `${image.imageFullsum}` + }, { columnDef: 'createdAt', header: 'Fecha de creación', @@ -226,10 +231,18 @@ export class RepositoryImagesComponent implements OnInit { }); break; case 'transfer': - this.dialog.open(ExportImageComponent, { - width: '600px', - data: { - image: image + console.log(image.image['@id']); + this.http.get(`${this.baseUrl}${image.image['@id']}`).subscribe({ + next: (response) => { + this.dialog.open(ExportImageComponent, { + width: '600px', + data: { + image: response + } + }); + }, + error: (error) => { + this.toastService.error(error.error['hydra:description']); } }); break;