diff --git a/src/filemanager.html b/src/filemanager.html index 1eef85d16..09784d689 100644 --- a/src/filemanager.html +++ b/src/filemanager.html @@ -280,7 +280,17 @@ -
+
+

+
+ +
+
+ restarting {{ title }} +

+
+ +
@@ -310,6 +320,14 @@
  • {{ 'filemanager.toolbar.uploadFolder' | tr }}
  • +
    + + +
    diff --git a/src/js/filemanager.js b/src/js/filemanager.js index 2966d5e84..34a17b8af 100644 --- a/src/js/filemanager.js +++ b/src/js/filemanager.js @@ -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, diff --git a/src/translation/en.json b/src/translation/en.json index cedfd8257..68f44ea94 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -849,7 +849,10 @@ "newFile": "New File", "newFolder": "New Folder", "uploadFolder": "Upload Folder", - "uploadFile": "Upload File" + "uploadFile": "Upload File", + "restartApp": "Restart App", + "openTerminal": "Open Terminal", + "openLogs": "Open Logs" }, "list": { "name": "Name", @@ -1165,7 +1168,7 @@ }, "auto": { "title": "Automatic Updates", - "description": "Cloudron periodically polls the App Store to check for updates. If you disable automatic updates, be sure to manually check for updates.", + "description": "Cloudron periodically checks the App Store for updates. If you disable automatic updates, be sure to manually apply the updates.", "enabled": "Automatic Updates is currently enabled.", "disabled": "Automatic Updates is currently disabled.", "disableAction": "Disable Automatic Updates",