@@ -65,8 +65,8 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
||||
$scope.client = Client;
|
||||
$scope.cwd = null;
|
||||
$scope.cwdParts = [];
|
||||
$scope.id = search.appId || search.volumeId;
|
||||
$scope.type = search.appId ? 'app' : 'volume';
|
||||
$scope.id = search.id;
|
||||
$scope.type = search.type;
|
||||
$scope.rootDirLabel = '';
|
||||
$scope.title = '';
|
||||
$scope.entries = [];
|
||||
@@ -996,7 +996,14 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
||||
Client.refreshUserInfo(function (error) {
|
||||
if (error) return Client.initError(error, init);
|
||||
|
||||
var getter = $scope.type === 'app' ? Client.getApp.bind(Client, $scope.id) : Client.getVolume.bind(Client, $scope.id);
|
||||
var getter;
|
||||
if ($scope.type === 'app') {
|
||||
getter = Client.getApp.bind(Client, $scope.id);
|
||||
} else if ($scope.type === 'volume') {
|
||||
getter = Client.getVolume.bind(Client, $scope.id);
|
||||
} else if ($scope.type === 'mail') {
|
||||
getter = function (next) { next(null, null); };
|
||||
}
|
||||
|
||||
getter(function (error, result) {
|
||||
if (error) {
|
||||
@@ -1005,10 +1012,23 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
||||
}
|
||||
|
||||
// fine to do async
|
||||
fetchVolumesInfo(result.mounts || []);
|
||||
if ($scope.type === 'app') fetchVolumesInfo(result.mounts || []);
|
||||
|
||||
switch ($scope.type) {
|
||||
case 'app':
|
||||
$scope.title = result.label || result.fqdn;
|
||||
$scope.rootDirLabel = '/app/data/';
|
||||
break;
|
||||
case 'volume':
|
||||
$scope.title = result.name;
|
||||
$scope.rootDirLabel = result.hostPath;
|
||||
break;
|
||||
case 'mail':
|
||||
$scope.title = 'mail';
|
||||
$scope.rootDirLabel = 'mail';
|
||||
break;
|
||||
}
|
||||
|
||||
$scope.title = $scope.type === 'app' ? (result.label || result.fqdn) : result.name;
|
||||
$scope.rootDirLabel = $scope.type === 'app' ? '/app/data/' : result.hostPath;
|
||||
window.document.title = $scope.title + ' - ' + $translate.instant('filemanager.title');
|
||||
|
||||
// now mark the Client to be ready
|
||||
|
||||
Reference in New Issue
Block a user