From 639f55edb3d21375f8658b63cde71f79e37d9b41 Mon Sep 17 00:00:00 2001 From: Lucas Lara Date: Wed, 14 May 2025 10:07:19 +0200 Subject: [PATCH] refactor: update command filter to use name instead of id and remove date range handling --- .../client-task-logs.component.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.ts b/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.ts index 2db9e1b..897622d 100644 --- a/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.ts +++ b/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.ts @@ -35,7 +35,6 @@ export class ClientTaskLogsComponent implements OnInit { mode: ProgressBarMode = 'buffer'; progress = 0; bufferValue = 0; - dateRange = new FormControl(); filteredCommands2 = Object.keys(COMMAND_TYPES).map(key => ({ name: key, @@ -135,7 +134,9 @@ export class ClientTaskLogsComponent implements OnInit { } onOptionCommandSelected(selectedCommand: any): void { - this.filters['command'] = selectedCommand.id; + this.filters['command'] = selectedCommand.name; + console.log('Comando seleccionado:', selectedCommand); + console.log('Valor que se usarĂ¡ para el filtro:', selectedCommand.name); this.loadTraces(); } @@ -191,22 +192,13 @@ export class ClientTaskLogsComponent implements OnInit { .set('itemsPerPage', this.itemsPerPage.toString()); if (this.filters['command']) { - params = params.set('command.id', this.filters['command']); + params = params.set('command.name', this.filters['command']); } if (this.filters['status']) { params = params.set('status', this.filters['status']); } - const range = this.dateRange?.value; - if (range?.start && range?.end) { - const fromDate = this.datePipe.transform(range.start, 'yyyy-MM-dd'); - const toDate = this.datePipe.transform(range.end, 'yyyy-MM-dd'); - - params = params.set('executedAt[after]', fromDate!); - params = params.set('executedAt[before]', toDate!); - } - const url = `${this.baseUrl}/traces`; this.http.get(url, { params }).subscribe( @@ -240,7 +232,6 @@ export class ClientTaskLogsComponent implements OnInit { this.loading = true; clientSearchCommandInput.value = null; clientSearchStatusInput.value = null; - this.dateRange.reset(); this.filters = {}; this.loadTraces(); }