mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix ctrl-enter on vm start dialog (#9743)
Co-authored-by: Lucas Martins <lucas.martins@scclouds.com.br>
This commit is contained in:
parent
f7b7339bcf
commit
8608f28842
@ -16,7 +16,7 @@
|
||||
// under the License.
|
||||
|
||||
<template>
|
||||
<div class="form-layout" v-ctrl-enter="handleSubmit">
|
||||
<div class="form-layout">
|
||||
<a-spin :spinning="loading">
|
||||
<a-alert type="warning">
|
||||
<template #message>{{ $t('message.action.start.instance') }}</template>
|
||||
@ -93,7 +93,7 @@
|
||||
<template #label>
|
||||
<tooltip-label :title="$t('label.considerlasthost')" :tooltip="apiParams.considerlasthost.description"/>
|
||||
</template>
|
||||
<a-switch v-model:checked="form.considerlasthost" />
|
||||
<a-switch v-model:checked="form.considerlasthost" v-focus="true"/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
|
||||
@ -151,6 +151,12 @@ export default {
|
||||
this.fetchHosts()
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
document.addEventListener('keydown', this.handleKeyPress)
|
||||
},
|
||||
beforeUnmount () {
|
||||
document.removeEventListener('keydown', this.handleKeyPress)
|
||||
},
|
||||
methods: {
|
||||
initForm () {
|
||||
this.formRef = ref()
|
||||
@ -264,6 +270,12 @@ export default {
|
||||
},
|
||||
closeAction () {
|
||||
this.$emit('close-action')
|
||||
},
|
||||
handleKeyPress (event) {
|
||||
event.preventDefault()
|
||||
if ((event.code === 'Enter' || event.code === 'NumpadEnter') && event.ctrlKey === true) {
|
||||
this.handleSubmit(event)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user