diff --git a/ogWebconsole/src/app/components/images/images/create-image/create-image/create-image.component.ts b/ogWebconsole/src/app/components/images/images/create-image/create-image/create-image.component.ts index 30ecab9..e7ca971 100644 --- a/ogWebconsole/src/app/components/images/images/create-image/create-image/create-image.component.ts +++ b/ogWebconsole/src/app/components/images/images/create-image/create-image/create-image.component.ts @@ -25,7 +25,7 @@ export class CreateImageComponent implements OnInit { } fetchDownloads(): void { - /* this.http.get('http://127.0.0.1:8080/og-lives/server/get-isos?page=1&itemsPerPage=30') + this.http.get('http://127.0.0.1:8080/og-lives/server/get-isos?page=1&itemsPerPage=30') .subscribe({ next: (response: any) => { this.downloads = response.data.downloads; @@ -34,187 +34,7 @@ export class CreateImageComponent implements OnInit { console.error('Error fetching downloads:', error); this.toastService.error('Error fetching iso files'); } - }); */ - - /* HARDCODEADO TEMPORALMENTE POR PROBLEMAS CON OGBOOT */ - - const response = { - "data": { - "downloads": [ - { - "id": "1", - "filename": "ogLive-focal-5.13.0-27-beta-amd64-r20210706.5b4bf5f.iso", - "installed": false, - "compatible": true, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-focal-5.13.0-27-beta-amd64-r20210706.5b4bf5f.iso" - }, - { - "id": "2", - "filename": "ogLive-focal-5.11.0-22-generic-amd64-r20210413.992ebb9.iso", - "installed": true, - "compatible": true, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-focal-5.11.0-22-generic-amd64-r20210413.992ebb9.iso" - }, - { - "id": "3", - "filename": "ogLive-focal-5.8.0-50-generic-amd64-r20210413.992ebb9.iso", - "installed": false, - "compatible": true, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-focal-5.8.0-50-generic-amd64-r20210413.992ebb9.iso" - }, - { - "id": "4", - "filename": "ogLive-bionic-5.4.0-40-generic-amd64-r20200629.85eceaf.iso", - "installed": false, - "compatible": true, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-bionic-5.4.0-40-generic-amd64-r20200629.85eceaf.iso" - }, - { - "id": "5", - "filename": "ogLive-bionic-5.0.0-27-generic-amd64-r20190830.7208cc9.iso", - "installed": false, - "compatible": true, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-bionic-5.0.0-27-generic-amd64-r20190830.7208cc9.iso" - }, - { - "id": "6", - "filename": "ogLive-bionic-5.0.0-15-generic-amd64-r20190605.527cd97.iso", - "installed": false, - "compatible": true, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-bionic-5.0.0-15-generic-amd64-r20190605.527cd97.iso" - }, - { - "id": "7", - "filename": "ogLive-xenial-4.8.0-39-generic-amd64-r5652.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-xenial-4.8.0-39-generic-amd64-r5652.iso" - }, - { - "id": "8", - "filename": "ogLive-xenial-4.13.0-17-generic-amd64-r5520.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-xenial-4.13.0-17-generic-amd64-r5520.iso" - }, - { - "id": "9", - "filename": "ogLive-precise-3.2.0-23-generic-r5159.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-precise-3.2.0-23-generic-r5159.iso" - }, - { - "id": "10", - "filename": "ogLive-xenial-4.8.0-39-generic-amd64-r5331.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-xenial-4.8.0-39-generic-amd64-r5331.iso" - }, - { - "id": "11", - "filename": "ogLive-xenial-4.8.0-39-generic-amd64-r5225.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-xenial-4.8.0-39-generic-amd64-r5225.iso" - }, - { - "id": "12", - "filename": "ogLive-precise-3.2.0-23-generic-r4820.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-precise-3.2.0-23-generic-r4820.iso" - }, - { - "id": "13", - "filename": "ogLive-xenial-4.4.0-34-generic-r4999.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-xenial-4.4.0-34-generic-r4999.iso" - }, - { - "id": "14", - "filename": "ogLive-wily-4.2.0-35-generic-r4919.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-wily-4.2.0-35-generic-r4919.iso" - }, - { - "id": "15", - "filename": "ogLive-vivid-3.19.0-49-generic-r4795.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-vivid-3.19.0-49-generic-r4795.iso" - }, - { - "id": "16", - "filename": "ogLive-precise-3.2.0-23-generic-r4311.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-precise-3.2.0-23-generic-r4311.iso" - }, - { - "id": "17", - "filename": "ogLive-precise-3.11.0-26-generic-r4413.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-precise-3.11.0-26-generic-r4413.iso" - }, - { - "id": "18", - "filename": "ogLive-raring-3.8.0-22-generic-r3836.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-raring-3.8.0-22-generic-r3836.iso" - }, - { - "id": "19", - "filename": "ogLive-quantal-3.7.6-030706-generic-r3619.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-quantal-3.7.6-030706-generic-r3619.iso" - }, - { - "id": "20", - "filename": "ogLive-precise-3.2.0-23-generic-r3257.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-precise-3.2.0-23-generic-r3257.iso" - }, - { - "id": "21", - "filename": "ogLive-precise-3.2.0-23-generic-pae-r3017.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-precise-3.2.0-23-generic-pae-r3017.iso" - }, - { - "id": "22", - "filename": "ogLive-oneiric-3.0.0-14-generic-r2439.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-oneiric-3.0.0-14-generic-r2439.iso" - }, - { - "id": "23", - "filename": "ogLive-natty-2.6.38-8-generic-pae-r2303.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-natty-2.6.38-8-generic-pae-r2303.iso" - }, - { - "id": "24", - "filename": "ogLive-natty-2.6.38-8-generic-pae-r2268.iso", - "installed": false, - "compatible": false, - "URL": "https://ognproject.evlt.uma.es/trac/downloads/ogLive-natty-2.6.38-8-generic-pae-r2268.iso" - } - ] - }, - "ogLivesInserted": 0 - } - - this.downloads = response.data.downloads; + }); } diff --git a/ogWebconsole/src/app/components/pxe/pxe/pxe.component.css b/ogWebconsole/src/app/components/pxe/pxe/pxe.component.css index 4bf5d54..f567f1c 100644 --- a/ogWebconsole/src/app/components/pxe/pxe/pxe.component.css +++ b/ogWebconsole/src/app/components/pxe/pxe/pxe.component.css @@ -113,3 +113,42 @@ table { .info-container strong { color: #0d47a1; } + +.info-container { + background-color: #e8eaf6; + padding: 16px; + border-radius: 4px; + font-size: 14px; + overflow-x: auto; + margin-top: 16px; + border: 1px solid #c5cae9; +} + +.info-container h3 { + margin-top: 0; + font-size: 16px; + color: #1e88e5; +} + +.info-container p { + margin: 8px 0; + line-height: 1.5; +} + +.info-container strong { + color: #0d47a1; +} + +.info-container pre { + background-color: #f5f5f5; + padding: 16px; + border-radius: 4px; + font-size: 12px; + overflow-x: auto; + white-space: pre; + border: 1px solid #dcdcdc; +} + +td { + cursor: pointer; +} diff --git a/ogWebconsole/src/app/components/pxe/pxe/pxe.component.html b/ogWebconsole/src/app/components/pxe/pxe/pxe.component.html index 791bb20..21bf12f 100644 --- a/ogWebconsole/src/app/components/pxe/pxe/pxe.component.html +++ b/ogWebconsole/src/app/components/pxe/pxe/pxe.component.html @@ -66,8 +66,5 @@
ID: {{ selectedItem.id }}
-Nombre: {{ selectedItem.name }}
-Creado en ogBoot: {{ selectedItem.synchronized ? 'Sí' : 'No' }}
-Fecha de Creación: {{ selectedItem.createdAt | date:'dd/MM/yyyy HH:mm:ss' }}
-{{ previewContent }}+ \ No newline at end of file diff --git a/ogWebconsole/src/app/components/pxe/pxe/pxe.component.ts b/ogWebconsole/src/app/components/pxe/pxe/pxe.component.ts index d163ce0..658703e 100644 --- a/ogWebconsole/src/app/components/pxe/pxe/pxe.component.ts +++ b/ogWebconsole/src/app/components/pxe/pxe/pxe.component.ts @@ -25,6 +25,7 @@ export class PxeComponent { alertMessage: string | null = null; datePipe: DatePipe = new DatePipe('es-ES'); selectedItem: any = null; + previewContent: string | null = null; columns = [ { columnDef: 'id', @@ -85,7 +86,31 @@ export class PxeComponent { } showPxeInfo(template: any) { - this.selectedItem = template; // Asigna el elemento clicado a selectedItem + this.selectedItem = template; + this.previewContent = this.generatePreviewContent(template); // Generar contenido de resumen + } + + generatePreviewContent(formValues: any): string { + return `#!ipxe +set timeout ${formValues.timeout} +set timeout-style ${formValues.timeoutStyle} + +set ISODIR ${formValues.isoDir} +set default 0 +set kernelargs ${formValues.kernelArgs} +#Menú de entrada para seleccionar OgLive + +:try_iso +kernel http://SERVERIP/tftpboot/\${ISODIR}/ogvmlinuz \${kernelargs} || goto fallback +initrd http://SERVERIP/tftpboot/\${ISODIR}/oginitrd.img +boot + +:fallback +echo "OgLive default" +set ISODIR ogLive +kernel http://SERVERIP/tftpboot/\${ISODIR}/ogvmlinuz \${kernelargs} +initrd http://SERVERIP/tftpboot/\${ISODIR}/oginitrd.img +boot`; } toggleAction(image: any, action:string): void {