refs #1472. Changes in images and imageRepo
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
parent
9669202dbd
commit
805c0026bc
|
@ -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<any>(`${this.baseUrl}${this.data.image['@id']}/transfer-image`, {
|
||||
|
|
|
@ -60,15 +60,6 @@
|
|||
<th mat-header-cell *matHeaderCellDef i18n="@@columnActions" style="text-align: center;">Acciones</th>
|
||||
<td mat-cell *matCellDef="let image" style="text-align: center;">
|
||||
<button mat-icon-button color="primary" (click)="editImage($event, image)" i18n="@@editImage"> <mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="repositoryUuid" mat-icon-button color="warn" (click)="toggleAction(image, 'delete-trash')">
|
||||
<mat-icon i18n="@@deleteElementTooltip">delete</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button [matMenuTriggerFor]="menu">
|
||||
<mat-icon>menu</mat-icon>
|
||||
</button>
|
||||
<mat-menu #menu="matMenu">
|
||||
<button mat-menu-item (click)="toggleAction(image, 'transfer')">Transferir imagen</button>
|
||||
</mat-menu>
|
||||
</td>
|
||||
</ng-container>
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue