mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-17 06:18:09 +00:00
Default settings for templates
This commit is contained in:
@ -21,6 +21,7 @@
|
|||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<mat-select
|
<mat-select
|
||||||
placeholder="Image"
|
placeholder="Image"
|
||||||
|
(selectionChange)="onImageChosen($event)"
|
||||||
formControlName="imageName">
|
formControlName="imageName">
|
||||||
<mat-option *ngFor="let image of iosImages" [value]="image.filename">
|
<mat-option *ngFor="let image of iosImages" [value]="image.filename">
|
||||||
{{image.filename}}
|
{{image.filename}}
|
||||||
|
@ -77,7 +77,6 @@ export class AddIosTemplateComponent implements OnInit {
|
|||||||
file.withCredentials = false;
|
file.withCredentials = false;
|
||||||
};
|
};
|
||||||
this.uploader.onErrorItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {
|
this.uploader.onErrorItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {
|
||||||
console.log(response);
|
|
||||||
this.toasterService.error('An error occured: ' + response);
|
this.toasterService.error('An error occured: ' + response);
|
||||||
};
|
};
|
||||||
this.uploader.onSuccessItem = (
|
this.uploader.onSuccessItem = (
|
||||||
@ -195,6 +194,16 @@ export class AddIosTemplateComponent implements OnInit {
|
|||||||
this.router.navigate(['/server', this.server.id, 'preferences', 'dynamips', 'templates']);
|
this.router.navigate(['/server', this.server.id, 'preferences', 'dynamips', 'templates']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onImageChosen() {
|
||||||
|
let name: string = this.iosImageForm.get("imageName").value.split('-')[0];
|
||||||
|
this.iosNameForm.controls['templateName'].setValue(name);
|
||||||
|
|
||||||
|
if (this.platforms.includes(name.split('-')[0])) {
|
||||||
|
this.iosNameForm.controls['platform'].setValue(name);
|
||||||
|
this.iosMemoryForm.controls['memory'].setValue(this.defaultRam[name]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onPlatformChosen() {
|
onPlatformChosen() {
|
||||||
this.iosTemplate.chassis = '';
|
this.iosTemplate.chassis = '';
|
||||||
this.networkAdaptersForTemplate = [];
|
this.networkAdaptersForTemplate = [];
|
||||||
|
Reference in New Issue
Block a user