From e335a552c5ecb66f0d21b0aef549f9f69605c613 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Thu, 10 Sep 2020 18:34:26 +0200 Subject: [PATCH] Update new-template-dialog.component.ts --- .../new-template-dialog.component.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/app/components/project-map/new-template-dialog/new-template-dialog.component.ts b/src/app/components/project-map/new-template-dialog/new-template-dialog.component.ts index d5dd8716..9ae92a09 100644 --- a/src/app/components/project-map/new-template-dialog/new-template-dialog.component.ts +++ b/src/app/components/project-map/new-template-dialog/new-template-dialog.component.ts @@ -357,25 +357,14 @@ export class NewTemplateDialogComponent implements OnInit { fileReader.readAsText(file); } - checkImage(image: Image): boolean { - if (this.applianceToInstall.qemu) { - if (this.qemuImages.filter(n => n.filename === image.filename).length > 0) return true; - } else if (this.applianceToInstall.dynamips) { - if (this.iosImages.filter(n => n.filename === image.filename).length > 0) return true; - } else if (this.applianceToInstall.iou) { - if (this.iouImages.filter(n => n.filename === image.filename).length > 0) return true; - } - - return false; - } - checkImageFromVersion(image: string): boolean { + let imageToInstall = this.applianceToInstall.images.filter(n => n.filename === image)[0]; if (this.applianceToInstall.qemu) { - if (this.qemuImages.filter(n => n.filename === image).length > 0) return true; + if (this.qemuImages.filter(n => n.md5sum === imageToInstall.md5sum).length > 0) return true; } else if (this.applianceToInstall.dynamips) { - if (this.iosImages.filter(n => n.filename === image).length > 0) return true; + if (this.iosImages.filter(n => n.md5sum === imageToInstall.md5sum).length > 0) return true; } else if (this.applianceToInstall.iou) { - if (this.iouImages.filter(n => n.filename === image).length > 0) return true; + if (this.iouImages.filter(n => n.md5sum === imageToInstall.md5sum).length > 0) return true; } return false;