Add extract progress bar

This commit is contained in:
Girish Ramakrishnan
2020-10-19 21:38:15 -07:00
parent 1e6ea77a8f
commit c7c16ee167
2 changed files with 52 additions and 1 deletions

View File

@@ -130,13 +130,39 @@ app.controller('FileManagerController', ['$scope', '$timeout', 'Client', functio
return '/' + filePath;
}
$scope.extractStatus = {
error: null,
busy: false,
fileName: ''
};
function extract(entry) {
var filePath = sanitize($scope.cwd + '/' + entry.fileName);
if (entry.isDirectory) return;
// prevent it from getting closed
$('#extractModal').modal({
backdrop: 'static',
keyboard: false
});
$scope.extractStatus.fileName = entry.fileName;
$scope.extractStatus.error = null;
$scope.extractStatus.busy = true;
Client.filesExtract($scope.appId, filePath, function (error) {
if (error) return Client.error(error);
$scope.extractStatus.busy = false;
if (error) {
console.error(error);
$scope.extractStatus.error = 'Failed to extract: ' + error.message;
return;
}
$('#extractModal').modal('hide');
$scope.refresh();
});
}