diff --git a/src/js/client.js b/src/js/client.js index 0d0797035..1db80ac8d 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -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, diff --git a/src/theme.scss b/src/theme.scss index 9555d341a..24c39d5d8 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -30,9 +30,9 @@ $btn-info-bg: $btn-default-bg; $btn-info-color: $brand-info !default; $btn-info-border: $brand-info !default; -$btn-warning-bg: #333 !default; -$btn-warning-color: $brand-warning !default; -$btn-warning-border: $brand-warning !default; +// $btn-warning-bg: #333 !default; +// $btn-warning-color: $brand-warning !default; +// $btn-warning-border: $brand-warning !default; $btn-danger-bg: $btn-default-bg; $btn-danger-color: $brand-danger !default; @@ -130,6 +130,10 @@ input[type="checkbox"] { text-overflow: ellipsis; } +.btn.pull-right { + margin-left: 5px; +} + // ---------------------------- // Main classes // ---------------------------- diff --git a/src/views/app.html b/src/views/app.html index 76e44f882..0d346f7a7 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -30,38 +30,44 @@
-

+

{{ app.label || app.location || app.fqdn }} -

+ +
+ +

+ {{ app.manifest.title }} + {{ app.upstreamVersion }} (Package v{{ app.manifest.version }}) +
+ App ID {{ app.id }} +
+ Last updated {{ app.updateTime | prettyDate }} +

+
- - - - - - - - - - - - - - - - - - - - - -
Status{{ app | installationStateLabel:user }}
App ID{{ app.id }}
Upstream Version{{ app.upstreamVersion }}
App Package{{ app.manifest.title }}
App Package Version{{ app.manifest.version }}
+ +

+ Usage Information
+

+

+
- Documentation - Logs - + +

+ SFTP
+ Server: {{ config.adminFqdn }}
+ Port: 222
+ Username: {{ user.username }}@{{ app.fqdn }}
+

+
+
+ + + Logs + Documentation +
diff --git a/src/views/app.js b/src/views/app.js index 0289899db..69689faa7 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -11,6 +11,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.app = null; $scope.activeTask = null; + $scope.appIsRestarting = false; $scope.ready = false; $scope.HOST_PORT_MIN = 1024; $scope.HOST_PORT_MAX = 65535; @@ -24,7 +25,17 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.stopAppTask = function (taskId) { Client.stopTask(taskId, function (error) { - if (error) return Client.error(error); + if (error) Client.error(error); + }); + }; + + $scope.restartApp = function () { + $scope.appIsRestarting = true; + + Client.restartApp($scope.app.id, function (error) { + if (error) Client.error(error); + + $scope.appIsRestarting = false; }); };