Skip to content

Commit

Permalink
feat(xo-web): edit default SR in pool advanced tab
Browse files Browse the repository at this point in the history
  • Loading branch information
b-Nollet committed Mar 7, 2024
1 parent 5536053 commit 775833d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [VM Creation] Automatically create a VTPM if the template requests it (Windows templates starting from XCP-ng 8.3) (PR [#7436](https://github.com/vatesfr/xen-orchestra/pull/7436))
- [Pool/Advanced] Default SR can now be configured from the pool advanced tab [#7414](https://github.com/vatesfr/xen-orchestra/issues/7414) (PR [#7451](https://github.com/vatesfr/xen-orchestra/pull/7451))

### Bug fixes

Expand Down
24 changes: 24 additions & 0 deletions packages/xo-web/src/xo-app/pool/tab-advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
installSupplementalPackOnAllHosts,
isSrWritable,
rollingPoolReboot,
setDefaultSr,
setHostsMultipathing,
setPoolMaster,
setRemoteSyslogHost,
Expand Down Expand Up @@ -192,6 +193,23 @@ class PoolMaster extends Component {
}
}

@connectStore(() => ({
defaultSr: createGetObject((_, { pool }) => pool.default_SR),
}))
class SelectDefaultSr extends Component {
_onChange = sr => setDefaultSr(sr)

render() {
const { pool, defaultSr } = this.props

return (
<XoSelect onChange={this._onChange} value={pool.default_SR} xoType='SR'>
{defaultSr.name_label}
</XoSelect>
)
}
}

@injectIntl
@connectStore(() => {
const getHosts = createGetObjectsOfType('host')
Expand Down Expand Up @@ -371,6 +389,12 @@ export default class TabAdvanced extends Component {
)}
</td>
</tr>
<tr>
<th>{_('defaultSr')}</th>
<td>
<SelectDefaultSr pool={pool} />
</td>
</tr>
<tr>
<th>{_('suspendSr')}</th>
<td>
Expand Down

0 comments on commit 775833d

Please sign in to comment.