Merge pull request 'corregida gestion de oglives' (#79) from manage-ogboot-oglives into main
Reviewed-on: #79pull/80/head^2
commit
c28e66b1a2
|
|
@ -1,5 +1,9 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.5.5] - 2026-05-04
|
||||||
|
### Fixed
|
||||||
|
- Corregida gestion de oglives
|
||||||
|
|
||||||
## [1.5.4] - 2026-04-24
|
## [1.5.4] - 2026-04-24
|
||||||
### Improved
|
### Improved
|
||||||
- Modificado script de post instalación debian para añadir a config.json las nuevas variables.
|
- 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;
|
isEditMode: boolean = false;
|
||||||
loading: boolean = false;
|
loading: boolean = false;
|
||||||
imageId: string | null = null;
|
imageId: string | null = null;
|
||||||
|
serverId: string | null = null;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private toastService: ToastrService,
|
private toastService: ToastrService,
|
||||||
|
|
@ -31,17 +32,27 @@ export class CreatePXEImageComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.fetchDownloads();
|
|
||||||
if (this.data) {
|
if (this.data) {
|
||||||
|
if (this.data.serverId) {
|
||||||
|
this.serverId = this.data.serverId;
|
||||||
|
}
|
||||||
|
if (this.data.uuid) {
|
||||||
this.isEditMode = true;
|
this.isEditMode = true;
|
||||||
this.selectedDownload = this.data.downloadUrl;
|
this.selectedDownload = this.data.downloadUrl;
|
||||||
this.imageId = this.data.uuid; // Assuming UUID is used for edit
|
this.imageId = this.data.uuid; // Assuming UUID is used for edit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.fetchDownloads();
|
||||||
|
}
|
||||||
|
|
||||||
fetchDownloads(): void {
|
fetchDownloads(): void {
|
||||||
this.loading = true;
|
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({
|
.subscribe({
|
||||||
next: (response: any) => {
|
next: (response: any) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
@ -61,9 +72,12 @@ export class CreatePXEImageComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
submitForm(): void {
|
submitForm(): void {
|
||||||
const payload = {
|
const payload: any = {
|
||||||
downloadUrl: this.selectedDownload.url
|
downloadUrl: this.selectedDownload.url
|
||||||
};
|
};
|
||||||
|
if (this.serverId) {
|
||||||
|
payload.bootServer = `/boot-servers/${this.serverId}`;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isEditMode && this.imageId) {
|
if (this.isEditMode && this.imageId) {
|
||||||
this.http.patch(`${this.baseUrl}/og-lives/${this.imageId}`, payload)
|
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"
|
<td mat-cell *matCellDef="let image" style="text-align: center;" joyrideStep="actionsStep"
|
||||||
[text]="'actionsDescription' | translate">
|
[text]="'actionsDescription' | translate">
|
||||||
<button mat-icon-button color="info" (click)="showOgLive($event, image)">
|
<button mat-icon-button color="info" (click)="showOgLive($event, image)">
|
||||||
<mat-icon>{{ 'viewIcon' | translate }}</mat-icon>
|
<mat-icon>visibility</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button mat-icon-button color="warn" (click)="deleteImage(image)">
|
<button mat-icon-button color="warn" (click)="deleteImage(image)">
|
||||||
<mat-icon>{{ 'deleteIcon' | translate }}</mat-icon>
|
<mat-icon>delete</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button mat-icon-button [matMenuTriggerFor]="menu">
|
<button mat-icon-button [matMenuTriggerFor]="menu">
|
||||||
<mat-icon>menu</mat-icon>
|
<mat-icon>menu</mat-icon>
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,8 @@ export class PXEimagesComponent implements OnInit {
|
||||||
|
|
||||||
addImage(): void {
|
addImage(): void {
|
||||||
const dialogRef = this.dialog.open(CreatePXEImageComponent, {
|
const dialogRef = this.dialog.open(CreatePXEImageComponent, {
|
||||||
width: '600px'
|
width: '600px',
|
||||||
|
data: { serverId: this.selectedServerId }
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@
|
||||||
<mat-icon>edit</mat-icon>
|
<mat-icon>edit</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<button mat-icon-button color="warn" [disabled]="template.isDefault" (click)="toggleAction(template, 'delete')">
|
<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>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue