fix instance group percentage

This commit is contained in:
John Mitchell 2017-09-27 15:56:36 -04:00
parent a6e6298575
commit 32920739ef
No known key found for this signature in database
GPG Key ID: FE6A9B5BD4EB5C94

View File

@ -23,10 +23,10 @@ export default ['templateUrl', 'ComponentsStrings',
scope.$watch('capacity', function() {
if (scope.totalCapacity !== 0) {
scope.CapacityStyle = {
'flex-grow': scope.capacity * 0.01
'flex-grow': scope.capacity / scope.totalCapacity * 0.01
};
scope.consumedCapacity = `${scope.capacity}%`;
scope.consumedCapacity = `${Math.round(scope.capacity / scope.totalCapacity * 10) / 10}%`;
} else {
scope.CapacityStyle = {
'flex-grow': 1