From 33080ef704b3d795d911d0572adbced4403850d9 Mon Sep 17 00:00:00 2001 From: jmbardallo Date: Mon, 4 May 2026 14:47:24 +0200 Subject: [PATCH] corregida gestion de oglives --- CHANGELOG.md | 4 +++ .../create-image/create-image.component.ts | 26 ++++++++++++++----- .../pxe-images/pxe-images.component.html | 4 +-- .../ogboot/pxe-images/pxe-images.component.ts | 3 ++- .../components/ogboot/pxe/pxe.component.html | 2 +- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a489d17..48ee167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.5.5] - 2026-05-04 +### Fixed +- Corregida gestion de oglives + ## [1.5.4] - 2026-04-24 ### Improved - Modificado script de post instalación debian para añadir a config.json las nuevas variables. diff --git a/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.ts b/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.ts index 409ab52..f57db19 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe-images/create-image/create-image/create-image.component.ts @@ -19,6 +19,7 @@ export class CreatePXEImageComponent implements OnInit { isEditMode: boolean = false; loading: boolean = false; imageId: string | null = null; + serverId: string | null = null; constructor( private toastService: ToastrService, @@ -31,17 +32,27 @@ export class CreatePXEImageComponent implements OnInit { } ngOnInit(): void { - this.fetchDownloads(); if (this.data) { - this.isEditMode = true; - this.selectedDownload = this.data.downloadUrl; - this.imageId = this.data.uuid; // Assuming UUID is used for edit + if (this.data.serverId) { + this.serverId = this.data.serverId; + } + if (this.data.uuid) { + this.isEditMode = true; + this.selectedDownload = this.data.downloadUrl; + this.imageId = this.data.uuid; // Assuming UUID is used for edit + } } + this.fetchDownloads(); } fetchDownloads(): void { this.loading = true; - this.http.get(`${this.baseUrl}/og-lives/server/get-isos?page=1&itemsPerPage=30`) + if (!this.serverId) { + this.toastService.error('No boot server selected'); + this.loading = false; + return; + } + this.http.get(`${this.baseUrl}/boot-servers/${this.serverId}/oglives/get-isos?page=1&itemsPerPage=30`) .subscribe({ next: (response: any) => { this.loading = false; @@ -61,9 +72,12 @@ export class CreatePXEImageComponent implements OnInit { } submitForm(): void { - const payload = { + const payload: any = { downloadUrl: this.selectedDownload.url }; + if (this.serverId) { + payload.bootServer = `/boot-servers/${this.serverId}`; + } if (this.isEditMode && this.imageId) { this.http.patch(`${this.baseUrl}/og-lives/${this.imageId}`, payload) diff --git a/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.html b/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.html index 80dd248..58f5585 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.html +++ b/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.html @@ -107,10 +107,10 @@ -- 2.40.1