Add logs, terminal and restart action to filemanager

This commit is contained in:
Johannes Zellner
2020-12-07 19:49:53 +01:00
parent 8ef05c850d
commit e1f5fea303
3 changed files with 48 additions and 3 deletions

View File

@@ -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,