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

fix(xo-web/pool/advanced): show backup/migration network even when deleted #7303

Merged
merged 8 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [Jobs] Reset parameters when editing method to avoid invalid parameters on execution [Forum#69299](https://xcp-ng.org/forum/post/69299)
- [Metadata Backup] Fix `ENOENT` error when restoring an _XO Config_ backup [Forum#68999](https://xcp-ng.org/forum/post/68999)
- [REST API] Fix `/backup/log/<id>` which was broken by the `/backups` to `/backup` renaming [Forum#69426](https://xcp-ng.org/forum/post/69426)
- [Pool/Advanced] Show pool backup/migration network even if they no longer exist (PR [#7303](https://github.com/vatesfr/xen-orchestra/pull/7303))

### Packages to release

Expand Down
1 change: 1 addition & 0 deletions packages/xo-web/src/common/intl/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ const messages = {
// ----- Pool advanced tab -----
backupNetwork: 'Backup network',
crashDumpSr: 'Crash dump SR',
networkIdMissing: '{networkID} no longer exists, please select a new one',
MathieuRA marked this conversation as resolved.
Show resolved Hide resolved
poolEditAll: 'Edit all',
poolHaStatus: 'High Availability',
poolHaEnabled: 'Enabled',
Expand Down
25 changes: 23 additions & 2 deletions packages/xo-web/src/xo-app/pool/tab-advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import _, { messages } from 'intl'
import ActionButton from 'action-button'
import ActionRowButton from 'action-row-button'
import Component from 'base-component'
import Copiable from 'copiable'
import Icon from 'icon'
import renderXoItem, { Network, Sr } from 'render-xo-item'
import SelectFiles from 'select-files'
Expand Down Expand Up @@ -440,7 +441,17 @@ export default class TabAdvanced extends Component {
value={migrationNetwork}
xoType='network'
>
{migrationNetwork !== undefined ? <Network id={migrationNetwork.id} /> : _('noValue')}
{pool.otherConfig['xo:migrationNetwork'] === undefined ? (
_('noValue')
) : migrationNetwork !== undefined ? (
<Network id={migrationNetwork.id} />
) : (
<span className='text-danger'>
{_('networkIdMissing', {
networkID: <Copiable>{pool.otherConfig['xo:migrationNetwork']}</Copiable>,
MathieuRA marked this conversation as resolved.
Show resolved Hide resolved
})}
</span>
)}
MathieuRA marked this conversation as resolved.
Show resolved Hide resolved
</XoSelect>{' '}
{migrationNetwork !== undefined && (
<a role='button' onClick={this._removeMigrationNetwork}>
Expand All @@ -458,7 +469,17 @@ export default class TabAdvanced extends Component {
value={backupNetwork}
xoType='network'
>
{backupNetwork !== undefined ? <Network id={backupNetwork.id} /> : _('noValue')}
{pool.otherConfig['xo:backupNetwork'] === undefined ? (
_('noValue')
) : backupNetwork !== undefined ? (
<Network id={backupNetwork.id} />
) : (
<span className='text-danger'>
{_('networkIdMissing', {
networkID: <Copiable>{pool.otherConfig['xo:backupNetwork']}</Copiable>,
})}
</span>
)}
</XoSelect>{' '}
{backupNetwork !== undefined && (
<a role='button' onClick={this._removeBackupNetwork}>
Expand Down
Loading