Add logs, terminal and restart action to filemanager
This commit is contained in:
@@ -414,6 +414,30 @@ app.controller('FileManagerController', ['$scope', '$translate', '$timeout', 'Cl
|
||||
$('#uploadFolderInput').on('change', function (e ) { uploadFiles(e.target.files || [], $scope.cwd, false); });
|
||||
$scope.onUploadFolder = function () { $('#uploadFolderInput').click(); };
|
||||
|
||||
$scope.restartAppBusy = false;
|
||||
$scope.onRestartApp = function () {
|
||||
$scope.restartAppBusy = true;
|
||||
|
||||
function waitUntilRestarted(callback) {
|
||||
Client.getApp($scope.id, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
if (result.installationState === ISTATES.INSTALLED) return callback();
|
||||
setTimeout(waitUntilRestarted.bind(null, callback), 2000);
|
||||
});
|
||||
}
|
||||
|
||||
Client.restartApp($scope.id, function (error) {
|
||||
if (error) console.error('Failed to restart app.', error);
|
||||
|
||||
waitUntilRestarted(function (error) {
|
||||
if (error) console.error('Failed wait for restart.', error);
|
||||
|
||||
$scope.restartAppBusy = false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.newDirectory = {
|
||||
busy: false,
|
||||
error: null,
|
||||
|
||||
Reference in New Issue
Block a user