mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-27 00:21:03 +00:00
Auxiliary console support for IOS, Docker and Qemu templates/nodes
This commit is contained in:
parent
040447ffdf
commit
c9c043b726
@ -14,6 +14,7 @@ export class Properties {
|
||||
headless: boolean;
|
||||
linked_clone: boolean;
|
||||
on_close: string;
|
||||
aux_type: boolean;
|
||||
aux: number;
|
||||
ram: number;
|
||||
nvram: number;
|
||||
|
@ -87,6 +87,18 @@
|
||||
</mat-select>
|
||||
</mat-step>
|
||||
|
||||
<mat-step label="Auxiliary console type" [completed]="dockerTemplate.aux_type">
|
||||
<mat-select
|
||||
placeholder="Auxiliary console type"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
[(ngModel)]="dockerTemplate.aux_type"
|
||||
>
|
||||
<mat-option *ngFor="let type of auxConsoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-step>
|
||||
|
||||
<mat-step label="Environment">
|
||||
<mat-form-field class="form-field">
|
||||
<textarea matInput type="text" [(ngModel)]="dockerTemplate.environment"></textarea>
|
||||
|
@ -22,6 +22,7 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
controller:Controller ;
|
||||
dockerTemplate: DockerTemplate;
|
||||
consoleTypes: string[] = [];
|
||||
auxConsoleTypes: string[] = [];
|
||||
isRemoteComputerChosen: boolean = false;
|
||||
dockerImages: DockerImage[] = [];
|
||||
selectedImage: DockerImage;
|
||||
@ -64,6 +65,7 @@ export class AddDockerTemplateComponent implements OnInit {
|
||||
this.controller = controller;
|
||||
|
||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||
this.auxConsoleTypes = this.configurationService.getAuxConsoleTypes();
|
||||
|
||||
this.templateMocksService.getDockerTemplate().subscribe((dockerTemplate: DockerTemplate) => {
|
||||
this.dockerTemplate = dockerTemplate;
|
||||
|
@ -86,6 +86,17 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="select">
|
||||
<mat-select
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
placeholder="Auxiliary console type"
|
||||
[(ngModel)]="dockerTemplate.aux_type"
|
||||
>
|
||||
<mat-option *ngFor="let type of auxConsoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox [ngModelOptions]="{ standalone: true }" [(ngModel)]="dockerTemplate.console_auto_start">
|
||||
Auto start console
|
||||
</mat-checkbox>
|
||||
|
@ -21,6 +21,7 @@ export class DockerTemplateDetailsComponent implements OnInit {
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
|
||||
consoleTypes: string[] = [];
|
||||
auxConsoleTypes: string[] = [];
|
||||
consoleResolutions: string[] = [];
|
||||
categories = [];
|
||||
adapters: CustomAdapter[] = [];
|
||||
@ -60,6 +61,7 @@ export class DockerTemplateDetailsComponent implements OnInit {
|
||||
|
||||
getConfiguration() {
|
||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||
this.auxConsoleTypes = this.configurationService.getAuxConsoleTypes();
|
||||
this.categories = this.configurationService.getCategories();
|
||||
this.consoleResolutions = this.configurationService.getConsoleResolutions();
|
||||
}
|
||||
|
@ -31,8 +31,10 @@
|
||||
</mat-form-field>
|
||||
<mat-label>Platform - {{ iosTemplate.platform }}</mat-label
|
||||
><br /><br />
|
||||
<div *ngIf="iosTemplate.chassis">
|
||||
<mat-label>Chassis - {{ iosTemplate.chassis }}</mat-label
|
||||
><br /><br />
|
||||
</div>
|
||||
<mat-form-field class="form-field">
|
||||
<input
|
||||
matInput
|
||||
@ -89,6 +91,13 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="select">
|
||||
<mat-select placeholder="Auxiliary console type" [(ngModel)]="iosTemplate.aux_type">
|
||||
<mat-option *ngFor="let type of consoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox [(ngModel)]="iosTemplate.console_auto_start"> Auto start console </mat-checkbox>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
|
@ -66,6 +66,20 @@
|
||||
</mat-form-field>
|
||||
</mat-step>
|
||||
|
||||
<mat-step label="Auxiliary console type" [completed]="qemuTemplate.aux_type">
|
||||
<mat-form-field class="form-field">
|
||||
<mat-select
|
||||
placeholder="Auxiliary console type"
|
||||
[(ngModel)]="qemuTemplate.aux_type"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
>
|
||||
<mat-option *ngFor="let type of auxConsoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</mat-step>
|
||||
|
||||
<mat-step label="Disk image">
|
||||
<form [formGroup]="diskForm">
|
||||
<mat-radio-group class="radio-group">
|
||||
|
@ -29,6 +29,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
selectedPlatform: string;
|
||||
ramMemory: number;
|
||||
consoleTypes: string[] = [];
|
||||
auxConsoleTypes: string[] = [];
|
||||
newImageSelected: boolean = false;
|
||||
qemuImages: QemuImage[] = [];
|
||||
selectedImage: QemuImage;
|
||||
@ -113,6 +114,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
||||
this.selectPlatform = this.configurationService.getPlatform();
|
||||
this.selectedPlatform = this.selectPlatform[0];
|
||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||
this.auxConsoleTypes = this.configurationService.getAuxConsoleTypes();
|
||||
});
|
||||
|
||||
this.uploadServiceService.currentCancelItemDetails.subscribe((isCancel) => {
|
||||
|
@ -90,6 +90,13 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="select">
|
||||
<mat-select placeholder="Auxiliary console type" [(ngModel)]="qemuTemplate.aux_type">
|
||||
<mat-option *ngFor="let type of auxConsoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox [(ngModel)]="qemuTemplate.console_auto_start"> Auto start console </mat-checkbox>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
|
@ -21,6 +21,7 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
|
||||
qemuTemplate: QemuTemplate;
|
||||
isSymbolSelectionOpened: boolean = false;
|
||||
consoleTypes: string[] = [];
|
||||
auxConsoleTypes: string[] = [];
|
||||
diskInterfaces: string[] = [];
|
||||
networkTypes = [];
|
||||
bootPriorities = [];
|
||||
@ -72,6 +73,7 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
|
||||
|
||||
getConfiguration() {
|
||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||
this.auxConsoleTypes = this.configurationService.getAuxConsoleTypes();
|
||||
this.diskInterfaces = this.configurationService.getDiskInterfaces();
|
||||
this.networkTypes = this.configurationService.getNetworkTypes();
|
||||
this.bootPriorities = this.configurationService.getBootPriorities();
|
||||
|
@ -56,6 +56,17 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="select">
|
||||
<mat-select
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
placeholder="Auxiliary console type"
|
||||
[(ngModel)]="node.aux_type"
|
||||
>
|
||||
<mat-option *ngFor="let type of auxConsoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox [ngModelOptions]="{ standalone: true }" [(ngModel)]="node.console_auto_start">
|
||||
Auto start console
|
||||
</mat-checkbox>
|
||||
|
@ -21,6 +21,7 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
|
||||
name: string;
|
||||
generalSettingsForm: UntypedFormGroup;
|
||||
consoleTypes: string[] = [];
|
||||
auxConsoleTypes: string[] = [];
|
||||
consoleResolutions: string[] = ['2560x1440', '1920x1080', '1680x1050', '1440x900', '1366x768', '1280x1024', '1280x800', '1024x768', '800x600', '640x480'];
|
||||
private conf = {
|
||||
autoFocus: false,
|
||||
@ -60,6 +61,7 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
|
||||
|
||||
getConfiguration() {
|
||||
this.consoleTypes = this.dockerConfigurationService.getConsoleTypes();
|
||||
this.auxConsoleTypes = this.dockerConfigurationService.getAuxConsoleTypes();
|
||||
}
|
||||
|
||||
configureCustomAdapters() {
|
||||
|
@ -19,6 +19,13 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="select">
|
||||
<mat-select placeholder="Auxiliary console type" [(ngModel)]="node.aux_type">
|
||||
<mat-option *ngFor="let type of consoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox [(ngModel)]="node.console_auto_start"> Auto start console </mat-checkbox><br />
|
||||
</mat-tab>
|
||||
|
||||
|
@ -54,6 +54,13 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="select">
|
||||
<mat-select placeholder="Auxiliary console type" [(ngModel)]="node.aux_type">
|
||||
<mat-option *ngFor="let type of auxConsoleTypes" [value]="type">
|
||||
{{ type }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-checkbox [(ngModel)]="node.properties.console_auto_start"> Auto start console </mat-checkbox>
|
||||
</mat-tab>
|
||||
<mat-tab label="HDD">
|
||||
|
@ -10,6 +10,7 @@ export class DockerTemplate {
|
||||
console_http_port: number;
|
||||
console_resolution: string;
|
||||
console_type: string;
|
||||
aux_type: string;
|
||||
custom_adapters: CustomAdapter[];
|
||||
default_name_format: string;
|
||||
environment: string;
|
||||
|
@ -6,6 +6,7 @@ export class IosTemplate {
|
||||
compute_id: string;
|
||||
console_auto_start: boolean;
|
||||
console_type: string;
|
||||
aux_type: string;
|
||||
default_name_format: string;
|
||||
disk0: number;
|
||||
disk1: number;
|
||||
|
@ -11,6 +11,7 @@ export class QemuTemplate {
|
||||
compute_id: string;
|
||||
console_auto_start: boolean;
|
||||
console_type: string;
|
||||
aux_type: string;
|
||||
cpu_throttling: number;
|
||||
cpus: number;
|
||||
custom_adapters: CustomAdapter[];
|
||||
|
@ -6,6 +6,10 @@ export class DockerConfigurationService {
|
||||
return ['telnet', 'vnc', 'http', 'https', 'none'];
|
||||
}
|
||||
|
||||
getAuxConsoleTypes() {
|
||||
return ['telnet', 'none'];
|
||||
}
|
||||
|
||||
getCategories() {
|
||||
let categories = [
|
||||
['Default', 'guest'],
|
||||
|
@ -39,6 +39,10 @@ export class QemuConfigurationService {
|
||||
return ['telnet', 'vnc', 'spice', 'spice+agent', 'none'];
|
||||
}
|
||||
|
||||
getAuxConsoleTypes() {
|
||||
return ['telnet', 'none'];
|
||||
}
|
||||
|
||||
getDiskInterfaces() {
|
||||
return ['ide', 'sata', 'scsi', 'sd', 'mtd', 'floppy', 'pflash', 'virtio', 'nvme', 'none'];
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ describe('QemuService', () => {
|
||||
compute_id: 'local',
|
||||
console_auto_start: false,
|
||||
console_type: 'telnet',
|
||||
aux_type: 'none',
|
||||
cpu_throttling: 0,
|
||||
cpus: 1,
|
||||
custom_adapters: [],
|
||||
@ -102,6 +103,7 @@ describe('QemuService', () => {
|
||||
compute_id: 'local',
|
||||
console_auto_start: false,
|
||||
console_type: 'telnet',
|
||||
aux_type: 'none',
|
||||
cpu_throttling: 0,
|
||||
cpus: 1,
|
||||
custom_adapters: [],
|
||||
|
@ -27,6 +27,7 @@ export class TemplateMocksService {
|
||||
compute_id: 'local',
|
||||
console_auto_start: false,
|
||||
console_type: 'telnet',
|
||||
aux_type: 'none',
|
||||
cpu_throttling: 0,
|
||||
cpus: 1,
|
||||
custom_adapters: [],
|
||||
@ -172,6 +173,7 @@ export class TemplateMocksService {
|
||||
compute_id: 'local',
|
||||
console_auto_start: false,
|
||||
console_type: 'telnet',
|
||||
aux_type: 'none',
|
||||
default_name_format: 'R{0}',
|
||||
disk0: 0,
|
||||
disk1: 0,
|
||||
@ -239,6 +241,7 @@ export class TemplateMocksService {
|
||||
console_http_port: 80,
|
||||
console_resolution: '1024x768',
|
||||
console_type: 'telnet',
|
||||
aux_type: 'none',
|
||||
custom_adapters: [],
|
||||
default_name_format: '{name}-{0}',
|
||||
environment: '',
|
||||
|
Loading…
Reference in New Issue
Block a user