diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-07-14 16:03:34 -0400 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-07-14 16:03:34 -0400 |
| commit | d8c2874b6806f5d196b01fc6b3d5ea0bc7efa952 (patch) | |
| tree | a1bc414aa42fdde0b105b3fc7ef2bc9e1bfe025c /www/js | |
| parent | 5d150b689a616e8cd51210152c36a53efc83e4e5 (diff) | |
fixed bug in reporting disk total - was totalling total :-)
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/StateCtrl.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/www/js/StateCtrl.js b/www/js/StateCtrl.js index f1d15ed1..08bdf06e 100644 --- a/www/js/StateCtrl.js +++ b/www/js/StateCtrl.js @@ -117,7 +117,16 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' .then( function (success) { var obj = success.data.usage; - var du = 0; + if (obj.Total.space != undefined) + { + $scope.zmDisk = parseFloat(obj.Total.space).toFixed(1).toString()+"G"; + } + else + { + $scope.zmDisk = "unknown"; + ZMDataModel.zmLog("Error retrieving disk space, API returned null for obj.Total.space"); + } + /* var du = 0; console.log("DISK:" + JSON.stringify(success)); for (var p in obj) { if (obj.hasOwnProperty(p)) { @@ -125,7 +134,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' } } - $scope.zmDisk = du.toFixed(1).toString() + "G"; + $scope.zmDisk = du.toFixed(1).toString() + "G";*/ }, function (error) { |
