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 e14ce22 commit 28871ef
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 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,25 @@ class PoolMaster extends Component {
}
}

@connectStore(() => ({
defaultSr: createGetObjectsOfType('SR').find((_, { pool }) => ({
id: 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 +391,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 28871ef

Please sign in to comment.