mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-10 07:01:21 +00:00
GUAC-1172: Move file transfer manager to corner of client display.
This commit is contained in:
@@ -44,27 +44,8 @@ angular.module('client').directive('guacFileTransferManager', [function guacFile
|
||||
controller: ['$scope', '$injector', function guacFileTransferManagerController($scope, $injector) {
|
||||
|
||||
// Required types
|
||||
var ManagedClient = $injector.get('ManagedClient');
|
||||
var ManagedFileTransferState = $injector.get('ManagedFileTransferState');
|
||||
|
||||
/**
|
||||
* Determines whether the attached client has associated file
|
||||
* transfers, regardless of those file transfers' state.
|
||||
*
|
||||
* @returns {Boolean}
|
||||
* true if there are any file transfers associated with the
|
||||
* attached client, false otherise.
|
||||
*/
|
||||
$scope.hasTransfers = function hasTransfers() {
|
||||
|
||||
// There are no file transfers if there is no client
|
||||
if (!$scope.client)
|
||||
return false;
|
||||
|
||||
return !!($scope.client.uploads.length || $scope.client.downloads.length);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Determines whether the given file transfer state indicates an
|
||||
* in-progress transfer.
|
||||
@@ -112,25 +93,6 @@ angular.module('client').directive('guacFileTransferManager', [function guacFile
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Begins a file upload through the attached Guacamole client for
|
||||
* each file in the given FileList.
|
||||
*
|
||||
* @param {FileList} files
|
||||
* The files to upload.
|
||||
*/
|
||||
$scope.uploadFiles = function uploadFiles(files) {
|
||||
|
||||
// Ignore file uploads if no attached client
|
||||
if (!$scope.client)
|
||||
return;
|
||||
|
||||
// Upload each file
|
||||
for (var i = 0; i < files.length; i++)
|
||||
ManagedClient.uploadFile($scope.client, files[i]);
|
||||
|
||||
};
|
||||
|
||||
}]
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user