diff --git a/src/locales/en-US/common.ts b/src/locales/en-US/common.ts index f805a0d1..54d0c0ac 100644 --- a/src/locales/en-US/common.ts +++ b/src/locales/en-US/common.ts @@ -261,6 +261,10 @@ export default { 'common.login.auth': 'Authenticating...', 'common.login.auth.failed': 'Authentication failed', 'common.login.password': 'Log in with Password', + 'common.login.username.holder': 'Please enter username', + 'common.login.password.holder': 'Please enter password', + 'common.login.newpassword.holder': 'Please enter new password', + 'common.login.confirm.holder': 'Please enter password again', 'common.external.login': 'Log in with {type}', 'common.sso.noConfig': 'Single sign-on is not enabled on this system. Please contact your administrator.', diff --git a/src/locales/ja-JP/common.ts b/src/locales/ja-JP/common.ts index aab4a336..dfb3c321 100644 --- a/src/locales/ja-JP/common.ts +++ b/src/locales/ja-JP/common.ts @@ -261,6 +261,10 @@ export default { 'common.login.auth': 'Authenticating...', 'common.login.auth.failed': 'Authentication failed', 'common.login.password': 'Log in with Password', + 'common.login.username.holder': 'Please enter username', + 'common.login.password.holder': 'Please enter password', + 'common.login.newpassword.holder': 'Please enter new password', + 'common.login.confirm.holder': 'Please enter password again', 'common.external.login': 'Log in with {type}', 'common.sso.noConfig': 'Single sign-on is not enabled on this system. Please contact your administrator.', diff --git a/src/locales/ru-RU/common.ts b/src/locales/ru-RU/common.ts index f740f651..7e870fb7 100644 --- a/src/locales/ru-RU/common.ts +++ b/src/locales/ru-RU/common.ts @@ -260,6 +260,10 @@ export default { 'common.login.auth': 'Аутентификация...', 'common.login.auth.failed': 'Ошибка аутентификации', 'common.login.password': 'Войти с паролем', + 'common.login.username.holder': 'Введите имя пользователя', + 'common.login.password.holder': 'Введите пароль', + 'common.login.newpassword.holder': 'Введите новый пароль', + 'common.login.confirm.holder': 'Введите пароль ещё раз', 'common.external.login': 'Войти через {type}', 'common.sso.noConfig': 'Единый вход не настроен в этой системе. Пожалуйста, обратитесь к администратору.', diff --git a/src/locales/tr-TR/common.ts b/src/locales/tr-TR/common.ts index 660978b4..f43b12d1 100644 --- a/src/locales/tr-TR/common.ts +++ b/src/locales/tr-TR/common.ts @@ -264,6 +264,10 @@ export default { 'common.login.auth': 'Kimlik doğrulanıyor...', 'common.login.auth.failed': 'Kimlik doğrulama başarısız', 'common.login.password': 'Şifre ile giriş yap', + 'common.login.username.holder': 'Lütfen kullanıcı adını girin', + 'common.login.password.holder': 'Lütfen şifreyi girin', + 'common.login.newpassword.holder': 'Lütfen yeni şifreyi girin', + 'common.login.confirm.holder': 'Lütfen şifreyi tekrar girin', 'common.external.login': '{type} ile giriş yap', 'common.sso.noConfig': 'Bu sistemde çoklu oturum açma etkinleştirilmemiş. Lütfen yöneticinize başvurun.', diff --git a/src/locales/zh-CN/common.ts b/src/locales/zh-CN/common.ts index f7550da7..43fdff0f 100644 --- a/src/locales/zh-CN/common.ts +++ b/src/locales/zh-CN/common.ts @@ -254,6 +254,10 @@ export default { 'common.login.auth': '认证中...', 'common.login.auth.failed': '认证失败', 'common.login.password': '使用密码登录', + 'common.login.username.holder': '请输入用户名', + 'common.login.password.holder': '请输入密码', + 'common.login.newpassword.holder': '请输入新密码', + 'common.login.confirm.holder': '请再次输入密码', 'common.external.login': '使用 {type} 登录', 'common.sso.noConfig': '该系统未启用单点登录,请联系管理员。', 'common.button.edit.item': '编辑 {name}', diff --git a/src/pages/login/components/local-user-form.tsx b/src/pages/login/components/local-user-form.tsx index 071a6432..85949298 100644 --- a/src/pages/login/components/local-user-form.tsx +++ b/src/pages/login/components/local-user-form.tsx @@ -4,9 +4,9 @@ import { LockOutlined, UserOutlined } from '@ant-design/icons'; -import { Input as CInput, HighlightCode, IconFont } from '@gpustack/core-ui'; +import { HighlightCode, IconFont } from '@gpustack/core-ui'; import { useIntl } from '@umijs/max'; -import { Button, Divider, Form, FormInstance } from 'antd'; +import { Button, Divider, Flex, Form, FormInstance, Input } from 'antd'; import { createStyles } from 'antd-style'; const useStyles = createStyles(({ token, css }) => { @@ -28,6 +28,23 @@ const useStyles = createStyles(({ token, css }) => { font-size: 14px; } } + `, + password: css` + .ant-input-suffix { + display: flex; + flex-direction: row-reverse; + .reset-link { + padding: 0; + font-size: 12px; + color: ${token.colorTextSecondary}; + } + .ant-divider { + margin-left: 2px; + } + .reset-link:hover { + color: var(--ant-color-link-hover); + } + } ` }; }); @@ -78,11 +95,17 @@ const LocalUserForm: React.FC = (props) => { // Same shape Buttons uses: 360px design width, capped at the // parent's inner width so the form doesn't overflow on the // enterprise cover layout (272px inner). + layout="vertical" + requiredMark={false} style={{ width: '360px', maxWidth: '100%', margin: '0 auto' }} onFinish={handleLogin} > = (props) => { } ]} > - } + style={{ height: 44 }} /> = (props) => { } ]} > - } - label={intl.formatMessage({ id: 'common.form.password' })} + style={{ height: 44 }} + placeholder={intl.formatMessage({ + id: 'common.login.password.holder' + })} + suffix={ + + + + + } /> -
- -
diff --git a/src/pages/login/components/password-form.tsx b/src/pages/login/components/password-form.tsx index 34a02089..6bbb0bdd 100644 --- a/src/pages/login/components/password-form.tsx +++ b/src/pages/login/components/password-form.tsx @@ -7,9 +7,8 @@ import { writeState } from '@/utils/localstore/index'; import { LockOutlined } from '@ant-design/icons'; -import { Input as CInput } from '@gpustack/core-ui'; import { useIntl } from '@umijs/max'; -import { Button, Form, message } from 'antd'; +import { Button, Form, Input, message } from 'antd'; import CryptoJS from 'crypto-js'; import { useAtom } from 'jotai'; import { updatePassword } from '../apis'; @@ -56,13 +55,14 @@ const PasswordForm: React.FC = () => { return (

- {' '} {intl.formatMessage({ id: 'users.password.modify.title' })} {

{ } ]} > - } - label={intl.formatMessage({ id: 'users.form.newpassword' })} /> { }) ]} > - } - label={intl.formatMessage({ id: 'users.password.confirm' })} /> @@ -129,7 +139,7 @@ const PasswordForm: React.FC = () => { htmlType="submit" type="primary" block - style={{ height: '48px', fontSize: '14px', marginTop: 10 }} + style={{ height: '44px', fontSize: '14px', marginTop: 16 }} > {intl.formatMessage({ id: 'common.button.submit' })} diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index cb81f4a2..a075e3e6 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -72,12 +72,18 @@ const Box = styled.div` flex-direction: column; justify-content: space-between; min-height: 100vh; + .ant-form-item-label { + line-height: 1; + } + .ant-form-item-label > label { + height: auto !important; + } `; const FormWrapper = styled.div` margin: 0 auto; margin-top: 50vh; - width: 440px; + width: 400px; transform: translateY(-50%); position: relative; z-index: 999;