From cd260511442429621c38c2932c9d0077ce3cc612 Mon Sep 17 00:00:00 2001 From: Kilhog Date: Thu, 12 Jan 2017 06:44:53 +0100 Subject: [PATCH] #476 fix(UX): Rename 'local' endpoint doesn't overwrite "unix://" (#477) * #476 fix(UX): Rename 'local' endpoint doesn't overwrite "unix://" * #477 fix(PR): Rename 'TYPE' in 'type' --- app/components/endpoint/endpointController.js | 3 ++- app/shared/services.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/components/endpoint/endpointController.js b/app/components/endpoint/endpointController.js index 1d8d4cedc..0c254b3df 100644 --- a/app/components/endpoint/endpointController.js +++ b/app/components/endpoint/endpointController.js @@ -19,7 +19,8 @@ function ($scope, $state, $stateParams, $filter, EndpointService, Messages) { var TLSCACert = $scope.formValues.TLSCACert !== $scope.endpoint.TLSCACert ? $scope.formValues.TLSCACert : null; var TLSCert = $scope.formValues.TLSCert !== $scope.endpoint.TLSCert ? $scope.formValues.TLSCert : null; var TLSKey = $scope.formValues.TLSKey !== $scope.endpoint.TLSKey ? $scope.formValues.TLSKey : null; - EndpointService.updateEndpoint(ID, name, URL, TLS, TLSCACert, TLSCert, TLSKey).then(function success(data) { + var type = $scope.endpointType; + EndpointService.updateEndpoint(ID, name, URL, TLS, TLSCACert, TLSCert, TLSKey, type).then(function success(data) { Messages.send("Endpoint updated", $scope.endpoint.Name); $state.go('endpoints'); }, function error(err) { diff --git a/app/shared/services.js b/app/shared/services.js index 1aba157aa..6cb3a27dd 100644 --- a/app/shared/services.js +++ b/app/shared/services.js @@ -374,11 +374,11 @@ angular.module('portainer.services', ['ngResource', 'ngSanitize']) endpoints: function() { return Endpoints.query({}).$promise; }, - updateEndpoint: function(ID, name, URL, TLS, TLSCAFile, TLSCertFile, TLSKeyFile) { + updateEndpoint: function(ID, name, URL, TLS, TLSCAFile, TLSCertFile, TLSKeyFile, type) { var endpoint = { id: ID, Name: name, - URL: "tcp://" + URL, + URL: type === 'local' ? ("unix://" + URL) : ("tcp://" + URL), TLS: TLS }; var deferred = $q.defer();