diff --git a/ui-ngx/src/app/core/http/event.service.ts b/ui-ngx/src/app/core/http/event.service.ts
index e54f760b00..5a3ec9e51f 100644
--- a/ui-ngx/src/app/core/http/event.service.ts
+++ b/ui-ngx/src/app/core/http/event.service.ts
@@ -46,10 +46,9 @@ export class EventService {
}
public clearEvents(entityId: EntityId, eventType: EventType | DebugEventType, filters: FilterEventBody, tenantId: string,
- startTime?: number, endTime?: number, config?: RequestConfig) {
+ pageLink: TimePageLink, config?: RequestConfig) {
return this.http.post(`/api/events/${entityId.entityType}/${entityId.id}/${eventType}/clear&tenantId=${tenantId}` +
- (startTime ? `&startTime=${startTime}` : ``) + (endTime ? `&endTime=${endTime}` : ``), {...filters, eventType},
+ `${pageLink.toQuery()}`, {...filters, eventType},
defaultHttpOptionsFromConfig(config));
}
-
}
diff --git a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html
index 3242bb5a53..b103c29df5 100644
--- a/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html
+++ b/ui-ngx/src/app/modules/home/components/entity/entities-table.component.html
@@ -84,7 +84,7 @@
[fxShow]="actionDescriptor.isEnabled()" *ngFor="let actionDescriptor of headerActionDescriptors"
matTooltip="{{ actionDescriptor.name }}"
matTooltipPosition="above"
- (click)="actionDescriptor.onAction($event, entitiesTableConfig)">
+ (click)="actionDescriptor.onAction($event, entitiesTableConfig, pageLink)">
{{actionDescriptor.icon}}
diff --git a/ui-ngx/src/app/modules/home/components/event/event-table-config.ts b/ui-ngx/src/app/modules/home/components/event/event-table-config.ts
index 07d8bfb82f..8a5201dc3f 100644
--- a/ui-ngx/src/app/modules/home/components/event/event-table-config.ts
+++ b/ui-ngx/src/app/modules/home/components/event/event-table-config.ts
@@ -140,8 +140,8 @@ export class EventTableConfig extends EntityTableConfig {
name: this.translate.instant('event.clean-events'),
icon: 'delete',
isEnabled: () => true,
- onAction: ($event, entity) => {
- this.eventService.clearEvents(entity.entityId, entity.eventType, entity.filterParams, entity.tenantId, , ).subscribe();
+ onAction: ($event, entity, pageLink: TimePageLink) => {
+ this.eventService.clearEvents(entity.entityId, entity.eventType, entity.filterParams, entity.tenantId, pageLink).subscribe();
}
});
}
diff --git a/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts b/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts
index c86ae6fef8..7a352e8f17 100644
--- a/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts
+++ b/ui-ngx/src/app/modules/home/models/entity/entities-table-config.models.ts
@@ -75,7 +75,7 @@ export interface HeaderActionDescriptor {
icon: string;
isMdiIcon?: boolean;
isEnabled: () => boolean;
- onAction: ($event: MouseEvent, entity?) => void;
+ onAction: ($event: MouseEvent, entity?, pageLink?) => void;
}
export type EntityTableColumnType = 'content' | 'action';