UI: liquid level widget added additional checkup for datasources
This commit is contained in:
parent
f1195c16da
commit
8dce7dcad2
@ -160,6 +160,7 @@ export class LiquidLevelWidgetComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getData(): Observable<{ svg: string; volume: number; units: string }> {
|
private getData(): Observable<{ svg: string; volume: number; units: string }> {
|
||||||
|
if (this.ctx.datasources?.length) {
|
||||||
const entityId: EntityId = {
|
const entityId: EntityId = {
|
||||||
entityType: this.ctx.datasources[0].entityType,
|
entityType: this.ctx.datasources[0].entityType,
|
||||||
id: this.ctx.datasources[0].entityId
|
id: this.ctx.datasources[0].entityId
|
||||||
@ -182,6 +183,9 @@ export class LiquidLevelWidgetComponent implements OnInit {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return of(null);
|
||||||
|
}
|
||||||
|
|
||||||
public onInit() {
|
public onInit() {
|
||||||
const borderRadius = this.ctx.$widgetElement.css('borderRadius');
|
const borderRadius = this.ctx.$widgetElement.css('borderRadius');
|
||||||
this.overlayStyle = {...this.overlayStyle, ...{borderRadius}};
|
this.overlayStyle = {...this.overlayStyle, ...{borderRadius}};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user