File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1616// under the License.
1717
1818<template >
19- <div class =" form-layout" v-ctrl-enter = " handleSubmit " >
19+ <div class =" form-layout" >
2020 <a-spin :spinning =" loading" >
2121 <a-alert type =" warning" >
2222 <template #message >{{ $t('message.action.start.instance') }}</template >
9393 <template #label >
9494 <tooltip-label :title =" $t('label.considerlasthost')" :tooltip =" apiParams.considerlasthost.description" />
9595 </template >
96- <a-switch v-model:checked =" form.considerlasthost" />
96+ <a-switch v-model:checked =" form.considerlasthost" v-focus = " true " />
9797 </a-form-item >
9898 </div >
9999
@@ -151,6 +151,12 @@ export default {
151151 this .fetchHosts ()
152152 }
153153 },
154+ mounted () {
155+ document .addEventListener (' keydown' , this .handleKeyPress )
156+ },
157+ beforeUnmount () {
158+ document .removeEventListener (' keydown' , this .handleKeyPress )
159+ },
154160 methods: {
155161 initForm () {
156162 this .formRef = ref ()
@@ -264,6 +270,12 @@ export default {
264270 },
265271 closeAction () {
266272 this .$emit (' close-action' )
273+ },
274+ handleKeyPress (event ) {
275+ event .preventDefault ()
276+ if ((event .code === ' Enter' || event .code === ' NumpadEnter' ) && event .ctrlKey === true ) {
277+ this .handleSubmit (event )
278+ }
267279 }
268280 }
269281}
You can’t perform that action at this time.
0 commit comments