{
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.html
index eeed8fa486..38ac3f67c5 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.html
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.html
@@ -29,7 +29,7 @@
- {{ error }}
+
{{ title }}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.scss
index 990647f2df..af0bdf158b 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.scss
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.scss
@@ -26,13 +26,10 @@ $minmax-height: percentage(.04) !default;
$minmax-container-margin-pct: percentage(.18) !default;
$minmax-container-margin-bottom-pct: percentage(.12) !default;
-$background-color: #e6e7e8 !default;
-
:host {
.tb-knob {
width: 100%;
height: 100%;
- background: $background-color;
.knob {
position: relative;
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.ts
index a0aef62729..e98170501d 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/knob.component.ts
@@ -24,6 +24,7 @@ import { isDefined, isNumber } from '@core/utils';
import { CanvasDigitalGauge, CanvasDigitalGaugeOptions } from '@home/components/widget/lib/canvas-digital-gauge';
import GenericOptions = CanvasGauges.GenericOptions;
import * as tinycolor_ from 'tinycolor2';
+import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
const tinycolor = tinycolor_;
@@ -338,6 +339,9 @@ export class KnobComponent extends PageComponent implements OnInit, OnDestroy {
let textWidth = this.measureTextWidth(text, fontSize);
while (textWidth > maxWidth) {
fontSize--;
+ if (fontSize < 0) {
+ break;
+ }
textWidth = this.measureTextWidth(text, fontSize);
}
element.css({fontSize: fontSize+'px', lineHeight: fontSize+'px'});
@@ -345,7 +349,7 @@ export class KnobComponent extends PageComponent implements OnInit, OnDestroy {
private measureTextWidth(text: string, fontSize: number): number {
this.textMeasure.css({fontSize: fontSize+'px', lineHeight: fontSize+'px'});
- this.textMeasure.text(text);
+ this.textMeasure.html(text);
return this.textMeasure.width();
}
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.scss
index dcb1752256..bf484a847d 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.scss
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/led-indicator.component.scss
@@ -17,13 +17,10 @@
$error-height: 14px !default;
-$background-color: #e6e7e8 !default;
-
:host {
.tb-led-indicator {
width: 100%;
height: 100%;
- background: $background-color;
.title-container {
.led-title {
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.scss
index 3da3ed3d18..f083096b24 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.scss
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/round-switch.component.scss
@@ -17,13 +17,10 @@
$error-height: 14px !default;
-$background-color: #e6e7e8 !default;
-
:host {
.tb-round-switch {
width: 100%;
height: 100%;
- background: $background-color;
.title-container {
.switch-title {
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss
index d57cafc7dc..f878f45320 100644
--- a/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss
+++ b/ui-ngx/src/app/modules/home/components/widget/lib/rpc/switch.component.scss
@@ -19,8 +19,6 @@ $thumb-checked-img: url("./svg/thumb-checked.svg") !default;
$thumb-bar-img: url("./svg/thumb-bar.svg") !default;
$thumb-bar-checked-img: url("./svg/thumb-bar-checked.svg") !default;
-$background-color: #e6e7e8 !default;
-
$error-height: 14px !default;
:host {
@@ -28,7 +26,6 @@ $error-height: 14px !default;
.tb-switch {
width: 100%;
height: 100%;
- background: $background-color;
.error-container {
position: absolute;
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts
index 5ecf72ca2d..2a226e07b6 100644
--- a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts
+++ b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts
@@ -1007,8 +1007,8 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI
additionalParams = {};
}
const customActionFunction = new Function('$event', 'widgetContext', 'entityId',
- 'entityName', 'additionalParams', customFunction);
- customActionFunction($event, this.widgetContext, entityId, entityName, additionalParams);
+ 'entityName', 'additionalParams', 'entityLabel', customFunction);
+ customActionFunction($event, this.widgetContext, entityId, entityName, additionalParams, entityLabel);
} catch (e) {
//
}
@@ -1032,8 +1032,8 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI
additionalParams = {};
}
const customActionPrettyFunction = new Function('$event', 'widgetContext', 'entityId',
- 'entityName', 'htmlTemplate', 'additionalParams', customPrettyFunction);
- customActionPrettyFunction($event, this.widgetContext, entityId, entityName, htmlTemplate, additionalParams);
+ 'entityName', 'htmlTemplate', 'additionalParams', 'entityLabel', customPrettyFunction);
+ customActionPrettyFunction($event, this.widgetContext, entityId, entityName, htmlTemplate, additionalParams, entityLabel);
} catch (e) {
//
}
diff --git a/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts b/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts
index 102567ffef..3ccba35805 100644
--- a/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts
+++ b/ui-ngx/src/app/modules/home/models/dashboard-component.models.ts
@@ -20,10 +20,9 @@ import { WidgetLayout, WidgetLayouts } from '@app/shared/models/dashboard.models
import { IDashboardWidget, WidgetAction, WidgetContext, WidgetHeaderAction } from './widget-component.models';
import { Timewindow } from '@shared/models/time/time.models';
import { Observable, of, Subject } from 'rxjs';
-import { guid, isDefined, isUndefined } from '@app/core/utils';
+import { guid, isDefined, isEqual, isUndefined } from '@app/core/utils';
import { IterableDiffer, KeyValueDiffer, NgZone } from '@angular/core';
import { IAliasController, IStateController } from '@app/core/api/widget-api.models';
-import * as deepEqual from 'deep-equal';
export interface WidgetsData {
widgets: Array;
@@ -166,8 +165,8 @@ export class DashboardWidgets implements Iterable {
index = this.dashboardWidgets.findIndex((dashboardWidget) => dashboardWidget.widgetId === record.widgetId);
if (index > -1) {
const prevDashboardWidget = this.dashboardWidgets[index];
- if (!deepEqual(prevDashboardWidget.widget, record.widget) ||
- !deepEqual(prevDashboardWidget.widgetLayout, record.widgetLayout)) {
+ if (!isEqual(prevDashboardWidget.widget, record.widget) ||
+ !isEqual(prevDashboardWidget.widgetLayout, record.widgetLayout)) {
this.dashboardWidgets[index] = new DashboardWidget(this.dashboard, record.widget, record.widgetLayout);
this.dashboardWidgets[index].highlighted = prevDashboardWidget.highlighted;
this.dashboardWidgets[index].selected = prevDashboardWidget.selected;
diff --git a/ui-ngx/src/app/modules/home/pages/dashboard/states/manage-dashboard-states-dialog.component.html b/ui-ngx/src/app/modules/home/pages/dashboard/states/manage-dashboard-states-dialog.component.html
index 9f2d7ce31f..1c7abc2ec0 100644
--- a/ui-ngx/src/app/modules/home/pages/dashboard/states/manage-dashboard-states-dialog.component.html
+++ b/ui-ngx/src/app/modules/home/pages/dashboard/states/manage-dashboard-states-dialog.component.html
@@ -15,7 +15,7 @@
limitations under the License.
-->
-