47 lines
No EOL
1.1 KiB
TypeScript
47 lines
No EOL
1.1 KiB
TypeScript
import { Input, Component, Inject } from 'ng-metadata/core';
|
|
const templateUrl = require('./load-config.html');
|
|
const styleUrl = require('./load-config.css');
|
|
|
|
declare let bootbox: any;
|
|
declare let window: any;
|
|
|
|
@Component({
|
|
selector: 'load-config',
|
|
templateUrl,
|
|
styleUrls: [ styleUrl ],
|
|
})
|
|
export class LoadConfigComponent {
|
|
private isReady: boolean = false;
|
|
private uploadFunc: Function;
|
|
|
|
private constructor(@Inject('ApiService') private apiService: any) {
|
|
}
|
|
|
|
private handleTarballSelected(files: File[], callback: Function) {
|
|
this.isReady = true;
|
|
callback(true)
|
|
}
|
|
|
|
private handleTarballCleared() {
|
|
this.isReady = false;
|
|
}
|
|
|
|
private uploadTarball() {
|
|
this.uploadFunc(resp => {
|
|
console.log('hi')
|
|
console.log(resp)
|
|
});
|
|
}
|
|
|
|
/**
|
|
* When files are validated, this is called by the child to give us
|
|
* the callback function to upload
|
|
* @param files: files to upload
|
|
* @param uploadFiles: function to call to upload files
|
|
*/
|
|
private filesValidated(files, uploadFiles) {
|
|
this.uploadFunc = uploadFiles;
|
|
}
|
|
|
|
|
|
} |