mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-08 11:04:15 +00:00
fix progress bar incorrect when upload file twice
This commit is contained in:
parent
15faca6d89
commit
56384fbcc0
@ -111,7 +111,7 @@
|
||||
/>
|
||||
</mat-form-field>
|
||||
<div *ngIf="uploadedFile">
|
||||
<mat-progress-bar mode="determinate" [value]="uploader.progress" ></mat-progress-bar>
|
||||
<mat-progress-bar mode="determinate" [value]="uploadProgress" aria-valuemin="0" aria-valuemax="100"></mat-progress-bar>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -33,6 +33,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
qemuTemplate: QemuTemplate;
|
||||
uploader: FileUploader;
|
||||
uploadedFile: boolean = false;
|
||||
uploadProgress: number = 0;
|
||||
|
||||
nameForm: FormGroup;
|
||||
memoryForm: FormGroup;
|
||||
@ -87,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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user