Commit b3e90244c2772f01c251b44551599d55e20bff82

Authored by Igor Kulikov
1 parent 15d7970b

Fixed time pagelink for table

@@ -51,7 +51,7 @@ import { EntityTypeTranslation } from '@shared/models/entity-type.models'; @@ -51,7 +51,7 @@ import { EntityTypeTranslation } from '@shared/models/entity-type.models';
51 import { DialogService } from '@core/services/dialog.service'; 51 import { DialogService } from '@core/services/dialog.service';
52 import { AddEntityDialogComponent } from './add-entity-dialog.component'; 52 import { AddEntityDialogComponent } from './add-entity-dialog.component';
53 import { AddEntityDialogData, EntityAction } from '@home/models/entity/entity-component.models'; 53 import { AddEntityDialogData, EntityAction } from '@home/models/entity/entity-component.models';
54 -import { historyInterval, Timewindow } from '@shared/models/time/time.models'; 54 +import { historyInterval, HistoryWindowType, Timewindow } from '@shared/models/time/time.models';
55 import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; 55 import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
56 import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; 56 import { TbAnchorComponent } from '@shared/components/tb-anchor.component';
57 import { isDefined, isUndefined } from '@core/utils'; 57 import { isDefined, isUndefined } from '@core/utils';
@@ -218,7 +218,7 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn @@ -218,7 +218,7 @@ export class EntitiesTableComponent extends PageComponent implements AfterViewIn
218 this.pageLink.sortOrder.direction = Direction[this.sort.direction.toUpperCase()]; 218 this.pageLink.sortOrder.direction = Direction[this.sort.direction.toUpperCase()];
219 if (this.entitiesTableConfig.useTimePageLink) { 219 if (this.entitiesTableConfig.useTimePageLink) {
220 const timePageLink = this.pageLink as TimePageLink; 220 const timePageLink = this.pageLink as TimePageLink;
221 - if (this.timewindow.history.timewindowMs) { 221 + if (this.timewindow.history.historyType === HistoryWindowType.LAST_INTERVAL) {
222 const currentTime = Date.now(); 222 const currentTime = Date.now();
223 timePageLink.startTime = currentTime - this.timewindow.history.timewindowMs; 223 timePageLink.startTime = currentTime - this.timewindow.history.timewindowMs;
224 timePageLink.endTime = currentTime; 224 timePageLink.endTime = currentTime;