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 {
|
ngOnInit(): void {
|
||||||
|
console.log(this.data);
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.loadRepositories();
|
this.loadRepositories();
|
||||||
}
|
}
|
||||||
|
|
||||||
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`;
|
let url = `${this.baseUrl}/image-repositories?page=1&itemsPerPage=50`;
|
||||||
|
|
||||||
|
|
@ -52,7 +53,6 @@ export class ExportImageComponent implements OnInit {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.http.post<any>(`${this.baseUrl}${this.data.image['@id']}/transfer-image`, {
|
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>
|
<th mat-header-cell *matHeaderCellDef i18n="@@columnActions" style="text-align: center;">Acciones</th>
|
||||||
<td mat-cell *matCellDef="let image" style="text-align: center;">
|
<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 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>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
|
|
|
||||||
|
|
@ -131,43 +131,6 @@ export class ImagesComponent implements OnInit {
|
||||||
this.search();
|
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 {
|
iniciarTour(): void {
|
||||||
this.joyrideService.startTour({
|
this.joyrideService.startTour({
|
||||||
steps: [
|
steps: [
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,11 @@ export class RepositoryImagesComponent implements OnInit {
|
||||||
header: 'Estado',
|
header: 'Estado',
|
||||||
cell: (image: any) => `${image.status}`
|
cell: (image: any) => `${image.status}`
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
columnDef: 'imageFullsum',
|
||||||
|
header: 'Fullsum',
|
||||||
|
cell: (image: any) => `${image.imageFullsum}`
|
||||||
|
},
|
||||||
{
|
{
|
||||||
columnDef: 'createdAt',
|
columnDef: 'createdAt',
|
||||||
header: 'Fecha de creación',
|
header: 'Fecha de creación',
|
||||||
|
|
@ -226,10 +231,18 @@ export class RepositoryImagesComponent implements OnInit {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'transfer':
|
case 'transfer':
|
||||||
this.dialog.open(ExportImageComponent, {
|
console.log(image.image['@id']);
|
||||||
width: '600px',
|
this.http.get(`${this.baseUrl}${image.image['@id']}`).subscribe({
|
||||||
data: {
|
next: (response) => {
|
||||||
image: image
|
this.dialog.open(ExportImageComponent, {
|
||||||
|
width: '600px',
|
||||||
|
data: {
|
||||||
|
image: response
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: (error) => {
|
||||||
|
this.toastService.error(error.error['hydra:description']);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue