Tarball the config and give it to the front end
Download file as blob to avoid binary string encoding
This commit is contained in:
parent
7619ab44e5
commit
aa93d698b2
8 changed files with 66 additions and 1677 deletions
|
@ -413,12 +413,12 @@ angular.module("quay-config")
|
|||
}
|
||||
};
|
||||
|
||||
$scope.saveConfiguration = function() {
|
||||
$scope.generateConfigTarball = function() {
|
||||
$scope.savingConfiguration = true;
|
||||
|
||||
// Make sure to note that fully verified setup is completed. We use this as a signal
|
||||
// in the setup tool.
|
||||
$scope.config['SETUP_COMPLETE'] = true;
|
||||
// $scope.config['SETUP_COMPLETE'] = true;
|
||||
|
||||
var data = {
|
||||
'config': $scope.config,
|
||||
|
@ -432,9 +432,14 @@ angular.module("quay-config")
|
|||
authPassword = null;
|
||||
});
|
||||
|
||||
ApiService.scUpdateConfig(data).then(function(resp) {
|
||||
// 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) {
|
||||
authPassword = null;
|
||||
|
||||
FileSaver.saveAs(resp, 'quay-config.tar.gz');
|
||||
|
||||
$scope.savingConfiguration = false;
|
||||
$scope.mapped.$hasChanges = false;
|
||||
|
||||
|
|
Reference in a new issue