Show notification if reboot is required

This commit is contained in:
Johannes Zellner
2018-11-26 08:48:58 +01:00
parent 1783059fd4
commit 07edcc5f94
2 changed files with 18 additions and 0 deletions
+7
View File
@@ -944,6 +944,13 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}).error(defaultErrorHandler(callback));
};
Client.prototype.isRebootRequired = function (callback) {
get('/api/v1/cloudron/reboot').success(function(data, status) {
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
callback(null, data.rebootRequired);
}).error(defaultErrorHandler(callback));
};
Client.prototype.reboot = function (callback) {
post('/api/v1/cloudron/reboot').success(function(data, status) {
if (status !== 202 || typeof data !== 'object') return callback(new ClientError(status, data));