* 'master' of https://github.com/BrockFredin/dockerui:
  Restart Feature - Implementing restart feature for single containers
pull/2/head
Fredin, Brock 2015-05-14 00:22:19 -05:00
commit 1688dbd8a0
2 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,10 @@
ng-click="unpause()"
ng-show="container.State.Running && container.State.Paused">Unpause
</button>
<button class="btn btn-success"
ng-click="restart()"
ng-show="container.State.Running && !container.State.Stopped">Restart
</button>
</div>
<table class="table table-striped">

View File

@ -91,6 +91,17 @@ function($scope, $routeParams, $location, Container, Messages, ViewSpinner) {
});
};
$scope.restart = function() {
ViewSpinner.spin();
Container.restart({id: $routeParams.id}, function(d) {
update();
Messages.send("Container restarted", $routeParams.id);
}, function(e){
update();
Messages.error("Failure", "Container failed to restart." + e.data);
});
};
$scope.hasContent = function(data) {
return data !== null && data !== undefined;
};