diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 1f96a0d7d84..1ab005e4bf6 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -20,6 +20,7 @@ - `rest post` and `rest put` now accept `--input $file` to upload a file and display progress information - [Backup] Detect invalid VDI exports that are incorrectly reported as successful by XAPI - [Backup] Backup job sequences: configure lists of backup jobs to run in order one after the other (PRs [#7985](https://github.com/vatesfr/xen-orchestra/pull/7985), [#8014](https://github.com/vatesfr/xen-orchestra/pull/8014)) +- [Pool/Network] Display the bond mode of a network [#7802](https://github.com/vatesfr/xen-orchestra/issues/7802) (PR [#8010](https://github.com/vatesfr/xen-orchestra/pull/8010)) ### Bug fixes diff --git a/packages/xo-server/src/xapi-object-to-xo.mjs b/packages/xo-server/src/xapi-object-to-xo.mjs index 39440601a53..9f3272d1b7f 100644 --- a/packages/xo-server/src/xapi-object-to-xo.mjs +++ b/packages/xo-server/src/xapi-object-to-xo.mjs @@ -957,6 +957,16 @@ const TRANSFORMS = { VUSBs: link(obj, 'VUSBs'), } }, + + // ----------------------------------------------------------------- + + bond(obj) { + return { + type: 'bond', + master: link(obj, 'master'), + mode: obj.mode, + } + }, } // =================================================================== diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js index 5a574050983..c785e2b6f37 100644 --- a/packages/xo-web/src/common/intl/messages.js +++ b/packages/xo-web/src/common/intl/messages.js @@ -973,6 +973,7 @@ const messages = { noHost: 'No hosts', memoryLeftTooltip: '{used}% used ({free} free)', // ----- Pool network tab ----- + bondMode: 'Bond Mode', pif: 'PIF', poolNetworkAutomatic: 'Automatic', poolNetworkNameLabel: 'Name', diff --git a/packages/xo-web/src/common/sorted-table/pifs-column.js b/packages/xo-web/src/common/sorted-table/pifs-column.js index ab9420b0983..7c6662b3bf7 100644 --- a/packages/xo-web/src/common/sorted-table/pifs-column.js +++ b/packages/xo-web/src/common/sorted-table/pifs-column.js @@ -8,7 +8,7 @@ import map from 'lodash/map' import React, { Component } from 'react' import Tooltip from 'tooltip' import { connectStore } from 'utils' -import { createGetObject, createSelector } from 'selectors' +import { createGetObject, createGetObjectsOfType, createSelector } from 'selectors' import { connectPif, disconnectPif } from 'xo' @connectStore(() => { @@ -19,11 +19,14 @@ import { connectPif, disconnectPif } from 'xo' pif => pif?.attached && !pif?.isBondMaster && (pif?.management || pif?.disallowUnplug) ) - return { host, pif, disableUnplug } + const bonds = createGetObjectsOfType('bond') + const bond = createSelector(pif, bonds, (pif, bonds) => Object.values(bonds).find(bond => bond.master === pif.id)) + + return { host, pif, disableUnplug, bond } }) class PifItem extends Component { render() { - const { pif, host, disableUnplug } = this.props + const { pif, host, disableUnplug, bond } = this.props return ( @@ -31,6 +34,7 @@ class PifItem extends Component { {host?.name_label ?? _('unknown')} {pif?.ip ?? _('unknown')} {pif?.mac ?? _('unknown')} + {bond?.mode ?? '-'} {pif?.carrier === undefined ? ( {_('unknown')} @@ -78,6 +82,7 @@ export default class PifsColumn extends BaseComponent { {_('homeTypeHost')} {_('pifAddressLabel')} {_('pifMacLabel')} + {_('bondMode')} {_('pifStatusLabel')}