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 c8947ed55d..da3e366d80 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 @@ -40,8 +40,8 @@ import { EventContentDialogData } from '@home/components/event/event-content-dialog.component'; import { isEqual, sortObjectKeys } from '@core/utils'; -import { historyInterval, MINUTE } from '@shared/models/time/time.models'; -import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; +import { DAY, historyInterval, MINUTE } from '@shared/models/time/time.models'; +import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { ChangeDetectorRef, EventEmitter, Injector, StaticProvider, ViewContainerRef } from '@angular/core'; import { ComponentPortal } from '@angular/cdk/portal'; import { @@ -51,6 +51,9 @@ import { FilterEntityColumn } from '@home/components/event/event-filter-panel.component'; import { DEFAULT_OVERLAY_POSITIONS } from '@shared/models/overlay.models'; +import { getCurrentAuthState } from '@core/auth/auth.selectors'; +import { Store } from '@ngrx/store'; +import { AppState } from '@core/core.state'; export class EventTableConfig extends EntityTableConfig { @@ -59,6 +62,7 @@ export class EventTableConfig extends EntityTableConfig { private filterParams: FilterEventBody = {}; private filterColumns: FilterEntityColumn[] = []; + private readonly maxRuleNodeDebugDurationMinutes = getCurrentAuthState(this.store).maxRuleNodeDebugDurationMinutes; set eventType(eventType: EventType | DebugEventType) { if (this.eventTypeValue !== eventType) { @@ -88,13 +92,14 @@ export class EventTableConfig extends EntityTableConfig { private overlay: Overlay, private viewContainerRef: ViewContainerRef, private cd: ChangeDetectorRef, + protected store: Store, public testButtonLabel?: string, private debugEventSelected?: EventEmitter) { super(); this.loadDataOnInit = false; this.tableTitle = ''; this.useTimePageLink = true; - this.defaultTimewindowInterval = historyInterval(MINUTE * 15); + this.defaultTimewindowInterval = this.maxRuleNodeDebugDurationMinutes ? historyInterval(this.maxRuleNodeDebugDurationMinutes * MINUTE) : historyInterval(DAY); this.detailsPanelEnabled = false; this.selectionEnabled = false; this.searchEnabled = false; diff --git a/ui-ngx/src/app/modules/home/components/event/event-table.component.ts b/ui-ngx/src/app/modules/home/components/event/event-table.component.ts index fbcce00581..427858e3da 100644 --- a/ui-ngx/src/app/modules/home/components/event/event-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/event/event-table.component.ts @@ -36,6 +36,8 @@ import { DebugEventType, EventBody, EventType } from '@shared/models/event.model import { Overlay } from '@angular/cdk/overlay'; import { Subscription } from 'rxjs'; import { isNotEmptyStr } from '@core/utils'; +import { Store } from '@ngrx/store'; +import { AppState } from '@core/core.state'; @Component({ selector: 'tb-event-table', @@ -123,6 +125,7 @@ export class EventTableComponent implements OnInit, AfterViewInit, OnDestroy { private dialog: MatDialog, private overlay: Overlay, private viewContainerRef: ViewContainerRef, + protected store: Store, private cd: ChangeDetectorRef) { } @@ -142,6 +145,7 @@ export class EventTableComponent implements OnInit, AfterViewInit, OnDestroy { this.overlay, this.viewContainerRef, this.cd, + this.store, this.functionTestButtonLabel, this.debugEventSelected );