Skip to content

Commit

Permalink
fix: Fix operations for platform-admin
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Aug 4, 2020
1 parent 0c206fc commit 1477908
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
1 change: 1 addition & 0 deletions server/services/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const getWorkspaces = async token => {
const resp = await send_gateway_request({
method: 'GET',
url: '/kapis/tenant.kubesphere.io/v1alpha2/workspaces',
params: { limit: 10 },
token,
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/KubeTools/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default class KubeTools extends React.Component {
link: '/kubectl',
title: 'Kubectl',
description: t('TOOLBOX_KUBECTL_DESC'),
hidden: globals.user.globalrole !== 'platform-admin',
hidden: !globals.app.isPlatformAdmin,
action: 'toolbox.kubectl',
},
],
Expand Down
10 changes: 6 additions & 4 deletions src/pages/clusters/containers/Overview/Dashboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ export default class Dashboard extends React.Component {
<ResourcesUsage cluster={match.params.cluster} />
<Tools cluster={match.params.cluster} />
</Column>
<Column className="is-narrow is-4">
<KubernetesStatus cluster={match.params.cluster} />
<ClusterNodes cluster={match.params.cluster} />
</Column>
{globals.app.isPlatformAdmin && (
<Column className="is-narrow is-4">
<KubernetesStatus cluster={match.params.cluster} />
<ClusterNodes cluster={match.params.cluster} />
</Column>
)}
</Columns>
</div>
)
Expand Down
15 changes: 0 additions & 15 deletions src/pages/clusters/containers/Projects/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,7 @@ export default class ProjectDetail extends React.Component {
}

getOperations = () => {
const { workspace, cluster, name, isFedManaged } = this.store.detail

let url = `/${workspace}/clusters/${cluster}/projects/${name}`
if (isFedManaged) {
url = `/${workspace}/federatedprojects/${name}`
}

return [
{
key: 'enter',
text: t('Enter the project'),
action: 'view',
type: 'control',
show: globals.app.workspaces.includes(workspace),
onClick: () => this.routing.push(url),
},
{
key: 'edit',
icon: 'pen',
Expand Down

0 comments on commit 1477908

Please sign in to comment.