List volumes of the app in filemanager
This commit is contained in:
@@ -75,6 +75,7 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
||||
$scope.sortAsc = true;
|
||||
$scope.sortProperty = 'fileName';
|
||||
$scope.view = 'fileTree';
|
||||
$scope.volumes = [];
|
||||
|
||||
$scope.owners = [
|
||||
{ name: 'cloudron', value: 1000 },
|
||||
@@ -703,6 +704,22 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
||||
}
|
||||
};
|
||||
|
||||
function fetchVolumesInfo(mounts) {
|
||||
$scope.volumes = [];
|
||||
|
||||
async.each(mounts, function (mount, callback) {
|
||||
Client.getVolume(mount.volumeId, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
$scope.volumes.push(result);
|
||||
|
||||
callback();
|
||||
});
|
||||
}, function (error) {
|
||||
if (error) console.error('Failed to fetch volumes info.', error);
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
|
||||
Client.getStatus(function (error, status) {
|
||||
@@ -738,6 +755,9 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
||||
return;
|
||||
}
|
||||
|
||||
// fine to do async
|
||||
fetchVolumesInfo(result.mounts || []);
|
||||
|
||||
$scope.title = $scope.type === 'app' ? (result.label || result.fqdn) : result.name;
|
||||
window.document.title = $scope.title + ' - ' + $translate.instant('filemanager.title');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user