Browse Source
Merge pull request #9068 from ArtemDzhereleiko/AD/bug-fix/widget/infinite-loading
Fixed infinite loading for latest widgets with aggregation on change timewindow
pull/9136/head
Igor Kulikov
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
6 additions and
2 deletions
-
ui-ngx/src/app/core/api/entity-data-subscription.ts
-
ui-ngx/src/app/core/api/widget-subscription.ts
-
ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts
|
|
|
@ -42,6 +42,7 @@ import { |
|
|
|
EntityCountCmd, |
|
|
|
EntityDataCmd, |
|
|
|
IndexedSubscriptionData, |
|
|
|
NOT_SUPPORTED, |
|
|
|
SubscriptionData, |
|
|
|
TelemetrySubscriber |
|
|
|
} from '@shared/models/telemetry/telemetry.models'; |
|
|
|
@ -786,7 +787,7 @@ export class EntityDataSubscription { |
|
|
|
private reportNotSupported(keys: AggKey[], isUpdate: boolean) { |
|
|
|
const indexedData: IndexedSubscriptionData = []; |
|
|
|
for (const key of keys) { |
|
|
|
indexedData[key.id] = [[0, 'Not supported!']]; |
|
|
|
indexedData[key.id] = [[0, NOT_SUPPORTED]]; |
|
|
|
} |
|
|
|
for (let dataIndex = 0; dataIndex < this.pageData.data.length; dataIndex++) { |
|
|
|
this.onIndexedData(indexedData, dataIndex, true, |
|
|
|
|
|
|
|
@ -81,6 +81,7 @@ 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'; |
|
|
|
import { NOT_SUPPORTED } from '@shared/models/telemetry/telemetry.models'; |
|
|
|
|
|
|
|
const moment = moment_; |
|
|
|
|
|
|
|
@ -1541,7 +1542,7 @@ export class WidgetSubscription implements IWidgetSubscription { |
|
|
|
} else if (prevData && prevData[0] && prevData[0].length > 1 && data.data.length > 0) { |
|
|
|
const prevTs = prevData[0][0]; |
|
|
|
const prevValue = prevData[0][1]; |
|
|
|
if (prevTs === data.data[0][0] && prevValue === data.data[0][1]) { |
|
|
|
if (prevTs === data.data[0][0] && prevValue === data.data[0][1] && data.data[0][1] !== NOT_SUPPORTED) { |
|
|
|
update = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -37,6 +37,8 @@ import { isUndefined } from '@core/utils'; |
|
|
|
import { CmdWrapper, WsSubscriber } from '@shared/models/websocket/websocket.models'; |
|
|
|
import { TelemetryWebsocketService } from '@core/ws/telemetry-websocket.service'; |
|
|
|
|
|
|
|
export const NOT_SUPPORTED = 'Not supported!'; |
|
|
|
|
|
|
|
export enum DataKeyType { |
|
|
|
timeseries = 'timeseries', |
|
|
|
attribute = 'attribute', |
|
|
|
|