refs #968. UX Operative System, Software and SOftwarProfile

develop-jenkins
Manuel Aranda Rosales 2024-10-17 16:15:44 +02:00
parent 31e8e0c3c7
commit 00088973e2
4 changed files with 17 additions and 7 deletions

View File

@ -1,4 +1,9 @@
.full-width {
width: 100%;
}
width: 100%;
}
.spinner {
margin: 0 auto;
display: block;
justify-content: center;
}

View File

@ -4,7 +4,9 @@
<mat-label>Nombre</mat-label>
<input matInput [(ngModel)]="name">
</mat-form-field>
<mat-form-field appearance="fill" class="full-width">
<mat-spinner class="spinner" *ngIf="loading"></mat-spinner>
<mat-form-field *ngIf="!loading" appearance="fill" class="full-width">
<mat-label>Seleccionar ISO</mat-label>
<mat-select [(value)]="selectedDownload">
<mat-option *ngFor="let download of downloads" [value]="download">

View File

@ -14,6 +14,7 @@ export class CreatePXEImageComponent implements OnInit {
downloads: any[] = [];
selectedDownload: any;
isEditMode: boolean = false;
loading: boolean = false;
imageId: string | null = null;
constructor(
@ -34,10 +35,12 @@ export class CreatePXEImageComponent implements OnInit {
}
fetchDownloads(): void {
this.loading = true;
this.http.get(`${this.baseUrl}/og-lives/server/get-isos?page=1&itemsPerPage=30`)
.subscribe({
next: (response: any) => {
this.downloads = response.message.downloads.downloads;
this.loading = false;
this.downloads = response.message;
},
error: (error) => {
console.error('Error fetching downloads:', error);
@ -53,7 +56,7 @@ export class CreatePXEImageComponent implements OnInit {
submitForm(): void {
const payload = {
name: this.name,
downloadUrl: this.selectedDownload.filename
downloadUrl: this.selectedDownload.url
};
if (this.isEditMode && this.imageId) {

View File

@ -80,7 +80,7 @@ export class PXEimagesComponent implements OnInit {
addImage(): void {
const dialogRef = this.dialog.open(CreatePXEImageComponent, {
width: '400px'
width: '600px'
});
dialogRef.afterClosed().subscribe(result => {