Merge branch 'develop' of ssh://ognproject.evlt.uma.es:21987/opengnsys/oggui into develop
commit
c7ad48c2b3
|
@ -1,4 +1,9 @@
|
||||||
.full-width {
|
.full-width {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spinner {
|
||||||
|
margin: 0 auto;
|
||||||
|
display: block;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
<mat-label>Nombre</mat-label>
|
<mat-label>Nombre</mat-label>
|
||||||
<input matInput [(ngModel)]="name">
|
<input matInput [(ngModel)]="name">
|
||||||
</mat-form-field>
|
</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-label>Seleccionar ISO</mat-label>
|
||||||
<mat-select [(value)]="selectedDownload">
|
<mat-select [(value)]="selectedDownload">
|
||||||
<mat-option *ngFor="let download of downloads" [value]="download">
|
<mat-option *ngFor="let download of downloads" [value]="download">
|
||||||
|
|
|
@ -14,6 +14,7 @@ export class CreatePXEImageComponent implements OnInit {
|
||||||
downloads: any[] = [];
|
downloads: any[] = [];
|
||||||
selectedDownload: any;
|
selectedDownload: any;
|
||||||
isEditMode: boolean = false;
|
isEditMode: boolean = false;
|
||||||
|
loading: boolean = false;
|
||||||
imageId: string | null = null;
|
imageId: string | null = null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -34,10 +35,12 @@ export class CreatePXEImageComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchDownloads(): void {
|
fetchDownloads(): void {
|
||||||
|
this.loading = true;
|
||||||
this.http.get(`${this.baseUrl}/og-lives/server/get-isos?page=1&itemsPerPage=30`)
|
this.http.get(`${this.baseUrl}/og-lives/server/get-isos?page=1&itemsPerPage=30`)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
next: (response: any) => {
|
next: (response: any) => {
|
||||||
this.downloads = response.message.downloads.downloads;
|
this.loading = false;
|
||||||
|
this.downloads = response.message;
|
||||||
},
|
},
|
||||||
error: (error) => {
|
error: (error) => {
|
||||||
console.error('Error fetching downloads:', error);
|
console.error('Error fetching downloads:', error);
|
||||||
|
@ -53,7 +56,7 @@ export class CreatePXEImageComponent implements OnInit {
|
||||||
submitForm(): void {
|
submitForm(): void {
|
||||||
const payload = {
|
const payload = {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
downloadUrl: this.selectedDownload.filename
|
downloadUrl: this.selectedDownload.url
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.isEditMode && this.imageId) {
|
if (this.isEditMode && this.imageId) {
|
||||||
|
|
|
@ -80,7 +80,7 @@ export class PXEimagesComponent implements OnInit {
|
||||||
|
|
||||||
addImage(): void {
|
addImage(): void {
|
||||||
const dialogRef = this.dialog.open(CreatePXEImageComponent, {
|
const dialogRef = this.dialog.open(CreatePXEImageComponent, {
|
||||||
width: '400px'
|
width: '600px'
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
|
|
Loading…
Reference in New Issue