diff --git a/ogWebconsole/src/app/components/global-status/global-status.component.ts b/ogWebconsole/src/app/components/global-status/global-status.component.ts
index 0b0206c..8115ba7 100644
--- a/ogWebconsole/src/app/components/global-status/global-status.component.ts
+++ b/ogWebconsole/src/app/components/global-status/global-status.component.ts
@@ -2,6 +2,7 @@ import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ConfigService } from '@services/config.service';
import { MatTabChangeEvent } from '@angular/material/tabs';
+import {ToastrService} from "ngx-toastr";
@Component({
selector: 'app-global-status',
@@ -40,6 +41,7 @@ export class GlobalStatusComponent implements OnInit {
constructor(
private configService: ConfigService,
+ private toastService: ToastrService,
private http: HttpClient
) {
this.baseUrl = this.configService.apiUrl;
@@ -50,6 +52,56 @@ export class GlobalStatusComponent implements OnInit {
ngOnInit(): void {
this.loadOgBootStatus();
+ this.syncSubnets()
+ this.syncTemplates()
+ this.syncOgLives()
+ }
+
+ syncSubnets() {
+ const timeoutId = setTimeout(() => {
+ this.toastService.error('Error al sincronizar las subredes: tiempo de espera agotado');
+ }, 3500);
+
+ this.http.post(`${this.baseUrl}/subnets/sync`, {}).subscribe({
+ next: (response) => {
+ clearTimeout(timeoutId);
+ this.toastService.success('Sincronización con componente DHCP exitosa');
+ },
+ error: (error) => {
+ clearTimeout(timeoutId);
+ this.toastService.error('Error al sincronizar las subredes DHCP');
+ }
+ });
+ }
+
+ syncTemplates() {
+ const timeoutId = setTimeout(() => {
+ this.toastService.error('Error al sincronizar las plantillas Pxe: tiempo de espera agotado');
+ }, 3500);
+
+ this.http.post(`${this.baseUrl}/pxe-templates/sync`, {})
+ .subscribe(response => {
+ clearTimeout(timeoutId);
+ this.toastService.success('Sincronización de las plantillas Pxe completada');
+ }, error => {
+ clearTimeout(timeoutId);
+ this.toastService.error('Error al sincronizar las plantillas Pxe');
+ });
+ }
+
+ syncOgLives(): void {
+ const timeoutId = setTimeout(() => {
+ this.toastService.error('Error al sincronizar las imagenes ogLive : tiempo de espera agotado');
+ }, 3500);
+
+ this.http.post(`${this.baseUrl}/og-lives/sync`, {})
+ .subscribe(response => {
+ clearTimeout(timeoutId);
+ this.toastService.success('Sincronización con los ogLives completada');
+ }, error => {
+ clearTimeout(timeoutId);
+ this.toastService.error('Error al sincronizar imágenes ogLive');
+ });
}
[key: string]: any;
@@ -193,4 +245,4 @@ export class GlobalStatusComponent implements OnInit {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts
index a4b9c43..20e52bf 100644
--- a/ogWebconsole/src/app/components/groups/groups.component.ts
+++ b/ogWebconsole/src/app/components/groups/groups.component.ts
@@ -421,7 +421,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
width: '900px',
});
dialogRef.afterClosed().subscribe((newUnit) => {
- if (newUnit?.uuid) {
+ if (newUnit) {
this.refreshData(newUnit.uuid);
}
});
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 72cce0c..bf13061 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
@@ -1,5 +1,3 @@
-
{{ column.header }} |
|
---|