From bc74caad425fcf80204581659eb42ad25ecc1763 Mon Sep 17 00:00:00 2001 From: jmbardallo Date: Thu, 22 Oct 2026 12:59:31 +0200 Subject: [PATCH] feat(commands): pass target_os and enable smart queuing for plugin commands --- CHANGELOG.md | 7 +++++++ .../execute-command.component.ts | 19 ++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd3ad5a..bdf911b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.17.0] - 2026-10-22 + +### Added +- **Encolado Inteligente por Sistema Operativo Destino (`execute-command.component`)**: + - Al ejecutar comandos de plugins específicos de un sistema operativo (como `ogfreeze` para Windows), si hay equipos apagados, desconectados o actualmente iniciados en un SO diferente (ej. `og-live`), se ofrece la confirmación de encolado (`QueueConfirmationModalComponent`) enviando el metadato `target_os`. + - La tarea encolada esperará de forma segura en `ogcore` a que el equipo arranque en el sistema operativo compatible antes de ser despachada. + ## [1.16.0] - 2026-10-22 ### Added 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 e528fbe..c02afb1 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 @@ -540,7 +540,7 @@ export class ExecuteCommandComponent implements OnInit { const requiredOs = (pluginCmd.os || []).map(os => os.toLowerCase()); - // 1. Verificar si hay equipos encendidos en un sistema operativo incompatible (ej. Linux u og-live cuando se requiere Windows) + // 1. Equipos en un sistema operativo no coincidente (ej. Linux u og-live cuando se requiere Windows) const incompatibleRunningClients = this.clientData.filter(c => { const status = (c.status || '').toLowerCase(); const isOnline = status !== 'off' && status !== 'disconnected' && status !== ''; @@ -548,22 +548,14 @@ export class ExecuteCommandComponent implements OnInit { return !requiredOs.some(req => status.includes(req)); }); - if (incompatibleRunningClients.length > 0) { - const names = incompatibleRunningClients.map(c => c.name || c.ip).join(', '); - this.toastService.warning( - `Los siguientes equipos no están ejecutando ${requiredOs.join('/')} actualmente: ${names}. La acción requiere que el equipo esté iniciado en el sistema compatible.`, - pluginCmd.label - ); - return; - } - - // 2. Verificar si hay equipos apagados o desconectados + // 2. Equipos apagados o desconectados const offlineClients = this.clientData.filter(c => { const status = (c.status || '').toLowerCase(); return !status || status === 'off' || status === 'disconnected'; }); - if (offlineClients.length > 0) { + // Si hay equipos no listos inmediatamente (apagados o en otro SO), ofrecer encolado + if (offlineClients.length > 0 || incompatibleRunningClients.length > 0) { const dialogRef = this.dialog.open(QueueConfirmationModalComponent, { width: '400px', data: { clients: this.clientData } @@ -595,7 +587,8 @@ export class ExecuteCommandComponent implements OnInit { this.http.post(url, { clients: clientIds, - queue: queue + queue: queue, + target_os: pluginCmd.os }).subscribe({ next: (response) => { this.pluginService.toggleFreezeStatus(this.clientData, isFreeze);