diff --git a/app/components/network/network.html b/app/components/network/network.html
index 36bec67ec..678113b2f 100644
--- a/app/components/network/network.html
+++ b/app/components/network/network.html
@@ -8,118 +8,56 @@
-
-
-
-
-
-
- {{ network.Name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
- Id |
- {{ network.Id }} |
+ Name |
+ {{ network.Name }} |
- Scope |
- {{ network.Scope }} |
+ ID |
+
+ {{ network.Id }}
+
+ |
Driver |
{{ network.Driver }} |
- IPAM |
-
-
-
- Driver |
- {{ network.IPAM.Driver }} |
-
-
- Subnet |
- {{ network.IPAM.Config[0].Subnet }} |
-
-
- Gateway |
- {{ network.IPAM.Config[0].Gateway }} |
-
-
- |
+ Scope |
+ {{ network.Scope }} |
-
- Containers |
-
-
-
- Id |
- {{ Id }} |
-
-
- EndpointID |
- {{ container.EndpointID}} |
-
-
- MacAddress |
- {{ container.MacAddress}} |
-
-
- IPv4Address |
- {{ container.IPv4Address}} |
-
-
- IPv6Address |
- {{ container.IPv6Address}} |
-
-
-
-
- |
-
-
- |
+
+ Subnet |
+ {{ network.IPAM.Config[0].Subnet }} |
-
- Options |
-
-
-
- {{ k }} |
- {{ v }} |
-
-
- |
+
+ Gateway |
+ {{ network.IPAM.Config[0].Gateway }} |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ key }} |
+ {{ value }} |
diff --git a/app/components/network/networkController.js b/app/components/network/networkController.js
index 8d55ce70c..d5e93b7ff 100644
--- a/app/components/network/networkController.js
+++ b/app/components/network/networkController.js
@@ -1,20 +1,8 @@
angular.module('network', [])
-.controller('NetworkController', ['$scope', 'Network', 'Messages', '$state', '$stateParams',
-function ($scope, Network, Messages, $state, $stateParams) {
+.controller('NetworkController', ['$scope', '$state', '$stateParams', 'Network', 'Messages',
+function ($scope, $state, $stateParams, Network, Messages) {
- $scope.disconnect = function disconnect(networkId, containerId) {
- $('#loadingViewSpinner').show();
- Network.disconnect({id: $stateParams.id}, {Container: containerId}, function (d) {
- $('#loadingViewSpinner').hide();
- Messages.send("Container disconnected", containerId);
- $state.go('network', {id: $stateParams.id}, {reload: true});
- }, function (e) {
- $('#loadingViewSpinner').hide();
- Messages.error("Failure", e, "Unable to disconnect container");
- });
- };
-
- $scope.remove = function remove(networkId) {
+ $scope.removeNetwork = function removeNetwork(networkId) {
$('#loadingViewSpinner').show();
Network.remove({id: $stateParams.id}, function (d) {
if (d.message) {
diff --git a/app/shared/filters.js b/app/shared/filters.js
index 21b4ea019..f680ccffa 100644
--- a/app/shared/filters.js
+++ b/app/shared/filters.js
@@ -191,4 +191,10 @@ angular.module('portainer.filters', [])
return function (obj) {
return _.isEmpty(obj);
};
+})
+.filter('ipaddress', function () {
+ 'use strict';
+ return function (ip) {
+ return ip.slice(0, ip.indexOf('/'));
+ };
});