feat(xo-web/host/network): button to scan PIFs

Fixes #5230
This commit is contained in:
Julien Fontanet 2020-08-27 11:42:28 +02:00
parent 15bc30a2d5
commit 1256c320e3
4 changed files with 31 additions and 1 deletions

View File

@ -9,6 +9,7 @@
- [Health/Orphan VDIs] Improve heuristic and list both VDI snapshots and normal VDIs (PR [#5228](https://github.com/vatesfr/xen-orchestra/pull/5228))
- [VM/Console] Hide missing ISOs in selector [#5222](https://github.com/vatesfr/xen-orchestra/issues/5222)
- [Host/Network] Button to refresh the list of physical interfaces [#5230](https://github.com/vatesfr/xen-orchestra/issues/5230)
### Bug fixes

View File

@ -298,3 +298,19 @@ isHyperThreadingEnabled.params = {
isHyperThreadingEnabled.resolve = {
host: ['id', 'host', 'administrate'],
}
// -------------------------------------------------------------------
export async function scanPifs({ host }) {
await this.getXapi(host).callAsync('PIF.scan', host._xapiRef)
}
scanPifs.description = 'Refresh the list of physical interfaces for this host'
scanPifs.params = {
id: { type: 'string' },
}
scanPifs.resolve = {
host: ['id', 'host', 'administrate'],
}

View File

@ -1907,6 +1907,8 @@ export const getIpv4ConfigModes = () => _call('pif.getIpv4ConfigurationModes')
export const editPif = (pif, { vlan }) =>
_call('pif.editPif', { pif: resolveId(pif), vlan })
export const scanHostPifs = hostId => _call('host.scanPifs', { host: hostId })
// SR ----------------------------------------------------------------
export const deleteSr = sr =>

View File

@ -27,6 +27,7 @@ import {
editPif,
getIpv4ConfigModes,
reconfigurePifIp,
scanHostPifs,
} from 'xo'
const EDIT_BUTTON_STYLE = { color: '#999', cursor: 'pointer' }
@ -372,7 +373,17 @@ export default ({ host, networks, pifs, privateNetworks }) => (
<Container>
<Row>
<Col>
<h1>{_('poolNetworkPif')}</h1>
<h1>
{_('poolNetworkPif')}
<ActionButton
className='ml-1'
handler={scanHostPifs}
handlerParam={host.id}
icon='refresh'
>
{_('refresh')}
</ActionButton>
</h1>
<SortedTable
collection={pifs}
columns={PIF_COLUMNS}