Skip to content

Commit 52e737c

Browse files
committed
fix: update login settings UI and improve localization for verification code messages
1 parent 80da909 commit 52e737c

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

ui/src/locales/lang/en-US/views/system.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ export default {
131131
management: 'management',
132132
},
133133
default_login: 'Default Login Method',
134-
display_code: 'Display verification code when login fails',
134+
display_code: 'Account login verification code setting',
135+
loginFailed: 'Login failed',
136+
loginFailedMessage: 'Display verification code twice',
135137
display_codeTip: 'When the value is -1, the verification code is not displayed',
136138
time: 'Times',
137139
setting: 'Login Setting',

ui/src/locales/lang/zh-CN/views/system.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ export default {
132132
management: '管理',
133133
},
134134
default_login: '默认登录方式',
135-
display_code: '登录失败显示验证码',
135+
display_code: '账号登录验证码设置',
136+
loginFailed: '登录失败',
137+
loginFailedMessage: '次显示验证码',
136138
display_codeTip: '值为-1时,不显示验证码',
137139
time: '次',
138140
setting: '登录设置',

ui/src/locales/lang/zh-Hant/views/system.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ export default {
131131
management: '管理',
132132
},
133133
default_login: '預設登入方式',
134-
display_code: '登入失敗顯示驗證碼',
134+
display_code: '帳號登入驗證碼設定',
135+
loginFailed: '登入失敗',
136+
loginFailedMessage: '次顯示驗證碼',
135137
display_codeTip: '值為-1時,不顯示驗證碼',
136138
time: '次',
137139
setting: '登录設置',

ui/src/views/application-overview/xpack-component/XPackLimitDrawer.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
</el-checkbox-group>
117117
</el-form-item>
118118
<el-form-item
119+
v-if="form.authentication_value.type === 'login' && form.authentication_value?.login_value?.includes('LOCAL')"
119120
:label="$t('views.system.display_code')"
120121
:rules="[
121122
{
@@ -126,15 +127,22 @@
126127
]"
127128
prop="authentication_value.max_attempts"
128129
>
130+
<span style="font-size: 13px;">
131+
{{ $t('views.system.loginFailed') }}
132+
</span>
129133
<el-input-number
134+
style="margin-left: 8px;"
130135
v-model="form.authentication_value.max_attempts"
131136
:min="-1"
132137
:max="10"
133138
:step="1"
134139
controls-position="right"
135140
/>
141+
<span style="margin-left: 8px; font-size: 13px;">
142+
{{ $t('views.system.loginFailedMessage') }}
143+
</span>
136144
<span style="margin-left: 8px; color: #909399; font-size: 12px;">
137-
{{ $t('views.system.display_codeTip') }}
145+
({{ $t('views.system.display_codeTip') }})
138146
</span>
139147
</el-form-item>
140148
</el-card>
@@ -220,9 +228,6 @@ const open = (data: any) => {
220228
form.value.authentication_value = data.authentication_value || {
221229
type: 'password',
222230
}
223-
if (!form.value.authentication_value.max_attempts) {
224-
form.value.authentication_value.max_attempts = 1
225-
}
226231
if (
227232
form.value.authentication_value.type === 'password' &&
228233
!form.value.authentication_value.password_value
@@ -279,6 +284,9 @@ function firstGeneration() {
279284
type: 'password',
280285
password_value: generateAuthenticationValue(),
281286
}
287+
if (!form.value.authentication_value.max_attempts) {
288+
form.value.authentication_value.max_attempts = 1
289+
}
282290
}
283291
}
284292

ui/src/views/system-setting/authentication/component/Setting.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,22 @@
4040
]"
4141
prop="max_attempts"
4242
>
43+
<span style="font-size: 13px;">
44+
{{ $t('views.system.loginFailed') }}
45+
</span>
4346
<el-input-number
47+
style="margin-left: 8px;"
4448
v-model="form.max_attempts"
4549
:min="-1"
4650
:max="10"
4751
:step="1"
4852
controls-position="right"
4953
/>
54+
<span style="margin-left: 8px; font-size: 13px;">
55+
{{ $t('views.system.loginFailedMessage') }}
56+
</span>
5057
<span style="margin-left: 8px; color: #909399; font-size: 12px;">
51-
{{ $t('views.system.display_codeTip') }}
58+
({{ $t('views.system.display_codeTip') }})
5259
</span>
5360
</el-form-item>
5461
</el-form>

0 commit comments

Comments
 (0)