add usage to wallets table
This commit is contained in:
parent
b096fd50a7
commit
2402a22f0a
5 changed files with 81 additions and 7 deletions
|
|
@ -1,5 +1,5 @@
|
|||
'use strict';
|
||||
angular.module('copayApp.controllers').controller('ProfileController', function($scope, $rootScope, $location, $modal, backupService, identityService) {
|
||||
angular.module('copayApp.controllers').controller('ProfileController', function($scope, $rootScope, $location, $modal, $filter, backupService, identityService) {
|
||||
$scope.username = $rootScope.iden.getName();
|
||||
$scope.isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
|
||||
|
||||
|
|
@ -25,11 +25,29 @@ angular.module('copayApp.controllers').controller('ProfileController', function(
|
|||
});
|
||||
};
|
||||
|
||||
$scope.setWallets = function() {
|
||||
if (!$rootScope.iden) return;
|
||||
$scope.wallets=$rootScope.iden.listWallets();
|
||||
$scope.init = function() {
|
||||
if ($rootScope.quotaPerItem) {
|
||||
$scope.perItem = $filter('noFractionNumber')($rootScope.quotaPerItem/1000,1);
|
||||
$scope.nrWallets =parseInt($rootScope.quotaItems) - 1;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.setWallets = function() {
|
||||
if (!$rootScope.iden) return;
|
||||
|
||||
var wallets = $rootScope.iden.listWallets();
|
||||
var max =$rootScope.quotaPerItem;
|
||||
|
||||
_.each(wallets, function(w) {
|
||||
var bits = w.sizes().total;
|
||||
w.kb = $filter('noFractionNumber')(bits/1000, 1);
|
||||
if (max) {
|
||||
w.usage = $filter('noFractionNumber')(bits/max * 100, 0);
|
||||
}
|
||||
});
|
||||
|
||||
$scope.wallets = wallets;
|
||||
};
|
||||
|
||||
$scope.downloadWalletBackup = function(w) {
|
||||
if (!w) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue