Skip to content

Commit 15a05fa

Browse files
fix: add Enter key support to login and exclude Windows from Unix tests
Part 1: Login UX Enhancement - Add form submission on Enter key press - Auto-focus username field on page load - Add @pressEnter handlers to both input fields - Import ref and onMounted from Vue composition API Part 2: Windows Build Fix - Add build tags to limits_test.go to exclude from Windows builds - Fixes golang.org/x/sys/unix import error on Windows - Aligns with existing limits.go build constraints Tested on Windows 11: - Go 1.24.6: Build succeeds without errors - Chrome/Edge: Enter key and auto-focus work correctly Fixes #1405
1 parent dc5eb0d commit 15a05fa

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

pkg/common/util/os/limits_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build !windows
2+
// +build !windows
3+
14
/*
25
* Licensed to the Apache Software Foundation (ASF) under one or more
36
* contributor license agreements. See the NOTICE file distributed with

ui-vue3/src/Login.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717

1818
<script setup lang="ts">
19-
import { reactive } from 'vue'
19+
import { reactive, ref, onMounted } from 'vue'
2020
import { login } from '@/api/service/login'
2121
import { useRoute, useRouter } from 'vue-router'
2222
import { updateAuthState } from '@/utils/AuthUtil'
@@ -34,6 +34,12 @@ const route = useRoute()
3434
const redirect: any = route.query.redirect || '/'
3535
const meshStore = useMeshStore()
3636
37+
const usernameInputRef = ref()
38+
39+
onMounted(() => {
40+
usernameInputRef.value?.focus()
41+
})
42+
3743
function loginHandle() {
3844
let formData = new FormData()
3945
formData.append('user', userinfo.username)
@@ -68,15 +74,23 @@ function loginHandle() {
6874
name="username"
6975
:rules="[{ required: true }]"
7076
>
71-
<a-input type="" v-model:value="userinfo.username"></a-input>
77+
<a-input
78+
ref="usernameInputRef"
79+
v-model:value="userinfo.username"
80+
@pressEnter="loginHandle"
81+
></a-input>
7282
</a-form-item>
7383
<a-form-item
7484
class="item"
7585
:label="$t('loginDomain.password')"
7686
name="password"
7787
:rules="[{ required: true }]"
7888
>
79-
<a-input type="password" v-model:value="userinfo.password"></a-input>
89+
<a-input
90+
type="password"
91+
v-model:value="userinfo.password"
92+
@pressEnter="loginHandle"
93+
></a-input>
8094
</a-form-item>
8195
<a-form-item class="item" label="">
8296
<a-button @click="loginHandle" size="large" type="primary" class="login-btn"

0 commit comments

Comments
 (0)