From 00d4a5ff920233a6e10591f38d3ec99948f3de3e Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Fri, 4 Sep 2020 02:06:08 +0200 Subject: [PATCH] Update new-template-dialog.component.ts --- .../new-template-dialog.component.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) 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 ba946d5f..5faf2010 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 @@ -278,6 +278,30 @@ export class NewTemplateDialogComponent implements OnInit { this.applianceToInstall = object; setTimeout(() => { this.stepper.next(); + if (this.applianceToInstall.qemu) { + setTimeout(() => { + if (this.qemuBinaries.length) { + if (this.applianceToInstall.qemu.arch === 'x86_64') { + let filtered_binaries = this.qemuBinaries.filter(n => n.path.includes('qemu-system-x86_64')); + if (filtered_binaries.length) { + this.selectedBinary = filtered_binaries[0]; + } + } else if (this.applianceToInstall.qemu.arch === 'i386') { + let filtered_binaries = this.qemuBinaries.filter(n => n.path.includes('qemu-system-i386')); + if (filtered_binaries.length) { + this.selectedBinary = filtered_binaries[0]; + } + } else if (this.applianceToInstall.qemu.arch === 'x86_64') { + let filtered_binaries = this.qemuBinaries.filter(n => n.path.includes('qemu-system-arm')); + if (filtered_binaries.length) { + this.selectedBinary = filtered_binaries[0]; + } + } else { + this.selectedBinary = this.qemuBinaries[0]; + } + } + }, 100); + } }, 100); }