|
|
|
@ -80,6 +80,7 @@ import { |
|
|
|
import { distinct, filter, map, switchMap, takeUntil } from 'rxjs/operators'; |
|
|
|
import { AlarmDataListener } from '@core/api/alarm-data.service'; |
|
|
|
import { RpcStatus } from '@shared/models/rpc.models'; |
|
|
|
import { EventEmitter } from '@angular/core'; |
|
|
|
|
|
|
|
const moment = moment_; |
|
|
|
|
|
|
|
@ -214,6 +215,8 @@ export class WidgetSubscription implements IWidgetSubscription { |
|
|
|
distinct() |
|
|
|
); |
|
|
|
|
|
|
|
paginatedDataSubscriptionUpdated = new EventEmitter<void>(); |
|
|
|
|
|
|
|
constructor(subscriptionContext: WidgetSubscriptionContext, public options: WidgetSubscriptionOptions) { |
|
|
|
const subscriptionSubject = new ReplaySubject<IWidgetSubscription>(); |
|
|
|
this.init$ = subscriptionSubject.asObservable(); |
|
|
|
@ -939,6 +942,13 @@ export class WidgetSubscription implements IWidgetSubscription { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
stopSubscription(datasourceIndex: number) { |
|
|
|
const entityDataListener = this.entityDataListeners[datasourceIndex]; |
|
|
|
if (entityDataListener) { |
|
|
|
this.ctx.entityDataService.stopSubscription(entityDataListener); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
subscribeForPaginatedData(datasourceIndex: number, |
|
|
|
pageLink: EntityDataPageLink, |
|
|
|
keyFilters: KeyFilter[]): Observable<any> { |
|
|
|
@ -1193,6 +1203,10 @@ export class WidgetSubscription implements IWidgetSubscription { |
|
|
|
} |
|
|
|
|
|
|
|
private updatePaginatedDataSubscriptions() { |
|
|
|
for (let datasourceIndex = 0; datasourceIndex < this.entityDataListeners.length; datasourceIndex++) { |
|
|
|
this.stopSubscription(datasourceIndex); |
|
|
|
} |
|
|
|
this.paginatedDataSubscriptionUpdated.emit(); |
|
|
|
for (let datasourceIndex = 0; datasourceIndex < this.entityDataListeners.length; datasourceIndex++) { |
|
|
|
const entityDataListener = this.entityDataListeners[datasourceIndex]; |
|
|
|
if (entityDataListener) { |
|
|
|
|