From 8d795ebf1011b66c1b084f1d28594fe07f28062f Mon Sep 17 00:00:00 2001
From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com>
Date: Wed, 12 Aug 2020 11:55:16 +0200
Subject: [PATCH] CPUs and memory limitation for Docker containers
---
src/app/cartography/models/node.ts | 1 +
.../docker/configurator-docker.component.html | 10 ++++++++++
.../docker/configurator-docker.component.ts | 7 ++++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/app/cartography/models/node.ts b/src/app/cartography/models/node.ts
index e60f7202..c0f50a80 100644
--- a/src/app/cartography/models/node.ts
+++ b/src/app/cartography/models/node.ts
@@ -55,6 +55,7 @@ export class Properties {
environment: string;
extra_hosts: string;
replicate_network_connection_state: boolean;
+ memory: number;
}
export class Node {
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 296cee21..f14d8962 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
@@ -10,9 +10,19 @@
+
+
+
+
+
+
+
+
+
+
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 b855e85f..54c7d070 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
@@ -29,7 +29,9 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
- adapter: new FormControl('', Validators.required)
+ adapter: new FormControl('', Validators.required),
+ memory: new FormControl(''),
+ cpus: new FormControl('')
});
}
@@ -38,12 +40,11 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
this.node = node;
this.name = node.name;
this.getConfiguration();
- })
+ });
}
getConfiguration() {
this.consoleTypes = this.dockerConfigurationService.getConsoleTypes();
-
}
onSaveClick() {