Commit 71db8aa8c88e9e7b17965f5287f2003e524952af
1 parent
bfab30b6
Fixed edgeEvents status for not yet connected edges
Showing
1 changed file
with
10 additions
and
13 deletions
... | ... | @@ -22,11 +22,11 @@ import { |
22 | 22 | } from '@home/models/entity/entities-table-config.models'; |
23 | 23 | import { |
24 | 24 | DebugEventType, |
25 | + Event, | |
26 | + EventType, | |
25 | 27 | EdgeEventType, |
26 | 28 | EdgeEventStatusColor, |
27 | - edgeEventStatusColor, | |
28 | - Event, | |
29 | - EventType | |
29 | + edgeEventStatusColor | |
30 | 30 | } from '@shared/models/event.models'; |
31 | 31 | import {TimePageLink} from '@shared/models/page/page-link'; |
32 | 32 | import {TranslateService} from '@ngx-translate/core'; |
... | ... | @@ -66,7 +66,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> { |
66 | 66 | } |
67 | 67 | |
68 | 68 | eventTypes: Array<EventType | DebugEventType>; |
69 | - queueStartTs: any; | |
69 | + queueStartTs: number; | |
70 | 70 | |
71 | 71 | constructor(private eventService: EventService, |
72 | 72 | private dialogService: DialogService, |
... | ... | @@ -347,14 +347,10 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> { |
347 | 347 | } |
348 | 348 | |
349 | 349 | updateEdgeEventStatus(createdTime) { |
350 | - if (this.queueStartTs) { | |
351 | - var status: string; | |
352 | - if (createdTime < this.queueStartTs) { | |
353 | - status = this.translate.instant('edge.success'); | |
354 | - } else { | |
355 | - status = this.translate.instant('edge.failed'); | |
356 | - } | |
357 | - return status; | |
350 | + if (this.queueStartTs && createdTime < this.queueStartTs) { | |
351 | + return this.translate.instant('edge.success'); | |
352 | + } else { | |
353 | + return this.translate.instant('edge.failed'); | |
358 | 354 | } |
359 | 355 | } |
360 | 356 | |
... | ... | @@ -363,13 +359,14 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> { |
363 | 359 | } |
364 | 360 | |
365 | 361 | loadEdgeInfo() { |
366 | - this.attributeService.getEntityAttributes(this.entityId, AttributeScope.SERVER_SCOPE,["queueStartTs"]) | |
362 | + this.attributeService.getEntityAttributes(this.entityId, AttributeScope.SERVER_SCOPE, ['queueStartTs']) | |
367 | 363 | .subscribe( |
368 | 364 | attributes => this.onUpdate(attributes) |
369 | 365 | ); |
370 | 366 | } |
371 | 367 | |
372 | 368 | onUpdate(attributes) { |
369 | + this.queueStartTs = 0; | |
373 | 370 | let edge = attributes.reduce(function (map, attribute) { |
374 | 371 | map[attribute.key] = attribute; |
375 | 372 | return map; | ... | ... |