feat(xo-web/vm/tab-advanced): ability to set the NIC type (#3440)
Fixes #3423
This commit is contained in:
parent
e0ecbab841
commit
6ca09dc9fe
@ -12,6 +12,7 @@
|
|||||||
- [VM] Display the PVHVM status [#3014](https://github.com/vatesfr/xen-orchestra/issues/3014) (PR [#3418](https://github.com/vatesfr/xen-orchestra/pull/3418))
|
- [VM] Display the PVHVM status [#3014](https://github.com/vatesfr/xen-orchestra/issues/3014) (PR [#3418](https://github.com/vatesfr/xen-orchestra/pull/3418))
|
||||||
- [Backup reports] Ability to test the plugin (PR [#3421](https://github.com/vatesfr/xen-orchestra/pull/3421))
|
- [Backup reports] Ability to test the plugin (PR [#3421](https://github.com/vatesfr/xen-orchestra/pull/3421))
|
||||||
- [Backup NG] Ability to restart failed VMs' backup [#3339](https://github.com/vatesfr/xen-orchestra/issues/3339) (PR [#3420](https://github.com/vatesfr/xen-orchestra/pull/3420))
|
- [Backup NG] Ability to restart failed VMs' backup [#3339](https://github.com/vatesfr/xen-orchestra/issues/3339) (PR [#3420](https://github.com/vatesfr/xen-orchestra/pull/3420))
|
||||||
|
- [VM] Ability to change the NIC type [#3423](https://github.com/vatesfr/xen-orchestra/issues/3423) (PR [#3440](https://github.com/vatesfr/xen-orchestra/pull/3440))
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
|
@ -1018,6 +1018,7 @@ const messages = {
|
|||||||
vmAffinityHost: 'Affinity host',
|
vmAffinityHost: 'Affinity host',
|
||||||
vmVga: 'VGA',
|
vmVga: 'VGA',
|
||||||
vmVideoram: 'Video RAM',
|
vmVideoram: 'Video RAM',
|
||||||
|
vmNicType: 'NIC type',
|
||||||
noAffinityHost: 'None',
|
noAffinityHost: 'None',
|
||||||
originalTemplate: 'Original template',
|
originalTemplate: 'Original template',
|
||||||
unknownOsName: 'Unknown',
|
unknownOsName: 'Unknown',
|
||||||
|
@ -8,12 +8,12 @@ import React from 'react'
|
|||||||
import renderXoItem from 'render-xo-item'
|
import renderXoItem from 'render-xo-item'
|
||||||
import TabButton from 'tab-button'
|
import TabButton from 'tab-button'
|
||||||
import Tooltip from 'tooltip'
|
import Tooltip from 'tooltip'
|
||||||
import { Toggle } from 'form'
|
|
||||||
import { Number, Size, Text, XoSelect } from 'editable'
|
|
||||||
import { Container, Row, Col } from 'grid'
|
|
||||||
import { SelectResourceSet, SelectVgpuType } from 'select-objects'
|
|
||||||
import { confirm } from 'modal'
|
|
||||||
import { assign, every, find, includes, isEmpty, map, uniq } from 'lodash'
|
import { assign, every, find, includes, isEmpty, map, uniq } from 'lodash'
|
||||||
|
import { confirm } from 'modal'
|
||||||
|
import { Container, Row, Col } from 'grid'
|
||||||
|
import { Number, Size, Text, XoSelect } from 'editable'
|
||||||
|
import { Select, Toggle } from 'form'
|
||||||
|
import { SelectResourceSet, SelectVgpuType } from 'select-objects'
|
||||||
import {
|
import {
|
||||||
addSubscriptions,
|
addSubscriptions,
|
||||||
connectStore,
|
connectStore,
|
||||||
@ -280,6 +280,17 @@ class CoresPerSocket extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const NIC_TYPE_OPTIONS = [
|
||||||
|
{
|
||||||
|
label: 'Realtek RTL819',
|
||||||
|
value: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Intel e1000',
|
||||||
|
value: 'e1000',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
@connectStore(() => {
|
@connectStore(() => {
|
||||||
const getVgpus = createGetObjectsOfType('vgpu').pick((_, { vm }) => vm.$VGPUs)
|
const getVgpus = createGetObjectsOfType('vgpu').pick((_, { vm }) => vm.$VGPUs)
|
||||||
const getGpuGroup = createGetObjectsOfType('gpuGroup').pick(
|
const getGpuGroup = createGetObjectsOfType('gpuGroup').pick(
|
||||||
@ -297,6 +308,9 @@ export default class TabAdvanced extends Component {
|
|||||||
getVmsHaValues().then(vmsHaValues => this.setState({ vmsHaValues }))
|
getVmsHaValues().then(vmsHaValues => this.setState({ vmsHaValues }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onNicTypeChange = value =>
|
||||||
|
editVm(this.props.vm, { nicType: value === '' ? null : value })
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { container, isAdmin, vgpus, vm } = this.props
|
const { container, isAdmin, vgpus, vm } = this.props
|
||||||
return (
|
return (
|
||||||
@ -488,6 +502,20 @@ export default class TabAdvanced extends Component {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
|
<tr>
|
||||||
|
<th>{_('vmNicType')}</th>
|
||||||
|
<td>
|
||||||
|
<Select
|
||||||
|
labelKey='label'
|
||||||
|
onChange={this._onNicTypeChange}
|
||||||
|
options={NIC_TYPE_OPTIONS}
|
||||||
|
required
|
||||||
|
simpleValue
|
||||||
|
value={vm.nicType || ''}
|
||||||
|
valueKey='value'
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{vm.virtualizationMode === 'hvm' && (
|
{vm.virtualizationMode === 'hvm' && (
|
||||||
<tr>
|
<tr>
|
||||||
<th>{_('vmVga')}</th>
|
<th>{_('vmVga')}</th>
|
||||||
|
Loading…
Reference in New Issue
Block a user