Skip to content

Commit

Permalink
fix: Deploy app, parse config with env params (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnywx authored Dec 21, 2018
1 parent 3bbd2b2 commit f747256
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/pages/Dashboard/Apps/Deploy/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ export default class AppDeploy extends Component {
cluster: _.extend(
{},
this.getFormDataByKey('cluster'),
this.getNodesConf()
this.getConfByKey()
),
env: this.getFormDataByKey('env')
env: this.getConfByKey('env')
});
}

Expand Down Expand Up @@ -172,11 +172,16 @@ export default class AppDeploy extends Component {
return _.mapKeys(dataByPrefix, (val, key) => key.substring(keyPrefix.length));
};

getNodesConf = () => {
const nodesConf = this.getFormDataByKey('node');
/**
*
* @param confKey node | env
* @returns {*}
*/
getConfByKey = (confKey = 'node') => {
const conf = this.getFormDataByKey(confKey);

return _.transform(
nodesConf,
conf,
(res, val, key) => {
const [role, meter] = key.split('.');
res[role] = res[role] || {};
Expand Down

0 comments on commit f747256

Please sign in to comment.