Modificado comportamiento al hacer click en un aula, la petición de mostrar ordenadores y la de actualizar el estado de cada uno, se hacen secuencialmente y no en paralelo, asi evitamos el loader general mientras se resuelven los estados de los equipos
parent
bc3190380e
commit
a26a1727d7
|
|
@ -418,11 +418,9 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
event.stopPropagation();
|
||||
this.selectedNode = node;
|
||||
const selectedClientsBeforeEdit = this.selection.selected.map(client => client.uuid);
|
||||
this.fetchClientsForNode(node, selectedClientsBeforeEdit);
|
||||
|
||||
if (node.type === NodeType.Classroom || node.type === NodeType.ClientsGroup) {
|
||||
this.getStatusForAllClientsInNode(node);
|
||||
}
|
||||
|
||||
const checkStatusAfterLoad = node.type === NodeType.Classroom || node.type === NodeType.ClientsGroup;
|
||||
this.fetchClientsForNode(node, selectedClientsBeforeEdit, checkStatusAfterLoad);
|
||||
}
|
||||
|
||||
onMenuClick(event: Event, node: any): void {
|
||||
|
|
@ -433,7 +431,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
|
||||
public fetchClientsForNode(node: any, selectedClientsBeforeEdit: string[] = []): void {
|
||||
public fetchClientsForNode(node: any, selectedClientsBeforeEdit: string[] = [], checkStatusAfterLoad: boolean = false): void {
|
||||
const params = new HttpParams({ fromObject: this.filters });
|
||||
|
||||
// Agregar parámetros de ordenamiento al backend
|
||||
|
|
@ -476,6 +474,10 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
|||
members.forEach((c: Client) => c.uuid && this.syncingClientIds.add(c.uuid));
|
||||
}
|
||||
|
||||
if (checkStatusAfterLoad) {
|
||||
this.getStatusForAllClientsInNode(node);
|
||||
}
|
||||
|
||||
// Calcular estadísticas después de cargar los clientes
|
||||
this.calculateLocalStats();
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue