feat(commands): pass target_os and enable smart queuing for plugin commands
parent
27a9cc3f7f
commit
bc74caad42
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<any>(url, {
|
||||
clients: clientIds,
|
||||
queue: queue
|
||||
queue: queue,
|
||||
target_os: pluginCmd.os
|
||||
}).subscribe({
|
||||
next: (response) => {
|
||||
this.pluginService.toggleFreezeStatus(this.clientData, isFreeze);
|
||||
|
|
|
|||
Loading…
Reference in New Issue