corregida gestion de oglives
parent
74b7d07b9c
commit
33080ef704
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -107,10 +107,10 @@
|
|||
<td mat-cell *matCellDef="let image" style="text-align: center;" joyrideStep="actionsStep"
|
||||
[text]="'actionsDescription' | translate">
|
||||
<button mat-icon-button color="info" (click)="showOgLive($event, image)">
|
||||
<mat-icon>{{ 'viewIcon' | translate }}</mat-icon>
|
||||
<mat-icon>visibility</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" (click)="deleteImage(image)">
|
||||
<mat-icon>{{ 'deleteIcon' | translate }}</mat-icon>
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button [matMenuTriggerFor]="menu">
|
||||
<mat-icon>menu</mat-icon>
|
||||
|
|
|
|||
|
|
@ -122,7 +122,8 @@ export class PXEimagesComponent implements OnInit {
|
|||
|
||||
addImage(): void {
|
||||
const dialogRef = this.dialog.open(CreatePXEImageComponent, {
|
||||
width: '600px'
|
||||
width: '600px',
|
||||
data: { serverId: this.selectedServerId }
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" [disabled]="template.isDefault" (click)="toggleAction(template, 'delete')">
|
||||
<mat-icon>{{ 'deleteIcon' | translate }}</mat-icon>
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
|
|
|||
Loading…
Reference in New Issue