initial import for Open Source 🎉
This commit is contained in:
parent
1898c361f3
commit
9c0dd3b722
2048 changed files with 218743 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
import {Input, Component, Inject, Output, EventEmitter} from 'ng-metadata/core';
|
||||
const templateUrl = require('./download-tarball-modal.component.html');
|
||||
const styleUrl = require('./download-tarball-modal.css');
|
||||
|
||||
declare const FileSaver: any;
|
||||
|
||||
/**
|
||||
* Initial Screen and Choice in the Config App
|
||||
*/
|
||||
@Component({
|
||||
selector: 'download-tarball-modal',
|
||||
templateUrl: templateUrl,
|
||||
styleUrls: [ styleUrl ],
|
||||
})
|
||||
export class DownloadTarballModalComponent {
|
||||
@Input('<') public loadedConfig;
|
||||
@Input('<') public isKubernetes;
|
||||
@Output() public chooseDeploy = new EventEmitter<any>();
|
||||
|
||||
constructor(@Inject('ApiService') private ApiService) {
|
||||
|
||||
}
|
||||
|
||||
private downloadTarball(): void {
|
||||
const errorDisplay: Function = this.ApiService.errorDisplay(
|
||||
'Could not save configuration. Please report this error.'
|
||||
);
|
||||
|
||||
// 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)
|
||||
this.ApiService.scGetConfigTarball(null, null, null, null, 'blob').then(function(resp) {
|
||||
FileSaver.saveAs(resp, 'quay-config.tar.gz');
|
||||
}, errorDisplay);
|
||||
}
|
||||
|
||||
private goToDeploy() {
|
||||
this.chooseDeploy.emit({});
|
||||
}
|
||||
}
|
Reference in a new issue