diff options
author | Iftekharul Islam <iffy.ryan@ibm.com> | 2017-08-22 13:44:38 -0500 |
---|---|---|
committer | Adriana Kobylak <anoo@us.ibm.com> | 2017-10-09 14:13:43 -0500 |
commit | 96bbf31065b3d7a27816c9344002803619d9e3fc (patch) | |
tree | 799b12ed7590c0fe0328ac37aceab45332759617 /app/common/services | |
parent | ba556c310594af3daa22bc96abee55af9ce23ab2 (diff) | |
download | phosphor-webui-96bbf31065b3d7a27816c9344002803619d9e3fc.tar.gz phosphor-webui-96bbf31065b3d7a27816c9344002803619d9e3fc.zip |
Updated master after merge conflicts
Change-Id: Ibea933c20071cc85201420ba1e31fedf9356f55b
Signed-off-by: Iftekharul Islam <iffy.ryan@ibm.com>
Diffstat (limited to 'app/common/services')
-rw-r--r-- | app/common/services/api-utils.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js index 408e42f..bec96b1 100644 --- a/app/common/services/api-utils.js +++ b/app/common/services/api-utils.js @@ -425,6 +425,18 @@ window.angular && (function (angular) { var tempKeyParts = []; var order = 0; + function getScaledValue(value, scale){ + scale = scale + ""; + var power = parseInt(scale.replace(/[\s\t\+\-]/g,''),10); + + if(scale.indexOf("+") > -1){ + value = value * Math.pow(10, power); + }else if(scale.indexOf("-") > -1){ + value = value / Math.pow(10, power); + } + return value; + } + function getSensorStatus(reading){ var severityFlags = {critical: false, warning: false, normal: false}, severityText = '', order = 0; @@ -483,6 +495,8 @@ window.angular && (function (angular) { return prev + " " + el; }); + content.data[key].Value = getScaledValue(content.data[key].Value, content.data[key].Scale); + sensorData.push(Object.assign({ path: key, selected: false, |