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.
|
// under the License.
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="form-layout" v-ctrl-enter="handleSubmit">
|
<div class="form-layout">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-alert type="warning">
|
<a-alert type="warning">
|
||||||
<template #message>{{ $t('message.action.start.instance') }}</template>
|
<template #message>{{ $t('message.action.start.instance') }}</template>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<tooltip-label :title="$t('label.considerlasthost')" :tooltip="apiParams.considerlasthost.description"/>
|
<tooltip-label :title="$t('label.considerlasthost')" :tooltip="apiParams.considerlasthost.description"/>
|
||||||
</template>
|
</template>
|
||||||
<a-switch v-model:checked="form.considerlasthost" />
|
<a-switch v-model:checked="form.considerlasthost" v-focus="true"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -151,6 +151,12 @@ export default {
|
|||||||
this.fetchHosts()
|
this.fetchHosts()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
document.addEventListener('keydown', this.handleKeyPress)
|
||||||
|
},
|
||||||
|
beforeUnmount () {
|
||||||
|
document.removeEventListener('keydown', this.handleKeyPress)
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initForm () {
|
initForm () {
|
||||||
this.formRef = ref()
|
this.formRef = ref()
|
||||||
@ -264,6 +270,12 @@ export default {
|
|||||||
},
|
},
|
||||||
closeAction () {
|
closeAction () {
|
||||||
this.$emit('close-action')
|
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