summaryrefslogtreecommitdiff
path: root/src/components/Mixins
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2020-06-18 22:02:57 +0300
committerDerick Montague <derick.montague@ibm.com>2020-06-26 00:41:56 +0300
commit202c599e71cb6691e12fa516b579b2b0007b94f1 (patch)
treee289e7797a19517f110eaec3f586f6ea376f01f3 /src/components/Mixins
parent4177014ab3d713e47af432119316b65f3c6ffb01 (diff)
downloadwebui-vue-202c599e71cb6691e12fa516b579b2b0007b94f1.tar.xz
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
Diffstat (limited to 'src/components/Mixins')
-rw-r--r--src/components/Mixins/TableDataFormatterMixin.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/components/Mixins/TableDataFormatterMixin.js b/src/components/Mixins/TableDataFormatterMixin.js
index 77db7de9..3e15926a 100644
--- a/src/components/Mixins/TableDataFormatterMixin.js
+++ b/src/components/Mixins/TableDataFormatterMixin.js
@@ -3,6 +3,8 @@ const TableDataFormatterMixin = {
tableFormatter(value) {
if (value === undefined || value === null || value === '') {
return '--';
+ } else if (typeof value === 'number') {
+ return parseFloat(value.toFixed(3));
} else {
return value;
}