Compare commits

..

No commits in common. "844d3dc0f03a7c452787bed050eb962f72a1ff6a" and "de56a23a2bf3b4beaa4c3d41e404dd8db916a326" have entirely different histories.

4 changed files with 14 additions and 32 deletions

View File

@ -1,9 +1,4 @@
# 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.

View File

@ -1,4 +1,4 @@
import {Component, OnInit, OnDestroy, ViewChild, QueryList, ViewChildren, ChangeDetectorRef} from '@angular/core';
import { Component, OnInit, OnDestroy, ViewChild, QueryList, ViewChildren } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
@ -110,8 +110,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
private joyrideService: JoyrideService,
private breakpointObserver: BreakpointObserver,
private toastr: ToastrService,
private configService: ConfigService,
private cd: ChangeDetectorRef,
private configService: ConfigService
) {
this.baseUrl = this.configService.apiUrl;
this.mercureUrl = this.configService.mercureUrl;
@ -176,35 +175,23 @@ export class GroupsComponent implements OnInit, OnDestroy {
})
}
private updateClientStatus(clientUuid: string, status: string): void {
let updated = false;
private updateClientStatus(clientUuid: string, newStatus: string): void {
const clientIndex = this.selectedClients.data.findIndex(client => client['@id'] === clientUuid);
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) {
if (clientIndex !== -1) {
const updatedClients = [...this.selectedClients.data];
updatedClients[tableIndex] = {
...updatedClients[tableIndex],
status: status
updatedClients[clientIndex] = {
...updatedClients[clientIndex],
status: newStatus
};
this.selectedClients.data = updatedClients;
}
this.arrayClients = updatedClients;
if (updated) {
this.cd.detectChanges();
console.log(`Estado actualizado para el cliente ${clientUuid}: ${newStatus}`);
} else {
console.warn(`Cliente con UUID ${clientUuid} no encontrado en la lista.`);
}
}

View File

@ -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 = false;
isGitModuleInstalled: boolean = true;
displayedColumns: string[] = ['id', 'name', 'ip', 'user', 'images', 'createdAt', 'actions'];
constructor(

View File

@ -10,7 +10,7 @@
</div>
<div class="images-button-row">
<button class="action-button" (click)="openImageInfoDialog()">Ver Información</button>
<button disabled class="action-button" (click)="syncRepository()">Sincronizar base de datos</button>
<button class="action-button" (click)="syncRepository()">Sincronizar base de datos</button>
<button class="action-button" (click)="importImage()">
{{ 'importImageButton' | translate }}
</button>