diff --git a/app/components/services/services.html b/app/components/services/services.html index 1004e2b33..5406148b4 100644 --- a/app/components/services/services.html +++ b/app/components/services/services.html @@ -58,6 +58,13 @@ + + + Published Ports + + + + Updated at @@ -92,6 +99,12 @@ + + + {{ p.PublishedPort }}:{{ p.TargetPort }} + + - + {{ service.UpdatedAt|getisodate }} diff --git a/app/components/services/servicesController.js b/app/components/services/servicesController.js index e1147b17b..8adf51998 100644 --- a/app/components/services/servicesController.js +++ b/app/components/services/servicesController.js @@ -1,6 +1,6 @@ angular.module('services', []) -.controller('ServicesController', ['$q', '$scope', '$stateParams', '$state', 'Service', 'ServiceHelper', 'Messages', 'Pagination', 'Task', 'Node', 'Authentication', 'UserService', 'ModalService', 'ResourceControlService', -function ($q, $scope, $stateParams, $state, Service, ServiceHelper, Messages, Pagination, Task, Node, Authentication, UserService, ModalService, ResourceControlService) { +.controller('ServicesController', ['$q', '$scope', '$stateParams', '$state', 'Service', 'ServiceHelper', 'Messages', 'Pagination', 'Task', 'Node', 'NodeHelper', 'Authentication', 'UserService', 'ModalService', 'ResourceControlService', +function ($q, $scope, $stateParams, $state, Service, ServiceHelper, Messages, Pagination, Task, Node, NodeHelper, Authentication, UserService, ModalService, ResourceControlService) { $scope.state = {}; $scope.state.selectedItemCount = 0; $scope.state.pagination_count = Pagination.getPaginationCount('services'); @@ -137,6 +137,7 @@ function ($q, $scope, $stateParams, $state, Service, ServiceHelper, Messages, Pa nodes: Node.query({}).$promise, }) .then(function success(data) { + $scope.swarmManagerIP = NodeHelper.getManagerIP(data.nodes); $scope.services = data.services.map(function (service) { var serviceTasks = data.tasks.filter(function (task) { return task.ServiceID === service.ID; diff --git a/app/helpers/nodeHelper.js b/app/helpers/nodeHelper.js index 835a3055f..748f8aa91 100644 --- a/app/helpers/nodeHelper.js +++ b/app/helpers/nodeHelper.js @@ -9,6 +9,16 @@ angular.module('portainer.helpers') Labels: node.Spec.Labels, Availability: node.Spec.Availability }; + }, + getManagerIP: function(nodes) { + var managerIp; + for (var n in nodes) { + if (undefined === nodes[n].ManagerStatus || nodes[n].ManagerStatus.Reachability !== "reachable") { + continue; + } + managerIp = nodes[n].ManagerStatus.Addr.split(":")[0]; + } + return managerIp; } }; }]);