Merge pull request 'develop' (#35) from develop into main
testing/ogGui-multibranch/pipeline/head There was a failure building this commit Details
oggui-debian-package/pipeline/head This commit looks good Details

Reviewed-on: #35
pull/36/head^2
Manuel Aranda Rosales 2025-08-06 16:49:23 +02:00
commit 12ab33c175
10 changed files with 76 additions and 5 deletions

View File

@ -1,4 +1,9 @@
# Changelog # Changelog
## [0.19.0] - 2025-08-06
### Added
- Se ha añadido un nuevo estado "enviado" para cuando se ejecuten acciones a equipos en estado Windows o Linux
---
## [0.18.0] - 2025-08-04 ## [0.18.0] - 2025-08-04
### Added ### Added
- Se ha añadido la posibilidad de visualizar logs en tiempo real de Grafana. Tanto en los componentes como en los clientes. - Se ha añadido la posibilidad de visualizar logs en tiempo real de Grafana. Tanto en los componentes como en los clientes.

View File

@ -117,6 +117,11 @@
color: white; color: white;
} }
.chip-sent {
background-color: #b19cd9 !important;
color: white;
}
.status-progress-flex { .status-progress-flex {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -72,9 +72,11 @@
text="{{ 'tracesProgressStepText' | translate }}"> text="{{ 'tracesProgressStepText' | translate }}">
<mat-chip [ngClass]="{ <mat-chip [ngClass]="{
'chip-pending': trace.status === 'pending', 'chip-pending': trace.status === 'pending',
'chip-sent': trace.status === 'sent'
}"> }">
{{ {{
trace.status === 'pending' ? 'Pendiente' : trace.status === 'pending' ? 'Pendiente' :
trace.status === 'sent' ? 'Enviado' :
trace.status trace.status
}} }}
</mat-chip> </mat-chip>

View File

@ -335,6 +335,12 @@ table {
font-weight: 500; font-weight: 500;
} }
.chip-sent {
background-color: #b19cd9 !important;
color: white !important;
font-weight: 500;
}
.status-progress-flex { .status-progress-flex {
display: flex; display: flex;
align-items: center; align-items: center;
@ -359,6 +365,7 @@ table {
.status-indicator.pending { background-color: #17a2b8; } .status-indicator.pending { background-color: #17a2b8; }
.status-indicator.in-progress { background-color: #ffc107; } .status-indicator.in-progress { background-color: #ffc107; }
.status-indicator.cancelled { background-color: #6c757d; } .status-indicator.cancelled { background-color: #6c757d; }
.status-indicator.sent { background-color: #b19cd9; }
/* Opciones de cliente */ /* Opciones de cliente */
.client-option { .client-option {

View File

@ -96,7 +96,8 @@
'chip-success': trace.status === 'success', 'chip-success': trace.status === 'success',
'chip-pending': trace.status === 'pending', 'chip-pending': trace.status === 'pending',
'chip-in-progress': trace.status === 'in-progress', 'chip-in-progress': trace.status === 'in-progress',
'chip-cancelled': trace.status === 'cancelled' 'chip-cancelled': trace.status === 'cancelled',
'chip-sent': trace.status === 'sent'
}"> }">
{{ {{
trace.status === 'failed' ? 'Error' : trace.status === 'failed' ? 'Error' :
@ -104,6 +105,7 @@
trace.status === 'success' ? 'Completado' : trace.status === 'success' ? 'Completado' :
trace.status === 'pending' ? 'Pendiente' : trace.status === 'pending' ? 'Pendiente' :
trace.status === 'cancelled' ? 'Cancelado' : trace.status === 'cancelled' ? 'Cancelado' :
trace.status === 'sent' ? 'Enviado' :
trace.status trace.status
}} }}
</mat-chip> </mat-chip>

View File

@ -238,6 +238,17 @@
color: #212529; color: #212529;
} }
.stat-sent {
border-left-color: #b19cd9;
background: #b19cd9;
color: white;
}
.stat-sent .stat-number,
.stat-sent .stat-label {
color: white;
}
.stat-number { .stat-number {
font-size: 2rem; font-size: 2rem;
font-weight: bold; font-weight: bold;
@ -523,6 +534,12 @@ table {
font-weight: 500; font-weight: 500;
} }
.chip-sent {
background-color: #b19cd9 !important;
color: white !important;
font-weight: 500;
}
.status-progress-flex { .status-progress-flex {
display: flex; display: flex;
align-items: center; align-items: center;
@ -546,6 +563,7 @@ table {
.status-indicator.pending { background-color: #17a2b8; } .status-indicator.pending { background-color: #17a2b8; }
.status-indicator.in-progress { background-color: #ffc107; } .status-indicator.in-progress { background-color: #ffc107; }
.status-indicator.cancelled { background-color: #6c757d; } .status-indicator.cancelled { background-color: #6c757d; }
.status-indicator.sent { background-color: #b19cd9; }
.client-option { .client-option {
display: flex; display: flex;

View File

@ -57,6 +57,13 @@
<div class="stat-number">{{ getStatusCount('in-progress') }}</div> <div class="stat-number">{{ getStatusCount('in-progress') }}</div>
<div class="stat-label">{{ 'inProgress' | translate }}</div> <div class="stat-label">{{ 'inProgress' | translate }}</div>
</div> </div>
<div class="stat-card stat-sent clickable"
[class.active-filter]="isFilterActive('sent')"
(click)="filterBySent()"
matTooltip="Ver trazas enviadas">
<div class="stat-number">{{ getStatusCount('sent') }}</div>
<div class="stat-label">{{ 'sent' | translate }}</div>
</div>
</div> </div>
<div class="filters-section" joyrideStep="filtersStep" text="{{ 'filtersStepText' | translate }}"> <div class="filters-section" joyrideStep="filtersStep" text="{{ 'filtersStepText' | translate }}">
@ -146,6 +153,12 @@
{{ 'cancelled' | translate }} {{ 'cancelled' | translate }}
</div> </div>
</mat-option> </mat-option>
<mat-option [value]="'sent'">
<div class="status-option">
<div class="status-indicator sent"></div>
{{ 'sent' | translate }}
</div>
</mat-option>
</mat-select> </mat-select>
<button *ngIf="commandStatusInput.value" mat-icon-button matSuffix aria-label="Clear input search" <button *ngIf="commandStatusInput.value" mat-icon-button matSuffix aria-label="Clear input search"
(click)="clearStatusFilter($event, commandStatusInput)"> (click)="clearStatusFilter($event, commandStatusInput)">
@ -232,7 +245,8 @@
'chip-success': trace.status === 'success', 'chip-success': trace.status === 'success',
'chip-pending': trace.status === 'pending', 'chip-pending': trace.status === 'pending',
'chip-in-progress': trace.status === 'in-progress', 'chip-in-progress': trace.status === 'in-progress',
'chip-cancelled': trace.status === 'cancelled' 'chip-cancelled': trace.status === 'cancelled',
'chip-sent': trace.status === 'sent'
}"> }">
{{ {{
trace.status === 'failed' ? ('failed' | translate) : trace.status === 'failed' ? ('failed' | translate) :
@ -240,6 +254,7 @@
trace.status === 'success' ? ('successful' | translate) : trace.status === 'success' ? ('successful' | translate) :
trace.status === 'pending' ? ('pending' | translate) : trace.status === 'pending' ? ('pending' | translate) :
trace.status === 'cancelled' ? ('cancelled' | translate) : trace.status === 'cancelled' ? ('cancelled' | translate) :
trace.status === 'sent' ? ('sent' | translate) :
trace.status trace.status
}} }}
</mat-chip> </mat-chip>

View File

@ -51,6 +51,7 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
pending: number; pending: number;
inProgress: number; inProgress: number;
cancelled: number; cancelled: number;
sent: number;
today: number; today: number;
} = { } = {
total: 0, total: 0,
@ -59,6 +60,7 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
pending: 0, pending: 0,
inProgress: 0, inProgress: 0,
cancelled: 0, cancelled: 0,
sent: 0,
today: 0 today: 0
}; };
@ -204,6 +206,8 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
return this.totalStats.inProgress; return this.totalStats.inProgress;
case 'cancelled': case 'cancelled':
return this.totalStats.cancelled; return this.totalStats.cancelled;
case 'sent':
return this.totalStats.sent;
case 'today': case 'today':
return this.totalStats.today; return this.totalStats.today;
default: default:
@ -470,7 +474,7 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
} }
private calculateLocalStats(): void { private calculateLocalStats(): void {
const statuses = ['success', 'failed', 'pending', 'in-progress', 'cancelled']; const statuses = ['success', 'failed', 'pending', 'in-progress', 'cancelled', 'sent'];
const requests = statuses.map(status => const requests = statuses.map(status =>
this.http.get<any>(`${this.baseUrl}/traces?status=${status}&page=1&itemsPerPage=1`) this.http.get<any>(`${this.baseUrl}/traces?status=${status}&page=1&itemsPerPage=1`)
); );
@ -485,8 +489,8 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
forkJoin([totalRequest, ...requests, todayRequest]).subscribe( forkJoin([totalRequest, ...requests, todayRequest]).subscribe(
(responses) => { (responses) => {
const totalData = responses[0]; const totalData = responses[0];
const statusData = responses.slice(1, 6); const statusData = responses.slice(1, 7);
const todayData = responses[6]; const todayData = responses[7];
this.totalStats = { this.totalStats = {
total: totalData['hydra:totalItems'], total: totalData['hydra:totalItems'],
@ -495,6 +499,7 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
pending: statusData[2]['hydra:totalItems'], pending: statusData[2]['hydra:totalItems'],
inProgress: statusData[3]['hydra:totalItems'], inProgress: statusData[3]['hydra:totalItems'],
cancelled: statusData[4]['hydra:totalItems'], cancelled: statusData[4]['hydra:totalItems'],
sent: statusData[5]['hydra:totalItems'],
today: todayData['hydra:totalItems'] today: todayData['hydra:totalItems']
}; };
}, },
@ -508,6 +513,7 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
pending: this.traces.filter(trace => trace.status === 'pending').length, pending: this.traces.filter(trace => trace.status === 'pending').length,
inProgress: this.traces.filter(trace => trace.status === 'in-progress').length, inProgress: this.traces.filter(trace => trace.status === 'in-progress').length,
cancelled: this.traces.filter(trace => trace.status === 'cancelled').length, cancelled: this.traces.filter(trace => trace.status === 'cancelled').length,
sent: this.traces.filter(trace => trace.status === 'sent').length,
today: this.traces.filter(trace => trace.executedAt && todayString && trace.executedAt.startsWith(todayString)).length today: this.traces.filter(trace => trace.executedAt && todayString && trace.executedAt.startsWith(todayString)).length
}; };
} }
@ -652,6 +658,13 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
this.loadTraces(); this.loadTraces();
} }
filterBySent(): void {
this.resetAllFilters();
this.filters['status'] = 'sent';
this.activeFilter = 'sent';
this.loadTraces();
}
isFilterActive(filterType: string): boolean { isFilterActive(filterType: string): boolean {
return this.activeFilter === filterType; return this.activeFilter === filterType;
} }
@ -668,6 +681,8 @@ export class TaskLogsComponent implements OnInit, OnDestroy {
return 'Trazas fallidas'; return 'Trazas fallidas';
case 'in-progress': case 'in-progress':
return 'Trazas en progreso'; return 'Trazas en progreso';
case 'sent':
return 'Trazas enviadas';
default: default:
return ''; return '';
} }

View File

@ -573,6 +573,7 @@
"busyEquipments": "Busy Equipment", "busyEquipments": "Busy Equipment",
"pending": "Pending", "pending": "Pending",
"cancelled": "Cancelled", "cancelled": "Cancelled",
"sent": "Sent",
"cancelImageTransmission": "Cancel image transmission", "cancelImageTransmission": "Cancel image transmission",
"success": "Success", "success": "Success",
"limpiarAcciones": "Clear actions", "limpiarAcciones": "Clear actions",

View File

@ -578,6 +578,7 @@
"organizationalStructure": "Estructura Organizacional", "organizationalStructure": "Estructura Organizacional",
"pending": "Pendiente", "pending": "Pendiente",
"cancelled": "Cancelado", "cancelled": "Cancelado",
"sent": "Enviado",
"cancelImageTransmission": "Cancelar transmisión de imagen", "cancelImageTransmission": "Cancelar transmisión de imagen",
"success": "Exitoso", "success": "Exitoso",
"limpiarAcciones": "Limpiar acciones", "limpiarAcciones": "Limpiar acciones",