mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-18 20:47:51 +00:00
Fix for issue in docker configurator
This commit is contained in:
parent
b5e4972bdb
commit
a08a7e1476
@ -51,12 +51,12 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
|
||||
this.node = node;
|
||||
this.name = node.name;
|
||||
this.getConfiguration();
|
||||
if (this.node.properties.extra_volumes) {
|
||||
if (this.node.properties.extra_volumes && this.node.properties.extra_volumes.length>0) {
|
||||
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];
|
||||
}
|
||||
this.additionalDirectories = this.additionalDirectories + this.node.properties.extra_volumes[this.node.properties.extra_volumes.length - 1];
|
||||
});
|
||||
}
|
||||
|
||||
@ -79,8 +79,15 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
|
||||
}
|
||||
|
||||
onSaveClick() {
|
||||
var extraVolumes = this.additionalDirectories.split("\n").filter(elem => elem != "");
|
||||
for (const item of extraVolumes) {
|
||||
console.log(item);
|
||||
if (!item.startsWith("/")) {
|
||||
this.toasterService.error(`Wrong format for additional directories.`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
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.`);
|
||||
|
Loading…
Reference in New Issue
Block a user