Skip to content

Commit

Permalink
fix: Fix application ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Jul 10, 2020
1 parent d6a7076 commit 15fb666
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/locales/tc/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
'Deployed Applications': '已部署應用',
'Deploy New Application': '部署新應用',
'Deploy App': '部署應用',
'Create Application': '構建應用',
'Create Composing Application': '構建應用',
'App Template': '應用範本',
Deploy: '部署',
'Application Type': '應用類型',
Expand Down
2 changes: 1 addition & 1 deletion src/locales/zh/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
'Deployed Applications': '已部署应用',
'Deploy New Application': '部署新应用',
'Deploy App': '部署应用',
'Create Application': '构建应用',
'Create Composing Application': '构建自制应用',
'App Template': '应用模板',
Deploy: '部署',
'Application Type': '应用类型',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export default class Components extends Component {

this.routerStore.fetchListByK8s(params)
}
this.routerStore.getGateway(detail)
this.routerStore.getGateway({
cluster,
...detail,
})
}

getNodePorts(gateway) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ export default class Tracing extends React.Component {
fetchTracing = () => {
const { namespace } = toJS(this.detailStore.detail)
const { cluster } = this.state

if (!cluster || !get(cluster, 'configz.servicemesh')) {
return
}

const query = {
namespace,
cluster: cluster.name,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/fedprojects/containers/Applications/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default class CRDApps extends React.Component {
{
key: 'create',
type: 'control',
text: t('Create Application'),
text: t('Create Composing Application'),
onClick: this.showCreate,
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export default class RuleList extends React.Component {
<ul>
{rules
.filter(item => item.host)
.map(rule => (
.map((rule, index) => (
<Item
key={rule.host}
key={`${rule.host}-${index}`}
rule={rule}
tls={tls}
onEdit={onAdd}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/projects/components/Modals/ServiceDelete/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import { get, flatten, isArray, isEmpty } from 'lodash'
import { get, flatten, isArray, isEmpty, uniqBy } from 'lodash'
import { Icon, Checkbox } from '@pitrix/lego-ui'

import { joinSelector, getDisplayName } from 'utils'
Expand Down Expand Up @@ -166,7 +166,7 @@ export default class ServiceDeleteModal extends React.Component {

const results = await Promise.all(requests)
this.setState({
relatedResources: flatten(results),
relatedResources: uniqBy(flatten(results), 'uid'),
isLoading: false,
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/projects/components/Modals/WorkloadDelete/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
import { flatten, isArray, isEmpty, get } from 'lodash'
import { flatten, isArray, isEmpty, get, uniqBy } from 'lodash'
import { Icon, Checkbox } from '@pitrix/lego-ui'

import { joinSelector } from 'utils'
Expand Down Expand Up @@ -145,7 +145,7 @@ export default class WorkloadDeleteModal extends React.Component {

const results = await Promise.all(requests)
this.setState({
relatedResources: flatten(results),
relatedResources: uniqBy(flatten(results), 'uid'),
isLoading: false,
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/projects/containers/Applications/CRDApps.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default class CRDApps extends React.Component {
{
key: 'create',
type: 'control',
text: t('Create Application'),
text: t('Create Composing Application'),
onClick: this.showCreate,
},
]
Expand Down
19 changes: 11 additions & 8 deletions src/pages/workspaces/containers/BaseInfo/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class BaseInfo extends React.Component {
name: 'DevOps Projects',
icon: 'strategy-group',
value: metrics.workspace_devops_project_count,
hidden: !globals.app.hasKsModule('devops'),
},
{
name: 'Workspace Members',
Expand Down Expand Up @@ -205,14 +206,16 @@ class BaseInfo extends React.Component {
)}
</div>
<div className={styles.content}>
{options.map(option => (
<Text
key={option.name}
icon={option.icon}
title={option.value}
description={t(option.name)}
/>
))}
{options
.filter(option => !option.hidden)
.map(option => (
<Text
key={option.name}
icon={option.icon}
title={option.value}
description={t(option.name)}
/>
))}
</div>
</Panel>
)
Expand Down
1 change: 1 addition & 0 deletions src/pages/workspaces/containers/FedProjects/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export default class Projects extends React.Component {
this.props.trigger('federated.project.create', {
...this.props.match.params,
store: this.projectStore,
clusters: this.clusters.slice(),
success: () => this.getData(),
})

Expand Down

0 comments on commit 15fb666

Please sign in to comment.