feat(xo-web/vm/new disk): generate random name (#5828)

This commit is contained in:
Pierre Donias 2021-06-28 11:26:09 +02:00 committed by GitHub
parent bbd571e311
commit 3d15a73f1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -8,6 +8,7 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [VM/snapshots] Identify VM's current snapshot with an icon next to the snapshot's name (PR [#5824](https://github.com/vatesfr/xen-orchestra/pull/5824))
- [VM/new disk] Auto-fill disk name input with generated unique name (PR [#5828](https://github.com/vatesfr/xen-orchestra/pull/5828))
### Bug fixes

View File

@ -30,6 +30,7 @@ import {
createCompare,
createCompareContainers,
formatSize,
generateReadableRandomString,
noop,
resolveResourceSet,
} from 'utils'
@ -205,6 +206,10 @@ class NewDisk extends Component {
vm: PropTypes.object.isRequired,
}
state = {
name: `${this.props.vm.name_label}_${generateReadableRandomString(5)}`,
}
_createDisk = () => {
const { vm, onClose = noop } = this.props
const { bootable, name, readOnly, size, sr } = this.state