Create download modal following setup completion
This commit is contained in:
parent
aa93d698b2
commit
2d0a599aab
12 changed files with 142 additions and 52 deletions
|
@ -27,7 +27,8 @@ angular.module("quay-config")
|
|||
restrict: 'C',
|
||||
scope: {
|
||||
'isActive': '=isActive',
|
||||
'configurationSaved': '&configurationSaved'
|
||||
'configurationSaved': '&configurationSaved',
|
||||
'setupCompleted': '&setupCompleted',
|
||||
},
|
||||
controller: function($rootScope, $scope, $element, $timeout, ApiService) {
|
||||
var authPassword = null;
|
||||
|
@ -413,7 +414,7 @@ angular.module("quay-config")
|
|||
}
|
||||
};
|
||||
|
||||
$scope.generateConfigTarball = function() {
|
||||
$scope.saveConfiguration = function() {
|
||||
$scope.savingConfiguration = true;
|
||||
|
||||
// Make sure to note that fully verified setup is completed. We use this as a signal
|
||||
|
@ -432,20 +433,16 @@ angular.module("quay-config")
|
|||
authPassword = null;
|
||||
});
|
||||
|
||||
// We need to set the response type to 'blob', to ensure it's never encoded as a string
|
||||
// (string encoded binary data can be difficult to transform with js)
|
||||
// and to make it easier to save (FileSaver expects a blob)
|
||||
ApiService.scGetConfigTarball(null, null, null, null, true).then(function(resp) {
|
||||
ApiService.scUpdateConfig(data).then(function(resp) {
|
||||
authPassword = null;
|
||||
|
||||
FileSaver.saveAs(resp, 'quay-config.tar.gz');
|
||||
|
||||
$scope.savingConfiguration = false;
|
||||
$scope.mapped.$hasChanges = false;
|
||||
|
||||
$('#validateAndSaveModal').modal('hide');
|
||||
|
||||
$scope.configurationSaved({'config': $scope.config});
|
||||
// $scope.configurationSaved({'config': $scope.config});
|
||||
$scope.setupCompleted();
|
||||
}, errorDisplay);
|
||||
};
|
||||
|
||||
|
|
Reference in a new issue