Skip to content

Commit

Permalink
fix: Fix project permission control
Browse files Browse the repository at this point in the history
Signed-off-by: leoliu <leoliu@yunify.com>
  • Loading branch information
leoliu committed Jul 29, 2020
1 parent ab40ee0 commit 068ba3e
Show file tree
Hide file tree
Showing 25 changed files with 91 additions and 814 deletions.
2 changes: 0 additions & 2 deletions server/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,11 @@ client:
- {
name: alert-messages,
title: Alerting Message,
authKey: alerting,
clusterModule: alerting,
}
- {
name: alert-policies,
title: Alerting Policy,
authKey: alerting,
clusterModule: alerting,
}
- { name: custom-monitoring, title: Custom Monitoring }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import routes from './routes'
@inject('rootStore')
@observer
@trigger
export default class AlertPolicyDetail extends React.Component {
export default class AlertMessageDetail extends React.Component {
store = new AlertMessageStore('node')

policyStore = new AlertPolicyStore('node')
Expand All @@ -45,11 +45,11 @@ export default class AlertPolicyDetail extends React.Component {
}

get module() {
return 'alerting'
return 'alert-messages'
}

get name() {
return 'alerting policy'
return 'alerting message'
}

get listUrl() {
Expand All @@ -74,7 +74,7 @@ export default class AlertPolicyDetail extends React.Component {
key: 'comment',
type: 'default',
text: t('ALERT_COMMENT'),
action: 'record',
action: 'edit',
onClick: () =>
this.trigger('alerting.message.comment', {
detail: this.store.detail,
Expand Down
3 changes: 1 addition & 2 deletions src/pages/clusters/containers/Alerting/Messages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ import MessageStore from 'stores/alerting/message'

@withList({
store: new MessageStore('node'),
module: 'alert-message',
module: 'alert-messages',
name: 'Alerting Message',
authKey: 'alerting',
})
export default class AlertingPolicy extends React.Component {
state = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,24 @@ export default class AlertHistory extends React.Component {
return this.props.match.params
}

get workspace() {
return this.params.workspace
}

get namespace() {
return this.params.namespace
}

get cluster() {
return this.params.cluster
}

get prefix() {
return this.namespace
? `/projects/${this.namespace}/alert-message/all`
: '/monitoring/alert-message/all'
return this.workspace
? `/${this.workspace}/clusters/${this.cluster}/projects/${
this.namespace
}/alert-messages`
: `/clusters/${this.cluster}/alert-messages`
}

@computed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class AlertPolicyDetail extends React.Component {
}

get module() {
return 'alerting'
return 'alert-policies'
}

get name() {
Expand Down Expand Up @@ -137,7 +137,7 @@ export default class AlertPolicyDetail extends React.Component {
const sideProps = {
module: this.module,
name: getDisplayName(this.store.detail),
desc: this.store.detail.description,
desc: this.store.detail.desc,
operations: this.getOperations(),
attrs: this.getAttrs(),
breadcrumbs: [
Expand Down
3 changes: 1 addition & 2 deletions src/pages/clusters/containers/Alerting/Policies/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ import PolicyStore from 'stores/alerting/policy'

@withList({
store: new PolicyStore('node'),
module: 'alerting-policy',
module: 'alert-policies',
name: 'Alerting Policy',
authKey: 'alerting',
})
export default class AlertingPolicy extends React.Component {
get tips() {
Expand Down
138 changes: 0 additions & 138 deletions src/pages/fedprojects/containers/Alerting/Messages/Detail/index.jsx

This file was deleted.

This file was deleted.

Loading

0 comments on commit 068ba3e

Please sign in to comment.