From b5e4972bdb4af62a7178b4fde2314291292148f7 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Tue, 26 Apr 2022 11:24:00 +0200 Subject: [PATCH] Fix for #1303 --- src/app/cartography/models/node.ts | 1 + .../docker/configurator-docker.component.html | 2 +- .../configurator/docker/configurator-docker.component.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/cartography/models/node.ts b/src/app/cartography/models/node.ts index f2362a92..3a755504 100644 --- a/src/app/cartography/models/node.ts +++ b/src/app/cartography/models/node.ts @@ -53,6 +53,7 @@ export class Properties { qemu_path: string; environment: string; extra_hosts: string; + extra_volumes: string[]; replicate_network_connection_state: boolean; } diff --git a/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.html b/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.html index 488b72a1..d093bc2e 100644 --- a/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.html +++ b/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.html @@ -101,7 +101,7 @@
Additional directories
- + diff --git a/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.ts b/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.ts index 53711c68..27f4352d 100644 --- a/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.ts +++ b/src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.ts @@ -27,6 +27,7 @@ export class ConfiguratorDialogDockerComponent implements OnInit { disableClose: true, }; dialogRef; + additionalDirectories: string = ""; constructor( public dialogReference: MatDialogRef, @@ -50,6 +51,12 @@ export class ConfiguratorDialogDockerComponent implements OnInit { this.node = node; this.name = node.name; this.getConfiguration(); + if (this.node.properties.extra_volumes) { + for (let index = 0; index < this.node.properties.extra_volumes.length - 1; index++) { + this.additionalDirectories = this.additionalDirectories + this.node.properties.extra_volumes[index] + "\n"; + } + } + this.additionalDirectories = this.additionalDirectories + this.node.properties.extra_volumes[this.node.properties.extra_volumes.length - 1]; }); } @@ -73,6 +80,8 @@ export class ConfiguratorDialogDockerComponent implements OnInit { onSaveClick() { if (this.generalSettingsForm.valid) { + var extraVolumes = this.additionalDirectories.split("\n").filter(elem => elem != ""); + this.node.properties.extra_volumes = extraVolumes; this.nodeService.updateNode(this.server, this.node).subscribe(() => { this.toasterService.success(`Node ${this.node.name} updated.`); this.onCancelClick();