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;
|
||||
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(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 {
|
||||
this.valueText = 'N/A';
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ export class ValueCardWidgetComponent implements OnInit, AfterViewInit, OnDestro
|
||||
if (tsValue) {
|
||||
ts = tsValue[0];
|
||||
value = tsValue[1];
|
||||
this.valueText = formatValue(value, this.decimals, this.units, true);
|
||||
this.valueText = formatValue(value, this.decimals, this.units, false);
|
||||
} else {
|
||||
this.valueText = 'N/A';
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ export class ValueChartCardWidgetComponent implements OnInit, AfterViewInit, OnD
|
||||
let value;
|
||||
if (tsValue) {
|
||||
value = tsValue[1];
|
||||
this.valueText = formatValue(value, this.decimals, this.units, true);
|
||||
this.valueText = formatValue(value, this.decimals, this.units, false);
|
||||
} else {
|
||||
this.valueText = 'N/A';
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ export class BatteryLevelWidgetComponent implements OnInit, OnDestroy, AfterView
|
||||
this.value = 0;
|
||||
if (tsValue && isDefinedAndNotNull(tsValue[1]) && isNumeric(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 {
|
||||
this.valueText = 'N/A';
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ export class SignalStrengthWidgetComponent implements OnInit, OnDestroy, AfterVi
|
||||
if (!this.noData) {
|
||||
this.rssi = Number(value);
|
||||
if (this.showTooltipValue) {
|
||||
this.tooltipValueText = formatValue(value, this.decimals, this.units, true);
|
||||
this.tooltipValueText = formatValue(value, this.decimals, this.units, false);
|
||||
}
|
||||
} else {
|
||||
this.rssi = -100;
|
||||
|
||||
@ -174,7 +174,7 @@ export class WindSpeedDirectionWidgetComponent implements OnInit, OnDestroy, Aft
|
||||
this.windDirection = windDirectionTsValue[1];
|
||||
if (!this.centerValueDataKey) {
|
||||
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);
|
||||
if (centerValueTsValue && isDefinedAndNotNull(centerValueTsValue[1]) && isNumeric(centerValueTsValue[1])) {
|
||||
value = centerValueTsValue[1];
|
||||
this.centerValueText = formatValue(value, this.decimals, '', true);
|
||||
this.centerValueText = formatValue(value, this.decimals, '', false);
|
||||
}
|
||||
}
|
||||
this.centerValueColor.update(value);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user