Fix for uploader

This commit is contained in:
piotrpekala7 2020-12-01 02:17:49 +01:00
parent 73ef1f0f80
commit ced2cba28b
2 changed files with 4 additions and 2 deletions

View File

@ -187,11 +187,11 @@
<input
type="file"
class="non-visible"
#file2
#file3
(change)="importImage($event)"
ng2FileSelect
[uploader]="uploaderImage"/>
<button class="button" mat-raised-button (click)="file2.click()">Import</button>
<button class="button" mat-raised-button (click)="file3.click()">Import</button>
<button class="button" mat-raised-button (click)="downloadImageFromVersion(version.images.hdb_disk_image)">Download</button>
</div>
</div>

View File

@ -166,12 +166,14 @@ export class NewTemplateDialogComponent implements OnInit {
this.uploaderImage.onErrorItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {
this.toasterService.error('An error has occured');
this.progressService.deactivate();
this.uploaderImage.clearQueue();
};
this.uploaderImage.onSuccessItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {
this.toasterService.success('Image imported succesfully');
this.refreshImages();
this.progressService.deactivate();
this.uploaderImage.clearQueue();
};
}