diff --git a/src/js/client.js b/src/js/client.js index fd4876518..bf8135402 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -3319,8 +3319,8 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout } else if (data.location) { if (data.fqdn !== data.app.fqdn) { return 'Location ' + appName('of', app) + ' was changed to ' + data.fqdn; - } else if (!angular.equals(data.alternateDomains, data.app.alternateDomains)) { - var altFqdns = data.alternateDomains.map(function (a) { return a.fqdn; }); + } else if (!angular.equals(data.redirectDomains, data.app.redirectDomains)) { + var altFqdns = data.redirectDomains.map(function (a) { return a.fqdn; }); return 'Alternate domains ' + appName('of', app) + ' was ' + (altFqdns.length ? 'set to ' + altFqdns.join(', ') : 'reset'); } else if (!angular.equals(data.aliasDomains, data.app.aliasDomains)) { var aliasDomains = data.aliasDomains.map(function (a) { return a.fqdn; }); diff --git a/src/js/index.js b/src/js/index.js index d16ad0921..e4d86aab3 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -237,7 +237,7 @@ app.filter('selectedDomainFilter', function () { if (selectedDomain.domain === app.domain) return true; if (app.aliasDomains.find(function (ad) { return ad.domain === selectedDomain.domain; })) return true; - if (app.alternateDomains.find(function (ad) { return ad.domain === selectedDomain.domain; })) return true; + if (app.redirectDomains.find(function (ad) { return ad.domain === selectedDomain.domain; })) return true; return false; }); diff --git a/src/theme.scss b/src/theme.scss index 29fac6e2e..c57092151 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -511,16 +511,16 @@ multiselect { margin-top: 5px; } -.alternate-domains .col-lg-11 { +.redirect-domains .col-lg-11 { padding-right: 5px; } -.alternate-domains .col-lg-1 { +.redirect-domains .col-lg-1 { padding-left: 0px; padding-right: 0px; } -.alternate-domains .row { +.redirect-domains .row { margin-top: 5px; } @@ -2047,4 +2047,4 @@ tag-input { color: $textColor; border: 1px solid $backgroundDark; } -} \ No newline at end of file +} diff --git a/src/views/app.html b/src/views/app.html index b074dff0e..dbcf41ed8 100644 --- a/src/views/app.html +++ b/src/views/app.html @@ -166,10 +166,10 @@

-
-

-

+

+

@@ -687,34 +687,34 @@
{{ 'app.location.addAliasAction' | tr }}
-
+
-
{{ location.error.alternateDomains }}
+
{{ location.error.redirectDomains }}
-
+
- +
- +
-
{{ 'app.location.noRedirections' | tr }}
-
{{ 'app.location.addRedirectionAction' | tr }}
+
{{ 'app.location.noRedirections' | tr }}
+
{{ 'app.location.addRedirectionAction' | tr }}
diff --git a/src/views/app.js b/src/views/app.js index 1aea84332..944ca3502 100644 --- a/src/views/app.js +++ b/src/views/app.js @@ -289,27 +289,27 @@ angular.module('Application').controller('AppController', ['$scope', '$location' domain: null, location: '', - alternateDomains: [], + redirectDomains: [], aliasDomains: [], portBindings: {}, portBindingsEnabled: {}, portBindingsInfo: {}, - addAlternateDomain: function (event) { + addRedirectDomain: function (event) { event.preventDefault(); - $scope.location.alternateDomains.push({ + $scope.location.redirectDomains.push({ domain: $scope.domains.filter(function (d) { return d.domain === $scope.app.domain; })[0], // pre-select app's domain by default subdomain: '' }); setTimeout(function () { - document.getElementById('alternateDomainsInput-' + ($scope.location.alternateDomains.length-1)).focus(); + document.getElementById('redirectDomainsInput-' + ($scope.location.redirectDomains.length-1)).focus(); }, 200); }, - delAlternateDomain: function (event, index) { + delRedirectDomain: function (event, index) { event.preventDefault(); - $scope.location.alternateDomains.splice(index, 1); + $scope.location.redirectDomains.splice(index, 1); }, addAliasDomain: function (event) { @@ -337,7 +337,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.location.location = app.location; $scope.location.domain = $scope.domains.filter(function (d) { return d.domain === app.domain; })[0]; $scope.location.portBindingsInfo = angular.extend({}, app.manifest.tcpPorts, app.manifest.udpPorts); // Portbinding map only for information - $scope.location.alternateDomains = app.alternateDomains.map(function (a) { return { subdomain: a.subdomain, domain: $scope.domains.filter(function (d) { return d.domain === a.domain; })[0] };}); + $scope.location.redirectDomains = app.redirectDomains.map(function (a) { return { subdomain: a.subdomain, domain: $scope.domains.filter(function (d) { return d.domain === a.domain; })[0] };}); $scope.location.aliasDomains = app.aliasDomains.map(function (a) { return { subdomain: a.subdomain, domain: $scope.domains.filter(function (d) { return d.domain === a.domain; })[0] };}); // fill the portBinding structures. There might be holes in the app.portBindings, which signalizes a disabled port @@ -372,15 +372,15 @@ angular.module('Application').controller('AppController', ['$scope', '$location' location: $scope.location.location, domain: $scope.location.domain.domain, portBindings: portBindings, - alternateDomains: $scope.location.alternateDomains.map(function (a) { return { subdomain: a.subdomain, domain: a.domain.domain };}), + redirectDomains: $scope.location.redirectDomains.map(function (a) { return { subdomain: a.subdomain, domain: a.domain.domain };}), aliasDomains: $scope.location.aliasDomains.map(function (a) { return { subdomain: a.subdomain, domain: a.domain.domain };}) }; // pre-flight only for changed domains var domains = []; if ($scope.app.domain !== data.domain || $scope.app.location !== data.location) domains.push({ subdomain: data.location, domain: data.domain, type: 'main' }); - data.alternateDomains.forEach(function (a) { - if ($scope.app.alternateDomains.some(function (d) { return d.domain === a.domain && d.subdomain === a.subdomain; })) return; + data.redirectDomains.forEach(function (a) { + if ($scope.app.redirectDomains.some(function (d) { return d.domain === a.domain && d.subdomain === a.subdomain; })) return; domains.push({ subdomain: a.subdomain, domain: a.domain, type: 'redirect' }); }); data.aliasDomains.forEach(function (a) { @@ -399,7 +399,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' } else if (domain.type === 'alias') { $scope.location.error.aliasDomains = domain.domain + ' ' + result.error.message; } else { - $scope.location.error.alternateDomains = domain.domain + ' ' + result.error.message; + $scope.location.error.redirectDomains = domain.domain + ' ' + result.error.message; } $scope.location.busy = false; return; @@ -427,7 +427,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.location.error.location = error.message; $scope.locationForm.$setPristine(); } else { // FIXME: check error in aliasDomains - $scope.location.error.alternateDomains = error.message; + $scope.location.error.redirectDomains = error.message; } } else if (error.portName || error.field === 'portBindings') { $scope.location.error.port = error.message; @@ -1569,7 +1569,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' location: null, domain: null, - alternateDomains: [], + redirectDomains: [], aliasDomains: [], backups: [], @@ -1583,7 +1583,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' $scope.repair.retryBusy = false; $scope.repair.location = null; $scope.repair.domain = null; - $scope.repair.alternateDomains = []; + $scope.repair.redirectDomains = []; $scope.repair.aliasDomains = []; $scope.repair.backupId = ''; @@ -1604,8 +1604,8 @@ angular.module('Application').controller('AppController', ['$scope', '$location' }; }); - $scope.repair.alternateDomains = $scope.app.alternateDomains; - $scope.repair.alternateDomains = $scope.app.alternateDomains.map(function (altDomain) { + $scope.repair.redirectDomains = $scope.app.redirectDomains; + $scope.repair.redirectDomains = $scope.app.redirectDomains.map(function (altDomain) { return { subdomain: altDomain.subdomain, enabled: true, @@ -1648,7 +1648,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location' data.domain = $scope.repair.domain.domain; data.aliasDomains = $scope.repair.aliasDomains.filter(function (a) { return a.enabled; }) .map(function (d) { return { subdomain: d.subdomain, domain: d.domain.domain }; }); - data.alternateDomains = $scope.repair.alternateDomains.filter(function (a) { return a.enabled; }) + data.redirectDomains = $scope.repair.redirectDomains.filter(function (a) { return a.enabled; }) .map(function (d) { return { subdomain: d.subdomain, domain: d.domain.domain }; }); data.overwriteDns = true; // always overwriteDns. user can anyway check and uncheck above repairFunc = Client.configureApp.bind(null, $scope.app.id, 'location', data);