mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-09 12:02:53 +00:00
I added checksum key instead of md5sum key
This commit is contained in:
parent
0df6294cc7
commit
a7e637a466
@ -246,7 +246,7 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
let fileReader: FileReader = new FileReader();
|
||||
let emulator;
|
||||
|
||||
fileReader.onloadend= () => {
|
||||
fileReader.onloadend = () => {
|
||||
let appliance = JSON.parse(fileReader.result as string);
|
||||
|
||||
if (appliance.docker) emulator = 'docker';
|
||||
@ -409,11 +409,11 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
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.md5sum === imageToInstall.md5sum).length > 0) return true;
|
||||
if (this.qemuImages.filter((n) => n.checksum === imageToInstall.md5sum).length > 0) return true;
|
||||
} else if (this.applianceToInstall.dynamips) {
|
||||
if (this.iosImages.filter((n) => n.md5sum === imageToInstall.md5sum).length > 0) return true;
|
||||
if (this.iosImages.filter((n) => n.checksum === imageToInstall.md5sum).length > 0) return true;
|
||||
} else if (this.applianceToInstall.iou) {
|
||||
if (this.iouImages.filter((n) => n.md5sum === imageToInstall.md5sum).length > 0) return true;
|
||||
if (this.iouImages.filter((n) => n.checksum === imageToInstall.md5sum).length > 0) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -429,9 +429,12 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.checkImageFromVersion(version.images.hda_disk_image)) return true;
|
||||
if (this.checkImageFromVersion(version.images.hda_disk_image)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
openConfirmationDialog(message: string, link: string) {
|
||||
const dialogRef = this.dialog.open(InformationDialogComponent, {
|
||||
@ -607,6 +610,7 @@ export class NewTemplateDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
createQemuTemplateFromVersion(version: Version) {
|
||||
debugger
|
||||
if (!this.checkImages(version)) {
|
||||
this.toasterService.error('Please install required images first');
|
||||
return;
|
||||
|
@ -5,6 +5,7 @@ export interface Image {
|
||||
filename: string;
|
||||
filesize: any;
|
||||
md5sum: string;
|
||||
checksum: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user