Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(xo-web): edit default SR in pool advanced tab #7451

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
MathieuRA marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [Plugin/load-balancer] A parameter was added in performance mode to balance VMs on hosts depending on their number of vCPUs, when it does not cause performance issues [#5389](https://github.com/vatesfr/xen-orchestra/issues/5389) (PR [#7333](https://github.com/vatesfr/xen-orchestra/pull/7333))
- [Pool/Network] Automatically update network interfaces when network MTU is changed [Forum#8133](https://xcp-ng.org/forum/topic/8133/set-host-network-mtu-in-xen-orchestra) (PR [#7443](https://github.com/vatesfr/xen-orchestra/pull/7443)).
- [App] Implement the initial PWA manifest for Xen Orchestra 5 (PR [#7462](https://github.com/vatesfr/xen-orchestra/pull/7462)).
- [Pool/Advanced] Default SR can now also be configured from the pool's _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
22 changes: 22 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,21 @@ class PoolMaster extends Component {
}
}

@connectStore(() => ({
defaultSr: createGetObject((_, { pool }) => pool.default_SR),
}))
class SelectDefaultSr extends Component {
render() {
const { defaultSr } = this.props

return (
<XoSelect onChange={setDefaultSr} value={defaultSr.id} xoType='SR'>
<Sr id={defaultSr.id} />
</XoSelect>
)
}
}

@injectIntl
@connectStore(() => {
const getHosts = createGetObjectsOfType('host')
Expand Down Expand Up @@ -371,6 +387,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
Loading