Update Sensors page to use table mixins
- Add number formatting to TableDataFormatter mixin
- Use TableDataFormatter mixin to show different status icons for sensor
status (OK, Warning, Critical)
- Use TableSortMixin to sort by status (OK, Warning, Critical)
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I99899bbc19db3529f0fdfe34be30b09d41456b42
diff --git a/src/components/Mixins/TableDataFormatterMixin.js b/src/components/Mixins/TableDataFormatterMixin.js
index 77db7de..3e15926 100644
--- a/src/components/Mixins/TableDataFormatterMixin.js
+++ b/src/components/Mixins/TableDataFormatterMixin.js
@@ -3,6 +3,8 @@
tableFormatter(value) {
if (value === undefined || value === null || value === '') {
return '--';
+ } else if (typeof value === 'number') {
+ return parseFloat(value.toFixed(3));
} else {
return value;
}