From de56a23a2bf3b4beaa4c3d41e404dd8db916a326 Mon Sep 17 00:00:00 2001 From: Lucas Lara Date: Wed, 16 Apr 2025 11:33:50 +0200 Subject: [PATCH 1/3] refs #1920 use all clients by default in execute command --- ogWebconsole/src/app/components/groups/groups.component.html | 4 ++-- ogWebconsole/src/app/components/groups/groups.component.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index c780882..116dbc3 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -198,8 +198,8 @@ delete {{ 'delete' | translate }} - + diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 894fff1..aeb341e 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -388,6 +388,9 @@ export class GroupsComponent implements OnInit, OnDestroy { this.http.get(`${this.baseUrl}/clients?organizationalUnit.id=${node.id}&page=${this.page + 1}&itemsPerPage=${this.itemsPerPage}`, { params }).subscribe({ next: (response: any) => { this.selectedClients.data = response['hydra:member']; + if (this.selectedNode) { + this.selectedNode.clients = response['hydra:member']; + } this.length = response['hydra:totalItems']; this.arrayClients = this.selectedClients.data; this.hasClients = this.selectedClients.data.length > 0; -- 2.40.1 From 0096daca42af4af32a2ddd0ffaf9bd86231e4c7f Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Wed, 16 Apr 2025 14:32:17 +0200 Subject: [PATCH 2/3] refs #1924. Refresh status card view --- CHANGELOG.md | 5 +++ .../app/components/groups/groups.component.ts | 37 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db16a14..394f881 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Changelog +## [0.11.2] - 2025-4-16 +### Fixed +- Se ha corregido un error en la actualizacion del estado de los pcs en la vista tarjetas. + +--- ## [0.11.1] - 2025-4-16 ### Improved - Nuevos campos en la tabla de clientes. Tipo de firmware y mac. diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 894fff1..04d5052 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, OnDestroy, ViewChild, QueryList, ViewChildren } from '@angular/core'; +import {Component, OnInit, OnDestroy, ViewChild, QueryList, ViewChildren, ChangeDetectorRef} from '@angular/core'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Router } from '@angular/router'; import { MatDialog } from '@angular/material/dialog'; @@ -110,7 +110,8 @@ export class GroupsComponent implements OnInit, OnDestroy { private joyrideService: JoyrideService, private breakpointObserver: BreakpointObserver, private toastr: ToastrService, - private configService: ConfigService + private configService: ConfigService, + private cd: ChangeDetectorRef, ) { this.baseUrl = this.configService.apiUrl; this.mercureUrl = this.configService.mercureUrl; @@ -175,23 +176,35 @@ export class GroupsComponent implements OnInit, OnDestroy { }) } - private updateClientStatus(clientUuid: string, newStatus: string): void { - const clientIndex = this.selectedClients.data.findIndex(client => client['@id'] === clientUuid); + private updateClientStatus(clientUuid: string, status: string): void { + let updated = false; - if (clientIndex !== -1) { + const index = this.arrayClients.findIndex(client => client['@id'] === clientUuid); + if (index !== -1) { + const updatedClient = {...this.arrayClients[index], status}; + this.arrayClients = [ + ...this.arrayClients.slice(0, index), + updatedClient, + ...this.arrayClients.slice(index + 1) + ]; + updated = true; + } + + const tableIndex = this.selectedClients.data.findIndex(client => client['@id'] === clientUuid); + + if (tableIndex !== -1) { const updatedClients = [...this.selectedClients.data]; - updatedClients[clientIndex] = { - ...updatedClients[clientIndex], - status: newStatus + updatedClients[tableIndex] = { + ...updatedClients[tableIndex], + status: status }; this.selectedClients.data = updatedClients; - this.arrayClients = updatedClients; + } - console.log(`Estado actualizado para el cliente ${clientUuid}: ${newStatus}`); - } else { - console.warn(`Cliente con UUID ${clientUuid} no encontrado en la lista.`); + if (updated) { + this.cd.detectChanges(); } } -- 2.40.1 From 23bf2b51ea7e09bb72b4ac4392afe614f9b94f40 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Wed, 16 Apr 2025 14:33:03 +0200 Subject: [PATCH 3/3] refs #1924. Refresh status card view --- .../src/app/components/repositories/repositories.component.ts | 2 +- .../show-monolitic-images/show-monolitic-images.component.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ogWebconsole/src/app/components/repositories/repositories.component.ts b/ogWebconsole/src/app/components/repositories/repositories.component.ts index b53de26..4a398de 100644 --- a/ogWebconsole/src/app/components/repositories/repositories.component.ts +++ b/ogWebconsole/src/app/components/repositories/repositories.component.ts @@ -60,7 +60,7 @@ export class RepositoriesComponent implements OnInit { cell: (repository: any) => `${this.datePipe.transform(repository.createdAt, 'dd/MM/yyyy hh:mm:ss')}` } ]; - isGitModuleInstalled: boolean = true; + isGitModuleInstalled: boolean = false; displayedColumns: string[] = ['id', 'name', 'ip', 'user', 'images', 'createdAt', 'actions']; constructor( diff --git a/ogWebconsole/src/app/components/repositories/show-monolitic-images/show-monolitic-images.component.html b/ogWebconsole/src/app/components/repositories/show-monolitic-images/show-monolitic-images.component.html index f9db89e..592c09d 100644 --- a/ogWebconsole/src/app/components/repositories/show-monolitic-images/show-monolitic-images.component.html +++ b/ogWebconsole/src/app/components/repositories/show-monolitic-images/show-monolitic-images.component.html @@ -10,7 +10,7 @@
- + -- 2.40.1