diff --git a/CHANGELOG.md b/CHANGELOG.md index 311e0a5..f8a7de9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +## [1.3.0] - 2026-03-31 +### Added +- Añadido comando "Refrescar" tanto en un cliente como en un grupo de clientes, de forma que se ejecuta el comando Actualizar en el ogAgent y se actualiza la información de las particiones del cliente y se recarga el menú del ogbrowser. + ## [1.2.7] - 2026-03-31 ### Added - Rediseño de la plantilla para seleccion de particiones, se ha creado un componente compartido por la vista de crear imagen y deploy de imagenes. diff --git a/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.ts b/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.ts index e8bf0bf..11505fd 100644 --- a/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.ts +++ b/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.ts @@ -37,6 +37,7 @@ export class ExecuteCommandComponent implements OnInit { { translationKey: 'executeCommands.softwareInventory', slug: 'software-inventory', disabled: false }, { translationKey: 'executeCommands.hardwareInventory', slug: 'hardware-inventory', disabled: false }, { translationKey: 'executeCommands.runScript', slug: 'run-script', disabled: false }, + { translationKey: 'executeCommands.refresh', slug: 'refresh', disabled: false }, ]; client: any = {}; @@ -79,7 +80,8 @@ export class ExecuteCommandComponent implements OnInit { 'software-inventory', 'hardware-inventory', 'remove-cache-image', - 'partition' + 'partition', + 'refresh' ], 'ou-minimal': [ 'power-on', @@ -112,7 +114,7 @@ export class ExecuteCommandComponent implements OnInit { if (states[0] === 'off' || states[0] === 'disconnected') { command.disabled = !['power-on', 'create-image'].includes(command.slug); } else { - command.disabled = !['power-off', 'reboot', 'login', 'create-image', 'deploy-image', 'remove-cache-image', 'partition', 'run-script', 'software-inventory', 'hardware-inventory'].includes(command.slug); + command.disabled = !['power-off', 'reboot', 'login', 'create-image', 'deploy-image', 'remove-cache-image', 'partition', 'run-script', 'software-inventory', 'hardware-inventory', 'refresh'].includes(command.slug); } } else { if (command.slug === 'software-inventory') { @@ -125,6 +127,11 @@ export class ExecuteCommandComponent implements OnInit { command.disabled = true; } } + + if (command.slug === 'refresh') { + command.disabled = !states.every(state => state === 'og-live'); + } + return command; }); } @@ -173,6 +180,10 @@ export class ExecuteCommandComponent implements OnInit { if (action === 'software-inventory') { this.softwareInventory(); } + + if (action === 'refresh') { + this.refreshClient(); + } } rebootClient(): void { @@ -188,6 +199,19 @@ export class ExecuteCommandComponent implements OnInit { ); } + refreshClient(): void { + this.http.post(`${this.baseUrl}/clients/server/refresh`, { + clients: this.clientData.map((client: any) => client['@id']) + }).subscribe( + response => { + this.toastService.success('Petición de refresco enviada correctamente'); + }, + error => { + this.toastService.error(error.error['hydra:description'] || 'Error de conexión con el cliente'); + } + ); + } + loginClient(): void { const clientDataToSend = this.clientData.map(client => ({ name: client.name, diff --git a/ogWebconsole/src/app/shared/constants/command-types.ts b/ogWebconsole/src/app/shared/constants/command-types.ts index 1d52dbe..7e4c0a9 100644 --- a/ogWebconsole/src/app/shared/constants/command-types.ts +++ b/ogWebconsole/src/app/shared/constants/command-types.ts @@ -72,5 +72,10 @@ export const COMMAND_TYPES: any = { 'kill-job': { en: 'Cancel Task', es: 'Cancelar Tarea' + }, + + refresh: { + en: 'Refresh', + es: 'Refrescar' } }; diff --git a/ogWebconsole/src/locale/en.json b/ogWebconsole/src/locale/en.json index 98298f3..c8efa4e 100644 --- a/ogWebconsole/src/locale/en.json +++ b/ogWebconsole/src/locale/en.json @@ -517,7 +517,8 @@ "partition": "Partition and Format", "softwareInventory": "Software Inventory", "hardwareInventory": "Hardware Inventory", - "runScript": "Run Script" + "runScript": "Run Script", + "refresh": "Refresh" }, "changeOU": "Change Organizational Unit", "moveClientsTooltip": "Move clients to another organizational unit", diff --git a/ogWebconsole/src/locale/es.json b/ogWebconsole/src/locale/es.json index 0ed3206..b991651 100644 --- a/ogWebconsole/src/locale/es.json +++ b/ogWebconsole/src/locale/es.json @@ -518,7 +518,8 @@ "partition": "Particionar y Formatear", "softwareInventory": "Inventario Software", "hardwareInventory": "Inventario Hardware", - "runScript": "Ejecutar script" + "runScript": "Ejecutar script", + "refresh": "Refrescar" }, "changeOU": "Mover", "moveClientsTooltip": "Mover clientes a otra unidad organizativa",