This commit is contained in:
piotrpekala7 2022-04-26 11:24:00 +02:00
parent dc5c0d3d94
commit b5e4972bdb
3 changed files with 11 additions and 1 deletions

View File

@ -53,6 +53,7 @@ export class Properties {
qemu_path: string;
environment: string;
extra_hosts: string;
extra_volumes: string[];
replicate_network_connection_state: boolean;
}

View File

@ -101,7 +101,7 @@
<h6>Additional directories</h6>
<mat-form-field class="form-field">
<textarea matInput type="text" [(ngModel)]="node.properties.extra_volumes"></textarea>
<textarea matInput type="text" [(ngModel)]="additionalDirectories"></textarea>
</mat-form-field>
</mat-tab>

View File

@ -27,6 +27,7 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
disableClose: true,
};
dialogRef;
additionalDirectories: string = "";
constructor(
public dialogReference: MatDialogRef<ConfiguratorDialogDockerComponent>,
@ -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();