clone: use manifest from the backup

This commit is contained in:
Girish Ramakrishnan
2022-05-12 09:26:12 -07:00
parent 13343445b3
commit 2745101378
2 changed files with 12 additions and 10 deletions

View File

@@ -457,7 +457,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'main.dialog.close' | tr }}</button>
<button type="button" class="btn btn-danger" ng-click="restore.submit()"><i class="fas fa-history" ng-hide="restore.busy"></i><i class="fa fa-circle-notch fa-spin" ng-show="clone.busy"></i> {{ 'app.restoreDialog.restoreAction' | tr }}</button>
<button type="button" class="btn btn-danger" ng-click="restore.submit()"><i class="fas fa-history" ng-hide="restore.busy"></i><i class="fa fa-circle-notch fa-spin" ng-show="restore.busy"></i> {{ 'app.restoreDialog.restoreAction' | tr }}</button>
</div>
</div>
</div>
@@ -494,7 +494,7 @@
</div>
<div class="has-error text-center" ng-show="clone.error.secondaryDomain">{{ clone.error.secondaryDomain }}</div>
<div ng-repeat="(env, info) in app.manifest.httpPorts">
<div ng-repeat="(env, info) in clone.backup.manifest.httpPorts">
<ng-form name="secondaryDomainInfo_form">
<div class="form-group" ng-class="{ 'has-error': (!secondaryDomainInfo_form.itemName{{$index}}.$dirty && clone.error.secondaryDomain) || (secondaryDomainInfo_form.itemName{{$index}}.$dirty && secondaryDomainInfo_form.itemName{{$index}}.$invalid) || (clone.error.location.fqdn === clone.secondaryDomains[env].subdomain + '.' + clone.secondaryDomains[env].domain.domain) }">
<label class="control-label" for="secondaryDomainInput{{env}}">

View File

@@ -1585,7 +1585,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
portBindingsEnabled: {},
show: function (backup) {
var app = $scope.app; // FIXME: should choose "app" from the backup's manifest
var app = $scope.app;
$scope.clone.error = {};
$scope.clone.backup = backup;
@@ -1595,14 +1595,16 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.clone.overwriteDns = false;
$scope.clone.secondaryDomains = {};
app.secondaryDomains.forEach(function (sd) {
$scope.clone.secondaryDomains[sd.environmentVariable] = {
subdomain: sd.subdomain,
domain: $scope.domains.filter(function (d) { return d.domain === sd.domain; })[0]
};
});
$scope.clone.portBindingsInfo = angular.extend({}, app.manifest.tcpPorts, app.manifest.udpPorts); // Portbinding map only for information
var httpPorts = backup.manifest.httpPorts || {};
for (var env2 in httpPorts) {
$scope.clone.secondaryDomains[env2] = {
subdomain: httpPorts[env2].defaultValue || '',
domain: $scope.clone.domain
};
}
$scope.clone.portBindingsInfo = angular.extend({}, backup.manifest.tcpPorts, backup.manifest.udpPorts); // Portbinding map only for information
// set default ports
for (var env in $scope.clone.portBindingsInfo) {
$scope.clone.portBindings[env] = $scope.clone.portBindingsInfo[env].defaultValue || 0;