mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-28 15:02:49 +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"
|
placeholder="Please enter name"
|
||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<div *ngIf="uploadedFile">
|
||||||
|
<mat-progress-bar mode="determinate" [value]="uploadProgress" aria-valuemin="0" aria-valuemax="100"></mat-progress-bar>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
|
@ -32,6 +32,8 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
|||||||
chosenImage: string = '';
|
chosenImage: string = '';
|
||||||
qemuTemplate: QemuTemplate;
|
qemuTemplate: QemuTemplate;
|
||||||
uploader: FileUploader;
|
uploader: FileUploader;
|
||||||
|
uploadedFile: boolean = false;
|
||||||
|
uploadProgress: number = 0;
|
||||||
|
|
||||||
nameForm: FormGroup;
|
nameForm: FormGroup;
|
||||||
memoryForm: FormGroup;
|
memoryForm: FormGroup;
|
||||||
@ -86,6 +88,9 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
this.toasterService.success('Image uploaded');
|
this.toasterService.success('Image uploaded');
|
||||||
};
|
};
|
||||||
|
this.uploader.onProgressItem = (progress: any) => {
|
||||||
|
this.uploadProgress = progress['progress'];
|
||||||
|
};
|
||||||
|
|
||||||
const server_id = this.route.snapshot.paramMap.get('server_id');
|
const server_id = this.route.snapshot.paramMap.get('server_id');
|
||||||
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
|
this.serverService.get(parseInt(server_id, 10)).then((server: Server) => {
|
||||||
@ -127,6 +132,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uploadImageFile(event) {
|
uploadImageFile(event) {
|
||||||
|
this.uploadedFile = true;
|
||||||
let name = event.target.files[0].name;
|
let name = event.target.files[0].name;
|
||||||
this.diskForm.controls['fileName'].setValue(name);
|
this.diskForm.controls['fileName'].setValue(name);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user