mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-01-01 18:46:43 +00:00
Merge pull request #668 from GNS3/During-adding-the-node-customer-is-able-to-change-the-server-where-node-should-be-located-at
Option to choose server type for node added
This commit is contained in:
commit
eab9bca34a
@ -423,7 +423,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
if(!nodeAddedEvent) {
|
||||
return;
|
||||
}
|
||||
this.nodeService.createFromTemplate(this.server, this.project, nodeAddedEvent.template, nodeAddedEvent.x, nodeAddedEvent.y, 'local').subscribe((node: Node) => {
|
||||
this.nodeService.createFromTemplate(this.server, this.project, nodeAddedEvent.template, nodeAddedEvent.x, nodeAddedEvent.y, nodeAddedEvent.server).subscribe((node: Node) => {
|
||||
if (nodeAddedEvent.name !== nodeAddedEvent.template.name) {
|
||||
node.name = nodeAddedEvent.name;
|
||||
this.nodeService.updateNode(this.server, node).subscribe(()=>{});
|
||||
|
@ -46,6 +46,14 @@
|
||||
<input type="number" matInput formControlName="numberOfNodes" placeholder="Enter number of nodes (default value is 1)" />
|
||||
</mat-form-field>
|
||||
</form>
|
||||
<mat-select
|
||||
*ngIf="selectedTemplate"
|
||||
placeholder="Choose server for node"
|
||||
[(ngModel)]="selectedTemplate.compute_id">
|
||||
<mat-option *ngFor="let type of nodeServers" [value]="type">
|
||||
{{type}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
<div class="title-container">
|
||||
<h6>Position</h6>
|
||||
|
@ -27,6 +27,8 @@ export class TemplateListDialogComponent implements OnInit {
|
||||
selectedTemplate: Template;
|
||||
searchText: string = '';
|
||||
|
||||
nodeServers: string[] = ['local', 'vm']
|
||||
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<TemplateListDialogComponent>,
|
||||
private templateService: TemplateService,
|
||||
@ -82,6 +84,7 @@ export class TemplateListDialogComponent implements OnInit {
|
||||
} else {
|
||||
let event: NodeAddedEvent = {
|
||||
template: this.selectedTemplate,
|
||||
server: this.selectedTemplate.compute_id,
|
||||
name: this.configurationForm.get('name').value,
|
||||
numberOfNodes: this.configurationForm.get('numberOfNodes').value,
|
||||
x: x,
|
||||
@ -95,6 +98,7 @@ export class TemplateListDialogComponent implements OnInit {
|
||||
|
||||
export interface NodeAddedEvent {
|
||||
template: Template,
|
||||
server: string,
|
||||
name: string,
|
||||
numberOfNodes: number;
|
||||
x: number;
|
||||
|
Loading…
Reference in New Issue
Block a user