|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
angular.module('container', [])
|
|
|
|
|
.controller('ContainerController', ['$scope', '$state','$stateParams', '$filter', 'Container', 'ContainerCommit', 'ImageHelper', 'Messages',
|
|
|
|
|
function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, ImageHelper, Messages) {
|
|
|
|
|
.controller('ContainerController', ['$scope', '$state','$stateParams', '$filter', 'Container', 'ContainerCommit', 'ImageHelper', 'Network', 'Messages',
|
|
|
|
|
function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, ImageHelper, Network, Messages) {
|
|
|
|
|
$scope.activityTime = 0;
|
|
|
|
|
$scope.portBindings = [];
|
|
|
|
|
$scope.config = {
|
|
|
|
@ -153,5 +153,22 @@ function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, Ima
|
|
|
|
|
$scope.container.edit = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.containerLeaveNetwork = function containerLeaveNetwork(container, networkId) {
|
|
|
|
|
$('#loadingViewSpinner').show();
|
|
|
|
|
Network.disconnect({id: networkId}, { Container: $stateParams.id, Force: false }, function (d) {
|
|
|
|
|
if (d.message) {
|
|
|
|
|
$('#loadingViewSpinner').hide();
|
|
|
|
|
Messages.send("Error", {}, d.message);
|
|
|
|
|
} else {
|
|
|
|
|
$('#loadingViewSpinner').hide();
|
|
|
|
|
Messages.send("Container left network", $stateParams.id);
|
|
|
|
|
$state.go('network', {id: network.Id}, {reload: true});
|
|
|
|
|
}
|
|
|
|
|
}, function (e) {
|
|
|
|
|
$('#loadingViewSpinner').hide();
|
|
|
|
|
Messages.error("Failure", e, "Unable to disconnect container from network");
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
update();
|
|
|
|
|
}]);
|
|
|
|
|