From 436267cfb9a7d9806a8788028d9d41fe3af6f866 Mon Sep 17 00:00:00 2001 From: Lucas Lara Date: Tue, 15 Apr 2025 15:17:03 +0200 Subject: [PATCH] refs #1883 Move 'Execute commands' to tree node actions --- .../execute-command/execute-command.component.html | 11 ++++++++--- .../execute-command/execute-command.component.ts | 2 +- .../src/app/components/groups/groups.component.html | 11 ++++++++--- .../src/app/components/groups/groups.component.ts | 6 ++++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.html b/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.html index d68c2bd..0d66031 100644 --- a/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.html +++ b/ogWebconsole/src/app/components/commands/main-commands/execute-command/execute-command.component.html @@ -8,12 +8,17 @@ [matMenuTriggerFor]="commandMenu"> {{ buttonText }} + + - + \ No newline at end of file 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 4c5aff9..90af7b0 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 @@ -11,7 +11,7 @@ import { ConfigService } from '@services/config.service'; }) export class ExecuteCommandComponent implements OnInit { @Input() clientData: any[] = []; - @Input() buttonType: 'icon' | 'text' = 'icon'; + @Input() buttonType: 'icon' | 'text' | 'menu-item' = 'icon'; @Input() buttonText: string = 'Ejecutar Comandos'; @Input() icon: string = 'terminal'; @Input() disabled: boolean = false; diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index a54f2d3..7510c73 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -198,6 +198,9 @@ delete {{ 'delete' | translate }} + + @@ -245,7 +248,8 @@
+ [checked]="selection.isSelected(client)" + [disabled]="client.status === 'busy' || client.status === 'off' || client.status === 'disconnected'"> Client Icon @@ -314,7 +318,8 @@ + [checked]="selection.isSelected(row)" + [disabled]="row.status === 'busy' || row.status === 'off' || row.status === 'disconnected'"> @@ -424,4 +429,4 @@
-
+ \ 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 088cc9f..a4b9c43 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -369,13 +369,15 @@ export class GroupsComponent implements OnInit, OnDestroy { onNodeClick(event: MouseEvent, node: TreeNode): void { event.stopPropagation(); this.selectedNode = node; - this.fetchClientsForNode(node); + const selectedClientsBeforeEdit = this.selection.selected.map(client => client.uuid); + this.fetchClientsForNode(node, selectedClientsBeforeEdit); } onMenuClick(event: Event, node: any): void { event.stopPropagation(); this.selectedNode = node; - this.fetchClientsForNode(node); + const selectedClientsBeforeEdit = this.selection.selected.map(client => client.uuid); + this.fetchClientsForNode(node, selectedClientsBeforeEdit); }