feat(dashboard): fix power test and remove users link for non-admins (#2111)
Fixes #2108
This commit is contained in:
committed by
Julien Fontanet
parent
6d06e1f89d
commit
155edf5533
@@ -818,7 +818,7 @@ var messages = {
|
|||||||
srFree: 'free',
|
srFree: 'free',
|
||||||
srUsageStatePanel: 'Storage Usage',
|
srUsageStatePanel: 'Storage Usage',
|
||||||
srTopUsageStatePanel: 'Top 5 SR Usage (in %)',
|
srTopUsageStatePanel: 'Top 5 SR Usage (in %)',
|
||||||
vmsStates: '{running} running ({halted} halted)',
|
vmsStates: '{running, number} running ({halted, number} halted)',
|
||||||
dashboardStatsButtonRemoveAll: 'Clear selection',
|
dashboardStatsButtonRemoveAll: 'Clear selection',
|
||||||
dashboardStatsButtonAddAllHost: 'Add all hosts',
|
dashboardStatsButtonAddAllHost: 'Add all hosts',
|
||||||
dashboardStatsButtonAddAllVM: 'Add all VMs',
|
dashboardStatsButtonAddAllVM: 'Add all VMs',
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ import {
|
|||||||
createGetObjectsOfType,
|
createGetObjectsOfType,
|
||||||
createGetHostMetrics,
|
createGetHostMetrics,
|
||||||
createSelector,
|
createSelector,
|
||||||
createTop
|
createTop,
|
||||||
|
isAdmin
|
||||||
} from 'selectors'
|
} from 'selectors'
|
||||||
import {
|
import {
|
||||||
connectStore,
|
connectStore,
|
||||||
@@ -136,6 +137,7 @@ class PatchesCard extends Component {
|
|||||||
return {
|
return {
|
||||||
hostMetrics: getHostMetrics,
|
hostMetrics: getHostMetrics,
|
||||||
hosts: getHosts,
|
hosts: getHosts,
|
||||||
|
isAdmin,
|
||||||
nAlarmMessages: getNumberOfAlarmMessages,
|
nAlarmMessages: getNumberOfAlarmMessages,
|
||||||
nHosts: getNumberOfHosts,
|
nHosts: getNumberOfHosts,
|
||||||
nPools: getNumberOfPools,
|
nPools: getNumberOfPools,
|
||||||
@@ -306,7 +308,10 @@ export default class Overview extends Component {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardBlock>
|
<CardBlock>
|
||||||
<p className={styles.bigCardContent}>
|
<p className={styles.bigCardContent}>
|
||||||
<Link to='/settings/users'>{nUsers}</Link>
|
{props.isAdmin
|
||||||
|
? <Link to='/settings/users'>{nUsers}</Link>
|
||||||
|
: <p>{nUsers}</p>
|
||||||
|
}
|
||||||
</p>
|
</p>
|
||||||
</CardBlock>
|
</CardBlock>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user