mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-23 08:55:32 +00:00
fix progress bar incorrect when upload file twice
This commit is contained in:
@ -111,7 +111,7 @@
|
|||||||
/>
|
/>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<div *ngIf="uploadedFile">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -33,6 +33,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
|||||||
qemuTemplate: QemuTemplate;
|
qemuTemplate: QemuTemplate;
|
||||||
uploader: FileUploader;
|
uploader: FileUploader;
|
||||||
uploadedFile: boolean = false;
|
uploadedFile: boolean = false;
|
||||||
|
uploadProgress: number = 0;
|
||||||
|
|
||||||
nameForm: FormGroup;
|
nameForm: FormGroup;
|
||||||
memoryForm: FormGroup;
|
memoryForm: FormGroup;
|
||||||
@ -87,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) => {
|
||||||
|
Reference in New Issue
Block a user