refs #1473. Changes in ogRepo. Import
parent
7e174c9617
commit
c7d33ff502
|
@ -9,7 +9,7 @@
|
|||
|
||||
<mat-form-field appearance="fill" class="form-field">
|
||||
<mat-label>{{ 'repositoryLabel' | translate }}</mat-label>
|
||||
<mat-select formControlName="imageRepository" required>
|
||||
<mat-select formControlName="imageRepositories" required multiple>
|
||||
<mat-option *ngFor="let imageRepository of repositories" [value]="imageRepository['@id']">
|
||||
{{ imageRepository.name }}
|
||||
</mat-option>
|
||||
|
|
|
@ -32,7 +32,7 @@ export class CreateImageComponent implements OnInit {
|
|||
remotePc: [false],
|
||||
isGlobal: [false],
|
||||
softwareProfile: [''],
|
||||
imageRepository: ['', Validators.required],
|
||||
imageRepositories: [[], Validators.required],
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ export class CreateImageComponent implements OnInit {
|
|||
remotePc: [response.remotePc],
|
||||
isGlobal: [response.isGlobal],
|
||||
softwareProfile: [response.softwareProfile ? response.softwareProfile['@id'] : null, Validators.required],
|
||||
imageRepository: [response.imageRepository ? response.imageRepository['@id'] : null, Validators.required],
|
||||
imageRepositories: [response.imageRepositories ? response.imageRepositories.map((r: any) => r['@id']) : [], Validators.required],
|
||||
});
|
||||
this.imageId = response['@id'];
|
||||
this.partitionInfo = response.partitionInfo;
|
||||
|
@ -98,7 +98,7 @@ export class CreateImageComponent implements OnInit {
|
|||
comments: this.imageForm.value.comments,
|
||||
remotePc: this.imageForm.value.remotePc,
|
||||
isGlobal: this.imageForm.value.isGlobal,
|
||||
imageRepository: this.imageForm.value.imageRepository,
|
||||
imageRepositories: this.imageForm.value.imageRepositories,
|
||||
...(this.imageForm.value.softwareProfile ? { softwareProfile: this.imageForm.value.softwareProfile } : {}),
|
||||
};
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<h2 mat-dialog-title>Exportar imagen {{data.image?.name}}</h2>
|
||||
<h2 mat-dialog-title>Transferir imagen {{data.image?.name}}</h2>
|
||||
|
||||
<mat-dialog-content>
|
||||
<mat-form-field appearance="fill" class="full-width">
|
||||
<mat-label>Seleccione repositorio destino</mat-label>
|
||||
<mat-label>Seleccione nuevo repositorio destino</mat-label>
|
||||
<mat-select [(value)]="selectedRepository">
|
||||
<mat-option *ngFor="let repository of repositories" [value]="repository['@id']">{{ repository.name }}</mat-option>
|
||||
</mat-select>
|
||||
|
|
|
@ -31,7 +31,7 @@ export class ExportImageComponent implements OnInit {
|
|||
}
|
||||
|
||||
loadRepositories() {
|
||||
this.http.get<any>(`${this.baseUrl}/image-repositories?id[ne]=1&page=1&itemsPerPage=50`).subscribe(
|
||||
this.http.get<any>(`${this.baseUrl}/image-repositories?id[neq]=1&page=1&itemsPerPage=50`).subscribe(
|
||||
response => {
|
||||
this.repositories = response['hydra:member'];
|
||||
this.loading = false;
|
||||
|
@ -41,7 +41,7 @@ export class ExportImageComponent implements OnInit {
|
|||
}
|
||||
|
||||
save() {
|
||||
this.http.post<any>(`${this.baseUrl}${this.selectedRepository}/export-image`, {
|
||||
this.http.post<any>(`${this.baseUrl}${this.selectedRepository}/transfer-image`, {
|
||||
images: [this.data.image['@id']]
|
||||
}).subscribe({
|
||||
next: (response) => {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<app-loading [isLoading]="loading"></app-loading>
|
||||
|
||||
<div class="header-container">
|
||||
<button mat-icon-button color="primary" (click)="iniciarTour()">
|
||||
|
@ -24,6 +25,15 @@
|
|||
<mat-icon matSuffix>search</mat-icon>
|
||||
<mat-hint>{{ 'searchHint' | translate }}</mat-hint>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="fill" class="search-boolean">
|
||||
<mat-label i18n="@@searchLabel">Estado</mat-label>
|
||||
<mat-select [(ngModel)]="filters['status']" (selectionChange)="search()" placeholder="Seleccionar opción" >
|
||||
<mat-option [value]="'failed'">Fallido</mat-option>
|
||||
<mat-option [value]="'pending'">Pendiente de ejecutar</mat-option>
|
||||
<mat-option [value]="'in-progress'">Ejecutando</mat-option>
|
||||
<mat-option [value]="'success'">Completado con éxito</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8" joyrideStep="imagesTable" text="Esta tabla muestra las imágenes disponibles.">
|
||||
|
@ -35,6 +45,14 @@
|
|||
{{ image[column.columnDef] ? 'check_circle' : 'cancel' }}
|
||||
</mat-icon>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="column.columnDef === 'imageRepositories'">
|
||||
<button mat-button [matMenuTriggerFor]="menu">Ver repositorios</button>
|
||||
<mat-menu #menu="matMenu">
|
||||
<button mat-menu-item *ngFor="let repository of image.imageRepositories">
|
||||
{{ repository.name }}
|
||||
</button>
|
||||
</mat-menu>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="column.columnDef === 'isGlobal'">
|
||||
<mat-icon [color]="image[column.columnDef] ? 'primary' : 'warn'">
|
||||
{{ image[column.columnDef] ? 'check_circle' : 'cancel' }}
|
||||
|
@ -51,7 +69,7 @@
|
|||
{{ getStatusLabel(image[column.columnDef]) }}
|
||||
</mat-chip>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="column.columnDef !== 'remotePc' && column.columnDef !== 'status' && column.columnDef !== 'isGlobal'">
|
||||
<ng-container *ngIf="column.columnDef !== 'remotePc' && column.columnDef !== 'status' && column.columnDef !== 'isGlobal' && column.columnDef !== 'imageRepositories'">
|
||||
{{ column.cell(image) }}
|
||||
</ng-container>
|
||||
</td>
|
||||
|
@ -73,7 +91,7 @@
|
|||
<button mat-menu-item [disabled]="!image.imageFullsum || image.status !== 'success'" (click)="toggleAction(image, 'delete-trash')">Eliminar imagen temporalmente</button>
|
||||
<button mat-menu-item [disabled]="!image.imageFullsum || image.status !== 'success'" (click)="toggleAction(image, 'delete-permanent')">Eliminar imagen</button>
|
||||
<button mat-menu-item [disabled]="!image.imageFullsum || image.status !== 'trash'" (click)="toggleAction(image, 'recover')">Recuperar imagen de la papelera</button>
|
||||
<button mat-menu-item [disabled]="!image.imageFullsum || image.status !== 'success'" (click)="toggleAction(image, 'export')">Exportar imagen</button>
|
||||
<button mat-menu-item [disabled]="!image.imageFullsum || image.status !== 'success'" (click)="toggleAction(image, 'transfer')">Transferir imagen</button>
|
||||
</mat-menu>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
|
|
@ -38,9 +38,9 @@ export class ImagesComponent implements OnInit {
|
|||
cell: (image: any) => `${image.name}`
|
||||
},
|
||||
{
|
||||
columnDef: 'imageRepository',
|
||||
header: 'Repositorio',
|
||||
cell: (image: any) => `${image.imageRepository?.name}`
|
||||
columnDef: 'imageRepositories',
|
||||
header: 'Repositorios',
|
||||
cell: (image: any) => `${image.imageRepositories}`
|
||||
},
|
||||
{
|
||||
columnDef: 'remotePc',
|
||||
|
@ -57,11 +57,6 @@ export class ImagesComponent 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',
|
||||
|
@ -115,6 +110,8 @@ export class ImagesComponent implements OnInit {
|
|||
return 'Papelera temporal';
|
||||
case 'failed':
|
||||
return 'Fallido';
|
||||
case 'trasnferring':
|
||||
return 'Transfiriendo';
|
||||
default:
|
||||
return 'Estado desconocido';
|
||||
}
|
||||
|
@ -186,19 +183,22 @@ export class ImagesComponent implements OnInit {
|
|||
|
||||
showImageInfo(event: MouseEvent, image:any) {
|
||||
event.stopPropagation();
|
||||
this.loading = true;
|
||||
this.loadImageAlert(image).subscribe(
|
||||
response => {
|
||||
this.alertMessage = response.output;
|
||||
this.alertMessage = response;
|
||||
|
||||
this.dialog.open(ServerInfoDialogComponent, {
|
||||
width: '600px',
|
||||
width: '800px',
|
||||
data: {
|
||||
message: this.alertMessage
|
||||
}
|
||||
});
|
||||
this.loading = false;
|
||||
},
|
||||
error => {
|
||||
this.toastService.error(error.error['hydra:description']);
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ export class ImagesComponent implements OnInit {
|
|||
}
|
||||
});
|
||||
break;
|
||||
case 'export':
|
||||
case 'transfer':
|
||||
this.dialog.open(ExportImageComponent, {
|
||||
width: '600px',
|
||||
data: {
|
||||
|
|
|
@ -299,7 +299,9 @@
|
|||
"saveFiltersButton": "Save Filters",
|
||||
"sendFiltersButton": "Send Action",
|
||||
"addPxeButton": "Add PXE file",
|
||||
"repositoryLabel": "Repositories",
|
||||
"internalUnits": "Internal units",
|
||||
"imageNameLabel": "Image name",
|
||||
"noResultsMessage": "No results to display.",
|
||||
"imagesTitle": "Manage images",
|
||||
"addImageButton": "Add image",
|
||||
|
|
|
@ -236,7 +236,8 @@
|
|||
"editClientDialogTitle": "Editar Cliente",
|
||||
"organizationalUnitLabel": "Padre",
|
||||
"ogLiveLabel": "OgLive",
|
||||
"repositoryLabel": "Repositorio",
|
||||
"imageNameLabel": "Nombre de la imagen",
|
||||
"repositoryLabel": "Repositorios",
|
||||
"serialNumberLabel": "Número de Serie",
|
||||
"netifaceLabel": "Interfaz de red",
|
||||
"netDriverLabel": "Controlador de red",
|
||||
|
|
Loading…
Reference in New Issue