Show app disk usage in storage tab
This commit is contained in:
@@ -52,6 +52,8 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
$scope.groups = [];
|
||||
$scope.users = [];
|
||||
$scope.backupConfig = null;
|
||||
$scope.diskUsage = 0;
|
||||
$scope.diskUsageDate = 0;
|
||||
|
||||
$scope.APP_TYPES = APP_TYPES;
|
||||
$scope.HOST_PORT_MIN = 1;
|
||||
@@ -1931,6 +1933,28 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
});
|
||||
}
|
||||
|
||||
function fetchDiskUsage(callback) {
|
||||
$scope.diskUsage = 0;
|
||||
|
||||
Client.diskUsage(function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
$scope.diskUsageDate = result.usage.ts;
|
||||
|
||||
for (var diskName in result.usage.disks) {
|
||||
var disk = result.usage.disks[diskName];
|
||||
var content = disk.contents.find(function (c) { return c.id === appId; });
|
||||
|
||||
if (content) {
|
||||
$scope.diskUsage = content.usage;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function getDomains(callback) {
|
||||
Client.getDomains(function (error, result) {
|
||||
if (error) return callback(error);
|
||||
@@ -2075,6 +2099,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
async.series([
|
||||
fetchUsers,
|
||||
fetchGroups,
|
||||
fetchDiskUsage,
|
||||
getDomains,
|
||||
getVolumes,
|
||||
getBackupConfig
|
||||
|
||||
Reference in New Issue
Block a user