Improve app overview and add restart action
This commit is contained in:
@@ -500,6 +500,29 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.restartApp = function (id, callback) {
|
||||
var that = this;
|
||||
|
||||
function waitUntilStopped(callback) {
|
||||
that.getApp(id, function (error, result) {
|
||||
if (error) return callback(error);
|
||||
|
||||
if (result.runState === 'stopped') return callback();
|
||||
setTimeout(waitUntilStopped.bind(null, callback), 2000);
|
||||
});
|
||||
}
|
||||
|
||||
that.stopApp(id, function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
waitUntilStopped(function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
that.startApp(id, callback);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.debugApp = function (id, state, callback) {
|
||||
var data = {
|
||||
appId: id,
|
||||
|
||||
Reference in New Issue
Block a user