Refactor groups component to update filter option value and add command execution functionality
parent
81e20ec9f9
commit
c7d6477bf6
|
@ -295,8 +295,22 @@
|
||||||
<button mat-icon-button [matMenuTriggerFor]="clientMenu">
|
<button mat-icon-button [matMenuTriggerFor]="clientMenu">
|
||||||
<mat-icon>more_vert</mat-icon>
|
<mat-icon>more_vert</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<mat-menu #clientMenu="matMenu">
|
<mat-menu #clientMenu="matMenu">
|
||||||
|
|
||||||
|
<mat-menu restoreFocus=false #commandMenu="matMenu" xPosition="before">
|
||||||
|
<button mat-menu-item *ngFor="let command of commands" (click)="executeCommand(command, client)">
|
||||||
|
<span>{{ command.name }}</span>
|
||||||
|
</button>
|
||||||
|
</mat-menu>
|
||||||
|
|
||||||
|
<button mat-menu-item [matMenuTriggerFor]="commandMenu" (click)="fetchCommands()">
|
||||||
|
<mat-icon>play_arrow</mat-icon>
|
||||||
|
<span>{{ 'executeCommand' | translate }}</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
<button mat-menu-item *ngIf="(!syncStatus || syncingClientId !== client.uuid)" (click)="getStatus(client)">
|
<button mat-menu-item *ngIf="(!syncStatus || syncingClientId !== client.uuid)" (click)="getStatus(client)">
|
||||||
<mat-icon>sync</mat-icon>
|
<mat-icon>sync</mat-icon>
|
||||||
<span>{{ 'sync' | translate }}</span>
|
<span>{{ 'sync' | translate }}</span>
|
||||||
|
|
|
@ -480,6 +480,10 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
executeClientCommand(command: Command, client: Client): void {
|
||||||
|
this.toastr.success(`Ejecutando comando: ${command.name} en ${client.name}`);
|
||||||
|
}
|
||||||
|
|
||||||
onShowClientDetail(event: MouseEvent, client: Client): void {
|
onShowClientDetail(event: MouseEvent, client: Client): void {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
this.router.navigate(['clients', client.uuid], { state: { clientData: client } });
|
this.router.navigate(['clients', client.uuid], { state: { clientData: client } });
|
||||||
|
|
Loading…
Reference in New Issue