diff --git a/app/components/container/container.html b/app/components/container/container.html index e26bfa7f0..801898ff2 100644 --- a/app/components/container/container.html +++ b/app/components/container/container.html @@ -202,3 +202,34 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
Network NameIP AddressGatewayMacAddressActions
{{ key }}{{ value.IPAddress || '-' }}{{ value.Gateway || '-' }}{{ value.MacAddress || '-' }} + +
+
+
+
+
diff --git a/app/components/container/containerController.js b/app/components/container/containerController.js index 94a23a05d..1c4f78cb9 100644 --- a/app/components/container/containerController.js +++ b/app/components/container/containerController.js @@ -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(); }]);