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.
testing/ogGui-multibranch/pipeline/head There was a failure building this commit Details
testing/ogGui-multibranch/pipeline/pr-main Build queued... Details

pull/62/head
Juan Manuel Bardallo 2026-03-31 13:05:02 +02:00
parent 0a6095c7f9
commit 9d0bc03400
5 changed files with 39 additions and 4 deletions

View File

@ -1,4 +1,8 @@
# Changelog # 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 ## [1.2.7] - 2026-03-31
### Added ### 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. - 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.

View File

@ -37,6 +37,7 @@ export class ExecuteCommandComponent implements OnInit {
{ translationKey: 'executeCommands.softwareInventory', slug: 'software-inventory', disabled: false }, { translationKey: 'executeCommands.softwareInventory', slug: 'software-inventory', disabled: false },
{ translationKey: 'executeCommands.hardwareInventory', slug: 'hardware-inventory', disabled: false }, { translationKey: 'executeCommands.hardwareInventory', slug: 'hardware-inventory', disabled: false },
{ translationKey: 'executeCommands.runScript', slug: 'run-script', disabled: false }, { translationKey: 'executeCommands.runScript', slug: 'run-script', disabled: false },
{ translationKey: 'executeCommands.refresh', slug: 'refresh', disabled: false },
]; ];
client: any = {}; client: any = {};
@ -79,7 +80,8 @@ export class ExecuteCommandComponent implements OnInit {
'software-inventory', 'software-inventory',
'hardware-inventory', 'hardware-inventory',
'remove-cache-image', 'remove-cache-image',
'partition' 'partition',
'refresh'
], ],
'ou-minimal': [ 'ou-minimal': [
'power-on', 'power-on',
@ -112,7 +114,7 @@ export class ExecuteCommandComponent implements OnInit {
if (states[0] === 'off' || states[0] === 'disconnected') { if (states[0] === 'off' || states[0] === 'disconnected') {
command.disabled = !['power-on', 'create-image'].includes(command.slug); command.disabled = !['power-on', 'create-image'].includes(command.slug);
} else { } 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 { } else {
if (command.slug === 'software-inventory') { if (command.slug === 'software-inventory') {
@ -125,6 +127,11 @@ export class ExecuteCommandComponent implements OnInit {
command.disabled = true; command.disabled = true;
} }
} }
if (command.slug === 'refresh') {
command.disabled = !states.every(state => state === 'og-live');
}
return command; return command;
}); });
} }
@ -173,6 +180,10 @@ export class ExecuteCommandComponent implements OnInit {
if (action === 'software-inventory') { if (action === 'software-inventory') {
this.softwareInventory(); this.softwareInventory();
} }
if (action === 'refresh') {
this.refreshClient();
}
} }
rebootClient(): void { 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 { loginClient(): void {
const clientDataToSend = this.clientData.map(client => ({ const clientDataToSend = this.clientData.map(client => ({
name: client.name, name: client.name,

View File

@ -72,5 +72,10 @@ export const COMMAND_TYPES: any = {
'kill-job': { 'kill-job': {
en: 'Cancel Task', en: 'Cancel Task',
es: 'Cancelar Tarea' es: 'Cancelar Tarea'
},
refresh: {
en: 'Refresh',
es: 'Refrescar'
} }
}; };

View File

@ -517,7 +517,8 @@
"partition": "Partition and Format", "partition": "Partition and Format",
"softwareInventory": "Software Inventory", "softwareInventory": "Software Inventory",
"hardwareInventory": "Hardware Inventory", "hardwareInventory": "Hardware Inventory",
"runScript": "Run Script" "runScript": "Run Script",
"refresh": "Refresh"
}, },
"changeOU": "Change Organizational Unit", "changeOU": "Change Organizational Unit",
"moveClientsTooltip": "Move clients to another organizational unit", "moveClientsTooltip": "Move clients to another organizational unit",

View File

@ -518,7 +518,8 @@
"partition": "Particionar y Formatear", "partition": "Particionar y Formatear",
"softwareInventory": "Inventario Software", "softwareInventory": "Inventario Software",
"hardwareInventory": "Inventario Hardware", "hardwareInventory": "Inventario Hardware",
"runScript": "Ejecutar script" "runScript": "Ejecutar script",
"refresh": "Refrescar"
}, },
"changeOU": "Mover", "changeOU": "Mover",
"moveClientsTooltip": "Mover clientes a otra unidad organizativa", "moveClientsTooltip": "Mover clientes a otra unidad organizativa",