Browse Source

Merge pull request #14321 from thingsboard/rc

rc
pull/14326/head
Viacheslav Klimov 9 months ago
committed by GitHub
parent
commit
dcd9b9d6a6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      ui-ngx/src/app/core/http/queue.service.ts
  2. 13
      ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.ts
  3. 13
      ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.ts
  4. 13
      ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.ts

2
ui-ngx/src/app/core/http/queue.service.ts

@ -75,7 +75,7 @@ export class QueueService {
} }
public getQueueStatisticsByIds(queueStatIds: Array<string>, config?: RequestConfig): Observable<Array<QueueStatisticsInfo>> { public getQueueStatisticsByIds(queueStatIds: Array<string>, config?: RequestConfig): Observable<Array<QueueStatisticsInfo>> {
return this.http.get<Array<QueueStatisticsInfo>>(`/api/queueStats?QueueStatsIds=${queueStatIds.join(',')}`, return this.http.get<Array<QueueStatisticsInfo>>(`/api/queueStats?queueStatsIds=${queueStatIds.join(',')}`,
defaultHttpOptionsFromConfig(config)).pipe( defaultHttpOptionsFromConfig(config)).pipe(
map(queueStats => queueStats.map(queueStat => this.parseQueueStatName(queueStat)) map(queueStats => queueStats.map(queueStat => this.parseQueueStatName(queueStat))
) )

13
ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.ts

@ -332,11 +332,16 @@ export class LedIndicatorComponent extends PageComponent implements OnInit, OnDe
if (keyData && keyData.data && keyData.data[0]) { if (keyData && keyData.data && keyData.data[0]) {
const attrValue = keyData.data[0][1]; const attrValue = keyData.data[0][1];
if (isDefined(attrValue)) { if (isDefined(attrValue)) {
let parsed = null; let valueToParse = attrValue;
try { try {
parsed = this.parseValueFunction(JSON.parse(attrValue)); valueToParse = JSON.parse(attrValue);
} catch (e){/**/} } catch (e) {/**/}
value = !!parsed;
try {
value = !!this.parseValueFunction(valueToParse);
} catch (e) {
value = false;
}
} }
} }
} }

13
ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.ts

@ -330,11 +330,16 @@ export class RoundSwitchComponent extends PageComponent implements OnInit, OnDes
if (keyData && keyData.data && keyData.data[0]) { if (keyData && keyData.data && keyData.data[0]) {
const attrValue = keyData.data[0][1]; const attrValue = keyData.data[0][1];
if (isDefined(attrValue)) { if (isDefined(attrValue)) {
let parsed = null; let valueToParse = attrValue;
try { try {
parsed = this.parseValueFunction(JSON.parse(attrValue)); valueToParse = JSON.parse(attrValue);
} catch (e){/**/} } catch (e) {/**/}
value = !!parsed;
try {
value = !!this.parseValueFunction(valueToParse);
} catch (e) {
value = false;
}
} }
} }
} }

13
ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.ts

@ -373,11 +373,16 @@ export class SwitchComponent extends PageComponent implements AfterViewInit, OnD
if (keyData && keyData.data && keyData.data[0]) { if (keyData && keyData.data && keyData.data[0]) {
const attrValue = keyData.data[0][1]; const attrValue = keyData.data[0][1];
if (isDefined(attrValue)) { if (isDefined(attrValue)) {
let parsed = null; let valueToParse = attrValue;
try { try {
parsed = this.parseValueFunction(JSON.parse(attrValue)); valueToParse = JSON.parse(attrValue);
} catch (e){/**/} } catch (e) {/**/}
value = !!parsed;
try {
value = !!this.parseValueFunction(valueToParse);
} catch (e) {
value = false;
}
} }
} }
} }

Loading…
Cancel
Save