feat(xo-web/host/advanced): add button to disable/enable host (#5952)
This commit is contained in:
parent
07cc4c853d
commit
268fb22d5f
@ -9,6 +9,7 @@
|
||||
|
||||
- [Tasks] Filter out short tasks using a default filter (PR [#5921](https://github.com/vatesfr/xen-orchestra/pull/5921))
|
||||
- [Jobs] Ability to copy a job ID (PR [#5951](https://github.com/vatesfr/xen-orchestra/pull/5951))
|
||||
- [Host/advanced] Add button to enable/disable the host (PR [#5952](https://github.com/vatesfr/xen-orchestra/pull/5952))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
@ -1751,6 +1751,8 @@ const messages = {
|
||||
disconnectVbdsModalTitle: 'Disconnect VBD{nVbds, plural, one {} other {s}}',
|
||||
disconnectVbdsModalMessage:
|
||||
'Are you sure you want to disconnect {nVbds, number} VBD{nVbds, plural, one {} other {s}}?',
|
||||
disableHost: 'Disable host',
|
||||
disableHostModalMessage: 'Are you sure you want to disable {host}? This will prevent new VMs from starting.',
|
||||
revertVmModalMessage:
|
||||
'Are you sure you want to revert this VM to the snapshot state? This operation is irreversible.',
|
||||
revertVmModalSnapshotBefore: 'Snapshot before',
|
||||
|
@ -674,6 +674,15 @@ export const detachHost = host =>
|
||||
}),
|
||||
}).then(() => _call('host.detach', { host: host.id }))
|
||||
|
||||
export const disableHost = host =>
|
||||
confirm({
|
||||
icon: 'host-disable',
|
||||
title: _('disableHost'),
|
||||
body: _('disableHostModalMessage', {
|
||||
host: <strong>{host.name_label}</strong>,
|
||||
}),
|
||||
}).then(() => _call('host.disable', { host: resolveId(host) }))
|
||||
|
||||
export const forgetHost = host =>
|
||||
confirm({
|
||||
icon: 'host-forget',
|
||||
@ -683,6 +692,8 @@ export const forgetHost = host =>
|
||||
}),
|
||||
}).then(() => _call('host.forget', { host: resolveId(host) }))
|
||||
|
||||
export const enableHost = host => _call('host.enable', { host: resolveId(host) })
|
||||
|
||||
export const setDefaultSr = sr => _call('pool.setDefaultSr', { sr: resolveId(sr) })
|
||||
|
||||
export const setPoolMaster = host =>
|
||||
|
@ -23,8 +23,10 @@ import { Text } from 'editable'
|
||||
import { Toggle, Select, SizeInput } from 'form'
|
||||
import {
|
||||
detachHost,
|
||||
disableHost,
|
||||
editHost,
|
||||
enableAdvancedLiveTelemetry,
|
||||
enableHost,
|
||||
forgetHost,
|
||||
installSupplementalPack,
|
||||
isHyperThreadingEnabledHost,
|
||||
@ -278,6 +280,24 @@ export default class extends Component {
|
||||
labelId='disableMaintenanceMode'
|
||||
/>
|
||||
)}
|
||||
{host.enabled ? (
|
||||
<TabButton
|
||||
btnStyle='warning'
|
||||
handler={disableHost}
|
||||
handlerParam={host}
|
||||
icon='host-forget'
|
||||
labelId='disableHostLabel'
|
||||
/>
|
||||
) : (
|
||||
<TabButton
|
||||
btnStyle='success'
|
||||
handler={enableHost}
|
||||
handlerParam={host}
|
||||
icon='host-enable'
|
||||
labelId='enableHostLabel'
|
||||
/>
|
||||
)}
|
||||
|
||||
<TabButton
|
||||
btnStyle='danger'
|
||||
handler={detachHost}
|
||||
|
Loading…
Reference in New Issue
Block a user