Browse Source
Merge pull request #4896 from ChantsovaEkaterina/improvement/attribute-service-get-latest-timeseries
UI: add method to get latest telemetry to Attribute service
pull/4901/head
Igor Kulikov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
0 deletions
-
ui-ngx/src/app/core/http/attribute.service.ts
|
|
|
@ -135,4 +135,13 @@ export class AttributeService { |
|
|
|
|
|
|
|
return this.http.get<TimeseriesData>(url, defaultHttpOptionsFromConfig(config)); |
|
|
|
} |
|
|
|
|
|
|
|
public getEntityTimeseriesLatest(entityId: EntityId, keys?: Array<string>, |
|
|
|
useStrictDataTypes = false, config?: RequestConfig): Observable<TimeseriesData> { |
|
|
|
let url = `/api/plugins/telemetry/${entityId.entityType}/${entityId.id}/values/timeseries?useStrictDataTypes=${useStrictDataTypes}`; |
|
|
|
if (isDefinedAndNotNull(keys) && keys.length) { |
|
|
|
url += `&keys=${keys.join(',')}`; |
|
|
|
} |
|
|
|
return this.http.get<TimeseriesData>(url, defaultHttpOptionsFromConfig(config)); |
|
|
|
} |
|
|
|
} |
|
|
|
|