mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-18 20:47:51 +00:00
Merge pull request #1199 from potats0/master
add progress bar when uploading qemu disks
This commit is contained in:
commit
4e42bd7a54
@ -110,6 +110,9 @@
|
||||
placeholder="Please enter name"
|
||||
/>
|
||||
</mat-form-field>
|
||||
<div *ngIf="uploadedFile">
|
||||
<mat-progress-bar mode="determinate" [value]="uploadProgress" aria-valuemin="0" aria-valuemax="100"></mat-progress-bar>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</mat-step>
|
||||
|
@ -32,6 +32,8 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
chosenImage: string = '';
|
||||
qemuTemplate: QemuTemplate;
|
||||
uploader: FileUploader;
|
||||
uploadedFile: boolean = false;
|
||||
uploadProgress: number = 0;
|
||||
|
||||
nameForm: FormGroup;
|
||||
memoryForm: FormGroup;
|
||||
@ -86,6 +88,9 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
});
|
||||
this.toasterService.success('Image uploaded');
|
||||
};
|
||||
this.uploader.onProgressItem = (progress: any) => {
|
||||
this.uploadProgress = progress['progress'];
|
||||
};
|
||||
|
||||
const server_id = this.route.snapshot.paramMap.get('server_id');
|
||||
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
|
||||
@ -127,6 +132,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
}
|
||||
|
||||
uploadImageFile(event) {
|
||||
this.uploadedFile = true;
|
||||
let name = event.target.files[0].name;
|
||||
this.diskForm.controls['fileName'].setValue(name);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user