From 16be213610963e147b778af950393ab58bf71002 Mon Sep 17 00:00:00 2001 From: Kasra Bigdeli Date: Sat, 22 Dec 2018 08:50:03 -0800 Subject: [PATCH] port mapping section done --- .../src/containers/Apps/AppConfigs.tsx | 69 +++++++++++++------ 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/app-frontend/src/containers/Apps/AppConfigs.tsx b/app-frontend/src/containers/Apps/AppConfigs.tsx index 4c499f4..1e8af37 100644 --- a/app-frontend/src/containers/Apps/AppConfigs.tsx +++ b/app-frontend/src/containers/Apps/AppConfigs.tsx @@ -63,25 +63,43 @@ export default class AppConfigs extends Component< } createPortRows() { - /* -
-
-
- Server Public Port: - -
-
-
-
- Container Port: - -
-
-
- - - */ - return
createVolRows
; + const self = this; + const ports = this.props.apiData.appDefinition.ports; + return Utils.map(ports, function(value, index) { + return ( + + + + { + const newApiData = Utils.copyObject(self.props.apiData); + const p = Number(e.target.value.trim()); + newApiData.appDefinition.ports[index].hostPort = + p > 0 ? p : 0; // to avoid NaN + }} + /> + + + + { + const newApiData = Utils.copyObject(self.props.apiData); + const p = Number(e.target.value.trim()); + newApiData.appDefinition.ports[index].containerPort = + p > 0 ? p : 0; // to avoid NaN + }} + /> + + + ); + }); } createVolSection() { @@ -204,6 +222,9 @@ export default class AppConfigs extends Component< > Currently, this app does not have any custom port mapping. + + {this.createPortRows()} +