UI: Improve widgets value formatting.
This commit is contained in:
parent
54ef5364ec
commit
a47ceaafed
@ -174,7 +174,7 @@ export class ProgressBarWidgetComponent implements OnInit, OnDestroy, AfterViewI
|
|||||||
this.value = 0;
|
this.value = 0;
|
||||||
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(tsValue[1])) {
|
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(tsValue[1])) {
|
||||||
this.value = tsValue[1];
|
this.value = tsValue[1];
|
||||||
this.valueText = formatValue(this.value, this.decimals, this.units, true);
|
this.valueText = formatValue(this.value, this.decimals, this.units, false);
|
||||||
} else {
|
} else {
|
||||||
this.valueText = 'N/A';
|
this.valueText = 'N/A';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,7 +182,7 @@ export class ValueCardWidgetComponent implements OnInit, AfterViewInit, OnDestro
|
|||||||
if (tsValue) {
|
if (tsValue) {
|
||||||
ts = tsValue[0];
|
ts = tsValue[0];
|
||||||
value = tsValue[1];
|
value = tsValue[1];
|
||||||
this.valueText = formatValue(value, this.decimals, this.units, true);
|
this.valueText = formatValue(value, this.decimals, this.units, false);
|
||||||
} else {
|
} else {
|
||||||
this.valueText = 'N/A';
|
this.valueText = 'N/A';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -194,7 +194,7 @@ export class ValueChartCardWidgetComponent implements OnInit, AfterViewInit, OnD
|
|||||||
let value;
|
let value;
|
||||||
if (tsValue) {
|
if (tsValue) {
|
||||||
value = tsValue[1];
|
value = tsValue[1];
|
||||||
this.valueText = formatValue(value, this.decimals, this.units, true);
|
this.valueText = formatValue(value, this.decimals, this.units, false);
|
||||||
} else {
|
} else {
|
||||||
this.valueText = 'N/A';
|
this.valueText = 'N/A';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -224,7 +224,7 @@ export class BatteryLevelWidgetComponent implements OnInit, OnDestroy, AfterView
|
|||||||
this.value = 0;
|
this.value = 0;
|
||||||
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(tsValue[1])) {
|
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(tsValue[1])) {
|
||||||
this.value = tsValue[1];
|
this.value = tsValue[1];
|
||||||
this.valueText = formatValue(this.value, this.decimals, this.units, true);
|
this.valueText = formatValue(this.value, this.decimals, this.units, false);
|
||||||
} else {
|
} else {
|
||||||
this.valueText = 'N/A';
|
this.valueText = 'N/A';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -232,7 +232,7 @@ export class SignalStrengthWidgetComponent implements OnInit, OnDestroy, AfterVi
|
|||||||
if (!this.noData) {
|
if (!this.noData) {
|
||||||
this.rssi = Number(value);
|
this.rssi = Number(value);
|
||||||
if (this.showTooltipValue) {
|
if (this.showTooltipValue) {
|
||||||
this.tooltipValueText = formatValue(value, this.decimals, this.units, true);
|
this.tooltipValueText = formatValue(value, this.decimals, this.units, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.rssi = -100;
|
this.rssi = -100;
|
||||||
|
|||||||
@ -174,7 +174,7 @@ export class WindSpeedDirectionWidgetComponent implements OnInit, OnDestroy, Aft
|
|||||||
this.windDirection = windDirectionTsValue[1];
|
this.windDirection = windDirectionTsValue[1];
|
||||||
if (!this.centerValueDataKey) {
|
if (!this.centerValueDataKey) {
|
||||||
value = this.windDirection;
|
value = this.windDirection;
|
||||||
this.centerValueText = formatValue(value, 0, '') + '°';
|
this.centerValueText = formatValue(value, 0, '', false) + '°';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ export class WindSpeedDirectionWidgetComponent implements OnInit, OnDestroy, Aft
|
|||||||
const centerValueTsValue = getSingleTsValueByDataKey(this.ctx.data, this.centerValueDataKey);
|
const centerValueTsValue = getSingleTsValueByDataKey(this.ctx.data, this.centerValueDataKey);
|
||||||
if (centerValueTsValue && isDefinedAndNotNull(centerValueTsValue[1]) && isNumeric(centerValueTsValue[1])) {
|
if (centerValueTsValue && isDefinedAndNotNull(centerValueTsValue[1]) && isNumeric(centerValueTsValue[1])) {
|
||||||
value = centerValueTsValue[1];
|
value = centerValueTsValue[1];
|
||||||
this.centerValueText = formatValue(value, this.decimals, '', true);
|
this.centerValueText = formatValue(value, this.decimals, '', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.centerValueColor.update(value);
|
this.centerValueColor.update(value);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user