Skip to content

Commit c4185bc

Browse files
committed
Show all AppInstances not just the enabled ones
1 parent 65a26ff commit c4185bc

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

cmdb-ui/.eslintcache

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

cmdb-ui/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

3+
.eslintcache
4+
35
# dependencies
46
/node_modules
57
/.pnp

cmdb-ui/src/cmdb/applications/AppGraph.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ class AppGraph extends React.Component {
6464
// Add the charts to Graph
6565
let chartMap = {}
6666
this.props.applicationInstances.forEach((appInstance) => {
67-
if (appInstance.enable) {
68-
chartMap[appInstance.chart_version_id] = appInstance.chart_version_id;
69-
}
67+
chartMap[appInstance.chart_version_id] = appInstance.chart_version_id;
7068
});
7169
const chartIds = Object.values(chartMap)
7270
chartIds.forEach(id => {
@@ -77,23 +75,21 @@ class AppGraph extends React.Component {
7775
});
7876

7977
this.props.applicationInstances.forEach((appInstance) => {
80-
if (appInstance.enable) {
81-
const env = this.props.environments[appInstance.environment_id];
82-
const lifecycle = this.props.lifecycles[env.lifecycle_id];
83-
const lifecycleName = this.lookupLifeCycleName(lifecycle.name);
84-
// Having the environment made the graph too complex
85-
// Application Instances have environment prefix in their name
86-
// dataSnapShot.nodes.push({id: env.name, color: 'orange'});
87-
// dataSnapShot.links.push({source: lifecycleName, target: env.name});
88-
dataSnapShot.nodes.push({id: appInstance.name, color: 'green'});
89-
// Add lifecycle link
90-
dataSnapShot.links.push({source: lifecycleName, target: appInstance.name});
91-
// Add chart link
92-
const chartName = this.props.chartVersions[appInstance.chart_version_id].repo +
93-
':' + this.props.chartVersions[appInstance.chart_version_id].version;
94-
if (chartName && chartName.length > 0) {
95-
dataSnapShot.links.push({source: appInstance.name, target: chartName});
96-
}
78+
const env = this.props.environments[appInstance.environment_id];
79+
const lifecycle = this.props.lifecycles[env.lifecycle_id];
80+
const lifecycleName = this.lookupLifeCycleName(lifecycle.name);
81+
// Having the environment made the graph too complex
82+
// Application Instances have environment prefix in their name
83+
// dataSnapShot.nodes.push({id: env.name, color: 'orange'});
84+
// dataSnapShot.links.push({source: lifecycleName, target: env.name});
85+
dataSnapShot.nodes.push({id: appInstance.name, color: 'green'});
86+
// Add lifecycle link
87+
dataSnapShot.links.push({source: lifecycleName, target: appInstance.name});
88+
// Add chart link
89+
const chartName = this.props.chartVersions[appInstance.chart_version_id].repo +
90+
':' + this.props.chartVersions[appInstance.chart_version_id].version;
91+
if (chartName && chartName.length > 0) {
92+
dataSnapShot.links.push({source: appInstance.name, target: chartName});
9793
this.setState({data: dataSnapShot});
9894
}
9995
});

0 commit comments

Comments
 (0)