Skip to content

Commit

Permalink
fix: Fix cluster log collection
Browse files Browse the repository at this point in the history
  • Loading branch information
leoliu committed Jun 29, 2020
1 parent 6cebd91 commit 30afbfe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion server/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ client:
name: log-collections,
title: Log Collections,
icon: file,
authKey: logging,
authKey: logging|events|auditing,
clusterModule: logging,
}

Expand Down
24 changes: 13 additions & 11 deletions src/components/Base/RadioGroup/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,19 @@ export default class RadioGroupWithOptions extends React.Component {
size="small"
{...rest}
>
{options.map(option => (
<RadioButton key={option.value} value={option.value}>
{option.label}
{!isUndefined(option.count) && (
<Badge
status={option.value === value ? 'success' : 'default'}
count={Number(option.count)}
/>
)}
</RadioButton>
))}
{options
.filter(option => !option.hidden)
.map(option => (
<RadioButton key={option.value} value={option.value}>
{option.label}
{!isUndefined(option.count) && (
<Badge
status={option.value === value ? 'success' : 'default'}
count={Number(option.count)}
/>
)}
</RadioButton>
))}
</RadioGroup>
)
}
Expand Down
3 changes: 3 additions & 0 deletions src/pages/clusters/containers/LogCollections/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,17 @@ export default class LogCollection extends React.Component {
{
value: 'logging',
label: t('Logging'),
hidden: !globals.app.hasClusterModule(this.cluster, 'logging'),
},
{
value: 'events',
label: t('Events'),
hidden: !globals.app.hasClusterModule(this.cluster, 'events'),
},
{
value: 'auditing',
label: t('Auditing'),
hidden: !globals.app.hasClusterModule(this.cluster, 'auditing'),
},
],
}
Expand Down

0 comments on commit 30afbfe

Please sign in to comment.