diff --git a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.css b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.css index d2ea8a8..f4ae6a5 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.css +++ b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.css @@ -51,21 +51,3 @@ .mat-elevation-z8 { box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.2); } - -.example-headers-align .mat-expansion-panel-header-description { - justify-content: space-between; - align-items: center; -} - -.example-headers-align .mat-mdc-form-field+.mat-mdc-form-field { - margin-left: 8px; -} - -.example-button-row { - display: table-cell; - max-width: 600px; -} - -.example-button-row .mat-mdc-button-base { - margin: 8px 8px 8px 0; -} \ No newline at end of file diff --git a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.html b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.html index f8caba7..fb12d46 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.html +++ b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.html @@ -37,7 +37,7 @@ - {{ 'idColumnHeader' | translate }} @@ -50,12 +50,12 @@ - {{ 'nameColumnHeader' | translate }} + {{ 'ipLabel' | translate }} {{ element.ip }} - {{ 'nameColumnHeader' | translate }} + {{ 'macLabel' | translate }} {{ element.mac }} @@ -77,4 +77,4 @@ - \ No newline at end of file + diff --git a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts index 95be23e..b2413ce 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe-boot-files/pxe-boot-files.component.ts @@ -4,6 +4,7 @@ import { HttpClient } from '@angular/common/http'; import { ToastrService } from 'ngx-toastr'; import { ConfigService } from '@services/config.service'; import { JoyrideService } from 'ngx-joyride'; +import {MatTableDataSource} from "@angular/material/table"; @Component({ selector: 'app-pxe-boot-files', @@ -15,7 +16,7 @@ export class PxeBootFilesComponent implements OnInit { availableOrganizationalUnits: any[] = []; selectedUnitChildren: any[] = []; - dataSource: any[] = []; + dataSource = new MatTableDataSource(); taskForm: FormGroup; units: any[] = []; ogLiveOptions: any[] = []; @@ -72,14 +73,14 @@ export class PxeBootFilesComponent implements OnInit { loadChildUnits(event: any) { this.http.get(`${this.baseUrl}/clients?organizationalUnit.id=${event.value.id}`).subscribe( response => { - this.dataSource = response['hydra:member']; + this.dataSource.data = response['hydra:member']; }, error => console.error('Error fetching child units:', error) ); } applyToAll(): void { - this.dataSource = this.dataSource.map(client => ({ + this.dataSource.data = this.dataSource.data.map(client => ({ ...client, ogLive: this.globalOgLive || client.ogLive })); @@ -88,7 +89,7 @@ export class PxeBootFilesComponent implements OnInit { saveOgLiveTemplates(): void { const groupedByTemplate: { [key: string]: string[] } = {}; - this.dataSource.forEach(client => { + this.dataSource.data.forEach(client => { if (client.ogLive) { if (!groupedByTemplate[client.ogLive]) { groupedByTemplate[client.ogLive] = []; @@ -107,10 +108,10 @@ export class PxeBootFilesComponent implements OnInit { this.http.post(url, payload).subscribe({ next: () => { - this.toastService.success(`Clientes guardados correctamente para la plantilla ${templateId}`); + this.toastService.success(`Clientes guardados correctamente para la plantilla`); }, error: () => { - this.toastService.error(`Error al guardar clientes para la plantilla ${templateId}`); + this.toastService.error(`Error al guardar clientes para la plantilla`); } }); }); 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 bf13061..6f86ccf 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 @@ -8,7 +8,7 @@ - {{ 'viewInfoButton' | translate }} + {{ 'viewInfoButton' | translate }} {{ 'addOgLiveButton' | translate }} @@ -57,14 +57,14 @@ {{ column.header }} - - - {{ 'checkCircle' | translate }} + + + {{ 'yesOption' | translate }} - - {{ 'cancelIcon' | translate }} - - + + {{ 'noOption' | translate }} + + @@ -99,9 +99,6 @@ {{ 'viewIcon' | translate }} - - {{ 'editIcon' | translate }} - {{ 'deleteIcon' | translate }} diff --git a/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.ts b/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.ts index f627fba..6d8dfb5 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe-images/pxe-images.component.ts @@ -25,8 +25,8 @@ export class PXEimagesComponent implements OnInit { images: { downloadUrl: string; name: string; uuid: string }[] = []; dataSource = new MatTableDataSource(); length: number = 0; - itemsPerPage: number = 10; - page: number = 1; + itemsPerPage: number = 20; + page: number = 0; pageSizeOptions: number[] = [5, 10, 20, 40, 100]; selectedElements: string[] = []; loading: boolean = false; @@ -94,12 +94,15 @@ export class PXEimagesComponent implements OnInit { } search(): void { - this.dataService.getImages(this.filters).subscribe( + this.loading = true; + this.http.get(`${this.apiUrl}?page=${this.page +1 }&itemsPerPage=${this.itemsPerPage}`, { params: this.filters }).subscribe( data => { - this.dataSource.data = data; + this.dataSource.data = data['hydra:member']; + this.length = data['hydra:totalItems']; + this.loading = false; }, error => { - console.error('Error fetching og lives', error); + this.loading = false; } ); } @@ -160,19 +163,6 @@ export class PXEimagesComponent implements OnInit { } } - editImage(image: any): void { - const dialogRef = this.dialog.open(CreatePXEImageComponent, { - width: '700px', - data: image - }); - - dialogRef.afterClosed().subscribe(result => { - if (result) { - this.search(); - } - }); - } - deleteImage(image: any): void { const dialogRef = this.dialog.open(DeleteModalComponent, { width: '400px', @@ -203,22 +193,11 @@ export class PXEimagesComponent implements OnInit { const dialogRef = this.dialog.open(InfoImageComponent, { data: { data }, width: '700px' }); } - applyFilter() { - this.http.get(`${this.apiUrl}?page=${this.page}&itemsPerPage=${this.itemsPerPage}`).subscribe({ - next: (response) => { - this.dataSource.data = response['hydra:member']; - this.length = response['hydra:totalItems']; - }, - error: (error) => { - console.error('Error al cargar las imágenes:', error); - } - }); - } - - onPageChange(event: PageEvent) { + onPageChange(event: any): void { this.page = event.pageIndex; this.itemsPerPage = event.pageSize; - this.applyFilter(); + this.length = event.length; + this.search(); } loadAlert(): Observable { @@ -248,6 +227,7 @@ export class PXEimagesComponent implements OnInit { this.joyrideService.startTour({ steps: [ 'titleStep', + 'viewInfoStep', 'addImageStep', 'searchNameStep', 'searchDefaultImageStep', diff --git a/ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.html b/ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.html deleted file mode 100644 index 75a76cc..0000000 --- a/ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.html +++ /dev/null @@ -1,43 +0,0 @@ -{{ isEditMode ? ('editTemplateTitle' | translate) : ('addTemplateTitle' | translate) }} - - - - - - {{ 'templateNameLabel' | translate }} - - - {{ 'templateNameError' | translate }} - - - - - {{ 'templateContentLabel' | translate }} - - - {{ 'templateContentError' | translate }} - - - - - - - - - - {{ 'loadTemplateModelButton' | translate }} - - - {{ 'ogLiveModel' | translate }} - {{ 'diskModel' | translate }} - - - - {{ 'cancelButton' | translate }} - - {{ isEditMode ? ('updateButton' | translate) : ('createButton' | translate) }} - - - - \ No newline at end of file diff --git a/ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.css b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.css similarity index 52% rename from ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.css rename to ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.css index 65a0a2c..af4ebe4 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.css +++ b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.css @@ -1,6 +1,3 @@ -mat-form-field { - width: 100%; -} pre { background-color: #eceff1; @@ -12,41 +9,17 @@ pre { color: #333; } -mat-dialog-actions { - margin-top: 20px; + +.dialog-content { display: flex; - justify-content: flex-end; + flex-direction: column; + padding: 40px; } -button { - margin-left: 10px; -} - -button[type="submit"] { - background-color: #3f51b5; - color: #fff; -} - -button[type="submit"]:disabled { - background-color: #c5cae9; -} - -h2 { - margin-bottom: 20px; - font-size: 1.5rem; - color: #000000; - text-align: center; -} - -h3 { - margin-top: 30px; - font-size: 1.2rem; - color: #000000; -} - -.spacing-container { - margin-top: 20px; - margin-bottom: 16px; +.pxe-form { + width: 100%; + display: flex; + flex-direction: column; } .list-item-content { @@ -56,6 +29,11 @@ h3 { width: 100%; } +.form-field { + width: 100%; + margin-top: 16px; +} + .text-content { flex-grow: 1; margin-right: 16px; @@ -72,13 +50,11 @@ h3 { cursor: pointer; } -.actions-container { +.action-container { display: flex; - justify-content: space-between; - width: 100%; - align-items: center; - margin-bottom: 1rem; - padding-right: 1rem; + justify-content: flex-end; + gap: 1em; + padding: 1.5em; } .action-buttons { diff --git a/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.html b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.html new file mode 100644 index 0000000..f9b4836 --- /dev/null +++ b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.html @@ -0,0 +1,44 @@ +{{ isEditMode ? ('editTemplateTitle' | translate) : ('addTemplateTitle' | translate) }} + + + + + {{ 'templateNameLabel' | translate }} + + + {{ 'templateNameError' | translate }} + + + + + {{ 'templateContent' | translate }} + + + {{ 'templateContentError' | translate }} + + + + + {{ 'isDefaultLabel' | translate }} + + + + + + + + {{ 'loadTemplateModelButton' | translate }} + + + {{ 'ogLiveModel' | translate }} + {{ 'diskModel' | translate }} + + + + {{ 'cancelButton' | translate }} + + {{ isEditMode ? ('saveButton' | translate) : ('saveButton' | translate) }} + + + diff --git a/ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.ts b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.ts similarity index 61% rename from ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.ts rename to ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.ts index e2f7ee6..ae7c9d1 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/create-pxeTemplate/create-pxe-template.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.ts @@ -20,35 +20,35 @@ export class CreatePxeTemplateComponent implements OnInit { templateModels = { ogLive: `#!ipxe -set timeout 0 -set timeout-style hidden -set ISODIR __OGLIVE__ -set default 0 -set kernelargs __INFOHOST__ -:try_iso -kernel http://__SERVERIP__/tftpboot/\${ISODIR}/ogvmlinuz \${kernelargs} || goto fallback -initrd http://__SERVERIP__/tftpboot/\${ISODIR}/oginitrd.img -boot + set timeout 0 + set timeout-style hidden + set ISODIR __OGLIVE__ + set default 0 + set kernelargs __INFOHOST__ + :try_iso + kernel http://__SERVERIP__/tftpboot/\${ISODIR}/ogvmlinuz \${kernelargs} || goto fallback + initrd http://__SERVERIP__/tftpboot/\${ISODIR}/oginitrd.img + boot -:fallback -set ISODIR ogLive -kernel http://__SERVERIP__/tftpboot/\${ISODIR}/ogvmlinuz \${kernelargs} -initrd http://__SERVERIP__/tftpboot/\${ISODIR}/oginitrd.img -boot`, + :fallback + set ISODIR ogLive + kernel http://__SERVERIP__/tftpboot/\${ISODIR}/ogvmlinuz \${kernelargs} + initrd http://__SERVERIP__/tftpboot/\${ISODIR}/oginitrd.img + boot`, - disco: `#!ipxe + disco: `#!ipxe -iseq \${platform} efi && goto uefi_boot || goto bios_boot + iseq \${platform} efi && goto uefi_boot || goto bios_boot -:bios_boot -echo "Running in BIOS mode - Booting first disk" -chain http://__SERVERIP__/tftpboot/grub.exe --config-file="title FirstHardDisk;chainloader (hd0)+1;rootnoverify (hd0);boot" || echo "Failed to boot in BIOS mode" -exit + :bios_boot + echo "Running in BIOS mode - Booting first disk" + chain http://__SERVERIP__/tftpboot/grub.exe --config-file="title FirstHardDisk;chainloader (hd0)+1;rootnoverify (hd0);boot" || echo "Failed to boot in BIOS mode" + exit -:uefi_boot -echo "Running in UEFI mode - Booting first disk" -sanboot --no-describe --drive 0 --filename \\EFI\\grub\\Boot\\grubx64.efi || echo "Failed to boot in UEFI mode" -exit` + :uefi_boot + echo "Running in UEFI mode - Booting first disk" + sanboot --no-describe --drive 0 --filename \\EFI\\grub\\Boot\\grubx64.efi || echo "Failed to boot in UEFI mode" + exit` }; constructor( @@ -72,7 +72,8 @@ exit` this.templateForm = this.fb.group({ name: [this.data?.name || '', Validators.required], - templateContent: [this.data?.templateContent || '', Validators.required] + templateContent: [this.data?.templateContent || '', Validators.required], + isDefault: [this.data?.isDefault || false] }); } @@ -99,7 +100,8 @@ exit` const formValues = this.templateForm.value; const payload = { name: formValues.name, - templateContent: formValues.templateContent + templateContent: formValues.templateContent, + isDefault: formValues.isDefault, }; this.http.post(`${this.baseUrl}/pxe-templates`, payload).subscribe({ @@ -117,7 +119,8 @@ exit` const formValues = this.templateForm.value; const payload = { name: formValues.name, - templateContent: formValues.templateContent + templateContent: formValues.templateContent, + isDefault: formValues.isDefault, }; this.http.patch(`${this.baseUrl}/pxe-templates/${this.data.uuid}`, payload).subscribe({ @@ -138,42 +141,6 @@ exit` this.toastService.info(`Plantilla ${type} cargada.`); } - addClientToTemplate(client: any): void { - const postData = { - client: client['@id'] - }; - - this.http.post(`${this.baseUrl}/pxe-templates/${this.data.uuid}/sync-client`, postData).subscribe( - () => { - this.toastService.success('Clientes asignados correctamente'); - }, - error => { - this.toastService.error(error.error['hydra:description']); - } - ); - } - - deleteClient(client: any): void { - const dialogRef = this.dialog.open(DeleteModalComponent, { - width: '300px', - data: { name: client.name } - }); - - dialogRef.afterClosed().subscribe(result => { - if (result) { - this.http.post(`${this.baseUrl}/pxe-templates/${this.data.uuid}/delete-client`, { client: client['@id'] }).subscribe({ - next: () => { - this.toastService.success('Cliente eliminado exitosamente'); - this.dialogRef.close(); - }, - error: error => { - this.toastService.error(error.error['hydra:description']); - } - }); - } - }); - } - onCancel(): void { this.dialogRef.close(false); } diff --git a/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.html b/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.html index a6cb871..02fd939 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.html +++ b/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.html @@ -1,5 +1,5 @@ - + help @@ -7,7 +7,7 @@ translate }} - {{ 'viewInfoButton' | translate }} + {{ 'viewInfoButton' | translate }} {{ 'addTemplateButton' | translate }} @@ -22,10 +22,10 @@ search {{ 'searchHint' | translate }} - - {{ 'createdInOgbootLabel' | translate }} - + {{ 'isDefaultLabel' | translate }} + {{ 'allOption' | translate }} {{ 'yesOption' | translate }} @@ -36,16 +36,31 @@ + text="{{ 'tableDatePxeTemplateText' | translate }}"> {{ column.header }} - - {{ image[column.columnDef] ? 'check_circle' : 'cancel' }} - + + + {{ 'yesOption' | translate }} + + + {{ 'noOption' | translate }} + + - + + + + {{ 'yesOption' | translate }} + + + {{ 'noOption' | translate }} + + + + {{ column.cell(image) }} @@ -60,7 +75,7 @@ edit - + {{ 'deleteIcon' | translate }} diff --git a/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.ts b/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.ts index 55cb6ad..9c35f3a 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe/pxe.component.ts @@ -1,9 +1,8 @@ import { HttpClient } from '@angular/common/http'; import {Component, OnInit} from '@angular/core'; -import { CreatePxeTemplateComponent } from './create-pxeTemplate/create-pxe-template.component'; +import { CreatePxeTemplateComponent } from './manage-pxeTemplate/create-pxe-template.component'; import { MatDialog } from '@angular/material/dialog'; import { MatTableDataSource } from '@angular/material/table'; -import { PageEvent } from '@angular/material/paginator'; import { ToastrService } from 'ngx-toastr'; import { DatePipe } from '@angular/common'; import { DataService } from './data.service'; @@ -26,8 +25,8 @@ export class PxeComponent implements OnInit{ currentPage: number = 1; dataSource = new MatTableDataSource(); length: number = 0; - itemsPerPage: number = 10; - page: number = 1; + itemsPerPage: number = 20; + page: number = 0; pageSizeOptions: number[] = [5, 10, 20, 40, 100]; selectedElements: string[] = []; loading: boolean = false; @@ -45,17 +44,22 @@ export class PxeComponent implements OnInit{ { columnDef: 'name', header: 'Nombre de la plantilla', - cell: (user: any) => `${user.name}` + cell: (user: any) => user.name }, { columnDef: 'synchronized', header: 'Sincronizado', - cell: (user: any) => `${user.synchronized}` + cell: (user: any) => user.synchronized + }, + { + columnDef: 'isDefault', + header: 'Plantilla por defecto', + cell: (user: any) => user.isDefault }, { columnDef: 'createdAt', header: 'Fecha de creación', - cell: (user: any) => `${this.datePipe.transform(user.createdAt, 'dd/MM/yyyy hh:mm:ss')}` + cell: (user: any) => this.datePipe.transform(user.createdAt, 'dd/MM/yyyy hh:mm:ss') } ]; displayedColumns = [...this.columns.map(column => column.columnDef), 'actions']; @@ -80,12 +84,15 @@ export class PxeComponent implements OnInit{ } search(): void { - this.dataService.getPxeTemplates(this.filters).subscribe( + this.loading = true; + this.http.get(`${this.apiUrl}?page=${this.page +1 }&itemsPerPage=${this.itemsPerPage}`, { params: this.filters }).subscribe( data => { - this.dataSource.data = data; + this.dataSource.data = data['hydra:member']; + this.length = data['hydra:totalItems']; + this.loading = false; }, error => { - console.error('Error fetching pxe templates', error); + this.loading = false; } ); } @@ -100,10 +107,9 @@ export class PxeComponent implements OnInit{ }); } - editPxeTemplate(template: any) { const dialogRef = this.dialog.open(CreatePxeTemplateComponent, { - data: template, // Pasa los datos del template para edición + data: template, width: '800px' }); @@ -128,7 +134,6 @@ export class PxeComponent implements OnInit{ this.search(); }, error: (error) => { - console.error('Error al eliminar la subred', error); this.toastService.error(error.error['hydra:description']); } }); @@ -143,19 +148,7 @@ export class PxeComponent implements OnInit{ showTemplate(event: MouseEvent, data: any): void { event.stopPropagation(); - const dialogRef = this.dialog.open(ShowTemplateContentComponent, { data: { data }, width: '700px' }); - } - - applyFilter() { - this.http.get(`${this.apiUrl}?page=${this.page}&itemsPerPage=${this.itemsPerPage}`).subscribe({ - next: (response) => { - this.dataSource.data = response['hydra:member']; - this.length = response['hydra:totalItems']; - }, - error: (error) => { - console.error('Error al cargar las imágenes:', error); - } - }); + const dialogRef = this.dialog.open(ShowTemplateContentComponent, { data: { data }, width: '800px' }); } loadAlert(): Observable { @@ -181,20 +174,21 @@ export class PxeComponent implements OnInit{ ); } - onPageChange(event: PageEvent) { + onPageChange(event: any): void { this.page = event.pageIndex; this.itemsPerPage = event.pageSize; - this.applyFilter(); + this.length = event.length; + this.search(); } - iniciarTour(): void { + initTour(): void { this.joyrideService.startTour({ steps: [ - 'serverInfoStep', 'titleStep', + 'viewInfoStep', 'addTemplateStep', 'searchNameStep', - 'searchSyncStep', + 'searchIsDefaultStep', 'tableStep', 'actionsStep', 'paginationStep' diff --git a/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.css b/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.css index d01dcc9..b314670 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.css +++ b/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.css @@ -26,8 +26,15 @@ background-color: #f5f5f5; padding: 16px; border-radius: 4px; - font-size: 12px; + font-size: 14px; overflow-x: auto; white-space: pre; border: 1px solid #dcdcdc; } + +.action-container { + display: flex; + justify-content: flex-end; + gap: 1em; + padding: 1.5em; +} diff --git a/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.html b/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.html index 52d8e53..2724d18 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.html +++ b/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.html @@ -1,4 +1,10 @@ - - {{ 'detailsTitle' | translate: { name: data.data.name } }} - {{ data.data.templateContent }} + + + {{ 'detailsTitle' | translate: { name: data.data.name } }} + {{ data.data.templateContent }} + + + + + Cancelar diff --git a/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.ts b/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.ts index 5ae59ac..ed2fb3b 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe/show-template-content/show-template-content.component.ts @@ -1,5 +1,5 @@ import { Component, Inject } from '@angular/core'; -import { MAT_DIALOG_DATA } from "@angular/material/dialog"; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import { HttpClient } from "@angular/common/http"; import { ConfigService } from "@services/config.service"; @@ -15,8 +15,13 @@ export class ShowTemplateContentComponent { constructor( @Inject(MAT_DIALOG_DATA) public data: any, private http: HttpClient, - private configService: ConfigService + private configService: ConfigService, + public dialogRef: MatDialogRef ) { this.baseUrl = this.configService.apiUrl; } + + close(): void { + this.dialogRef.close(); + } }
{{ data.data.templateContent }}