rename location to subdomain

This commit is contained in:
Girish Ramakrishnan
2022-01-16 18:29:32 -08:00
parent fd9efe3da3
commit 63394a666e
7 changed files with 35 additions and 35 deletions

View File

@@ -288,7 +288,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
domainCollisions: [],
domain: null,
location: '',
subdomain: '',
redirectDomains: [],
aliasDomains: [],
portBindings: {},
@@ -334,7 +334,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.location.error = {};
$scope.location.domainCollisions = [];
$scope.location.location = app.location;
$scope.location.subdomain = app.subdomain;
$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.redirectDomains = app.redirectDomains.map(function (a) { return { subdomain: a.subdomain, domain: $scope.domains.filter(function (d) { return d.domain === a.domain; })[0] };});
@@ -369,7 +369,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
var data = {
overwriteDns: !!overwriteDns,
location: $scope.location.location,
subdomain: $scope.location.subdomain,
domain: $scope.location.domain.domain,
portBindings: portBindings,
redirectDomains: $scope.location.redirectDomains.map(function (a) { return { subdomain: a.subdomain, domain: a.domain.domain };}),
@@ -378,7 +378,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
// 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' });
if ($scope.app.domain !== data.domain || $scope.app.subdomain !== data.subdomain) domains.push({ subdomain: data.subdomain, domain: data.domain, type: 'main' });
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' });
@@ -1473,7 +1473,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
error: {},
backup: null,
location: '',
subdomain: '',
domain: null,
portBindings: {},
portBindingsInfo: {},
@@ -1507,13 +1507,13 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
var data = {
location: $scope.clone.location,
subdomain: $scope.clone.subdomain,
domain: $scope.clone.domain.domain,
portBindings: finalPortBindings,
backupId: $scope.clone.backup.id
};
Client.checkDNSRecords(data.domain, data.location, function (error, result) {
Client.checkDNSRecords(data.domain, data.subdomain, function (error, result) {
if (error) {
Client.error(error);
$scope.clone.busy = false;
@@ -1567,7 +1567,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
retryBusy: false,
error: {},
location: null,
subdomain: null,
domain: null,
redirectDomains: [],
aliasDomains: [],
@@ -1581,7 +1581,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
confirm: function () {
$scope.repair.error = {};
$scope.repair.retryBusy = false;
$scope.repair.location = null;
$scope.repair.subdomain = null;
$scope.repair.domain = null;
$scope.repair.redirectDomains = [];
$scope.repair.aliasDomains = [];
@@ -1592,7 +1592,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
var errorState = ($scope.app.error && $scope.app.error.installationState) || ISTATES.PENDING_CONFIGURE;
if (errorState === ISTATES.PENDING_LOCATION_CHANGE) {
$scope.repair.location = app.location;
$scope.repair.subdomain = app.subdomain;
$scope.repair.domain = $scope.domains.filter(function (d) { return d.domain === app.domain; })[0];
$scope.repair.aliasDomains = $scope.app.aliasDomains;
@@ -1644,7 +1644,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
break;
case ISTATES.PENDING_LOCATION_CHANGE:
data.location = $scope.repair.location;
data.subdomain = $scope.repair.subdomain;
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 }; });