PXE info text
parent
2a8cd04129
commit
1092ffa069
|
@ -84,6 +84,7 @@ import {MatExpansionPanel, MatExpansionPanelDescription, MatExpansionPanelTitle}
|
|||
import { OgbootStatusComponent } from './components/ogboot-status/ogboot-status.component';
|
||||
import { CreatePxeBootFileComponent } from './components/pxe-boot-files/create-pxeBootFile/create-pxe-boot-file/create-pxe-boot-file.component';
|
||||
import { NgxChartsModule } from '@swimlane/ngx-charts';
|
||||
import { DeleteImageComponent } from './components/images/images/delete-image/delete-image/delete-image.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@ -127,7 +128,8 @@ import { NgxChartsModule } from '@swimlane/ngx-charts';
|
|||
EditPxeTemplateComponent,
|
||||
PxeBootFilesComponent,
|
||||
OgbootStatusComponent,
|
||||
CreatePxeBootFileComponent
|
||||
CreatePxeBootFileComponent,
|
||||
DeleteImageComponent
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
imports: [BrowserModule,
|
||||
|
|
|
@ -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,7 +34,188 @@ 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;
|
||||
|
||||
}
|
||||
|
||||
onNoClick(): void {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<h1 mat-dialog-title i18n="@@deleteDialogTitle">Eliminar</h1>
|
||||
<div mat-dialog-content>
|
||||
<p i18n="@@deleteConfirmationMessage">¿Estás seguro que deseas eliminar {{data.name}}?</p>
|
||||
</div>
|
||||
<div mat-dialog-actions>
|
||||
<button mat-button (click)="onNoClick()" i18n="@@cancelButton">Cancelar</button>
|
||||
<button mat-button color="warn" (click)="onYesClick()" i18n="@@confirmButton">Eliminar</button>
|
||||
</div>
|
|
@ -0,0 +1,23 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DeleteImageComponent } from './delete-image.component';
|
||||
|
||||
describe('DeleteImageComponent', () => {
|
||||
let component: DeleteImageComponent;
|
||||
let fixture: ComponentFixture<DeleteImageComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [DeleteImageComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(DeleteImageComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,22 @@
|
|||
import { Component, Inject } from '@angular/core';
|
||||
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'app-delete-image',
|
||||
templateUrl: './delete-image.component.html',
|
||||
styleUrl: './delete-image.component.css'
|
||||
})
|
||||
export class DeleteImageComponent {
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<DeleteImageComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: { name: string }
|
||||
) {}
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close(false);
|
||||
}
|
||||
|
||||
onYesClick(): void {
|
||||
this.dialogRef.close(true);
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ import { MatTableDataSource } from "@angular/material/table";
|
|||
import {PageEvent} from "@angular/material/paginator";
|
||||
import {ToastrService} from "ngx-toastr";
|
||||
import { DatePipe } from "@angular/common";
|
||||
import { DeleteImageComponent } from './delete-image/delete-image/delete-image.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-images',
|
||||
|
@ -150,17 +151,27 @@ export class ImagesComponent implements OnInit {
|
|||
}
|
||||
|
||||
deleteImage(image: any): void {
|
||||
this.http.delete(`${this.apiUrl}/${image.uuid}`).subscribe({
|
||||
next: () => {
|
||||
console.log('Imagen eliminada');
|
||||
this.toastService.success('Image deleted successfully');
|
||||
this.loadImages();
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error al eliminar la imagen:', error);
|
||||
}
|
||||
const dialogRef = this.dialog.open(DeleteImageComponent, {
|
||||
width: '300px',
|
||||
data: { name: image.name }
|
||||
});
|
||||
}
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
this.http.delete(`${this.apiUrl}/${image.uuid}`).subscribe({
|
||||
next: () => {
|
||||
console.log('Imagen eliminada');
|
||||
this.toastService.success('Image deleted successfully');
|
||||
this.loadImages();
|
||||
},
|
||||
error: (error) => {
|
||||
console.error('Error al eliminar la imagen:', error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('Eliminación de imagen cancelada');
|
||||
}
|
||||
}); }
|
||||
|
||||
editImage(image: any): void {
|
||||
const dialogRef = this.dialog.open(EditImageComponent, {
|
||||
|
|
|
@ -48,8 +48,8 @@ export class CreatePxeBootFileComponent {
|
|||
onAdd(): void {
|
||||
if (this.selectedPxeTemplate) {
|
||||
const payload = {
|
||||
template: this.selectedPxeTemplate,
|
||||
clients: this.clientes
|
||||
template: `/pxe-templates/${this.selectedPxeTemplate}`,
|
||||
clients: [`/clients/${this.clientes}`]
|
||||
};
|
||||
console.log('Payload:', payload);
|
||||
this.http.post('http://127.0.0.1:8080/pxe-boot-files', payload)
|
||||
|
|
|
@ -88,3 +88,28 @@ table {
|
|||
justify-content: end;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.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: #000000;
|
||||
}
|
||||
|
||||
.info-container p {
|
||||
margin: 8px 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.info-container strong {
|
||||
color: #0d47a1;
|
||||
}
|
||||
|
|
|
@ -64,3 +64,10 @@
|
|||
(page)="onPageChange($event)">
|
||||
</mat-paginator>
|
||||
</div>
|
||||
<div class="info-container" *ngIf="selectedItem">
|
||||
<h3>Detalles de {{ selectedItem.name }}</h3>
|
||||
<p><strong>ID:</strong> {{ selectedItem.id }}</p>
|
||||
<p><strong>Nombre:</strong> {{ selectedItem.name }}</p>
|
||||
<p><strong>Creado en ogBoot:</strong> {{ selectedItem.synchronized ? 'Sí' : 'No' }}</p>
|
||||
<p><strong>Fecha de Creación:</strong> {{ selectedItem.createdAt | date:'dd/MM/yyyy HH:mm:ss' }}</p>
|
||||
</div>
|
||||
|
|
|
@ -14,7 +14,7 @@ import {DatePipe} from "@angular/common";
|
|||
styleUrl: './pxe.component.css'
|
||||
})
|
||||
export class PxeComponent {
|
||||
pxeTemplates: any[] = []; // Inicializa el array de plantillas
|
||||
pxeTemplates: any[] = [];
|
||||
currentPage: number = 1;
|
||||
dataSource = new MatTableDataSource<any>();
|
||||
length: number = 0;
|
||||
|
@ -24,6 +24,7 @@ export class PxeComponent {
|
|||
selectedElements: string[] = [];
|
||||
alertMessage: string | null = null;
|
||||
datePipe: DatePipe = new DatePipe('es-ES');
|
||||
selectedItem: any = null;
|
||||
columns = [
|
||||
{
|
||||
columnDef: 'id',
|
||||
|
@ -84,7 +85,7 @@ export class PxeComponent {
|
|||
}
|
||||
|
||||
showPxeInfo(template: any) {
|
||||
|
||||
this.selectedItem = template; // Asigna el elemento clicado a selectedItem
|
||||
}
|
||||
|
||||
toggleAction(image: any, action:string): void {
|
||||
|
|
Loading…
Reference in New Issue