feat(xo-web/storage): display SR used for the HA state files (#6384)

Fixes #6339
This commit is contained in:
Mathieu 2022-08-29 17:02:50 +02:00 committed by GitHub
parent 276d1ce60a
commit 4dc7575d5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 2 deletions

View File

@ -7,6 +7,8 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Home/Storage] Show which SRs are used for HA state files [#6339](https://github.com/vatesfr/xen-orchestra/issues/6339) (PR [#6384](https://github.com/vatesfr/xen-orchestra/pull/6384))
### Bug fixes
> Users must be able to say: “I had this issue, happy to know it's fixed”
@ -37,6 +39,6 @@
- xen-api patch
- xo-vmdk-to-vhd patch
- xo-server minor
- xo-web patch
- xo-web minor
<!--packages-end-->

View File

@ -107,6 +107,7 @@ const TRANSFORMS = {
current_operations: obj.current_operations,
default_SR: link(obj, 'default_SR'),
HA_enabled: Boolean(obj.ha_enabled),
haSrs: obj.$ha_statefiles.map(vdi => link(vdi, 'SR')),
master: link(obj, 'master'),
tags: obj.tags,
name_description: obj.name_description,

View File

@ -1280,6 +1280,7 @@ const messages = {
protectFromDeletion: 'Protect from accidental deletion',
protectFromShutdown: 'Protect from accidental shutdown',
ha: 'HA',
srHaTooltip: 'SR used for High Availability',
nestedVirt: 'Nested virtualization',
vmAffinityHost: 'Affinity host',
vmVga: 'VGA',

View File

@ -18,6 +18,11 @@ import styles from './index.css'
@connectStore({
container: createGetObject((_, props) => props.item.$container),
isHa: createSelector(
(_, props) => props.item,
createGetObject((_, props) => props.item.$poolId),
(sr, pool) => pool.haSrs.includes(sr.id)
),
isDefaultSr: createSelector(
createGetObjectsOfType('pool').find((_, props) => pool => props.item.$pool === pool.id),
(_, props) => props.item,
@ -97,7 +102,7 @@ export default class SrItem extends Component {
}
render() {
const { container, expandAll, isDefaultSr, isShared, item: sr, selected } = this.props
const { container, expandAll, isDefaultSr, isHa, isShared, item: sr, selected } = this.props
return (
<div className={styles.item}>
@ -113,6 +118,11 @@ export default class SrItem extends Component {
<Text value={sr.name_label} onChange={this._setNameLabel} useLongClick />
</Ellipsis>
{isDefaultSr && <span className='tag tag-pill tag-info ml-1'>{_('defaultSr')}</span>}
{isHa && (
<Tooltip content={_('srHaTooltip')}>
<span className='tag tag-pill tag-info ml-1'>{_('ha')}</span>
</Tooltip>
)}
{sr.inMaintenanceMode && <span className='tag tag-pill tag-warning ml-1'>{_('maintenanceMode')}</span>}
</EllipsisContainer>
</Col>