style: login page lang select

main
jialin 2 years ago
parent d11f402fb8
commit 2587f10085

@ -0,0 +1,35 @@
import langConfigMap from '@/locales/lang-config-map';
import { GlobalOutlined } from '@ant-design/icons';
import { getAllLocales, setLocale } from '@umijs/max';
import { Dropdown } from 'antd';
import { get } from 'lodash';
const LangSelect = () => {
const allLocals = getAllLocales();
const items = allLocals.map((key) => {
return {
key,
label: (
<span
className="flex flex-center font-size-12"
style={{ paddingInline: 8 }}
>
<span>{get(langConfigMap, [key, 'label'])}</span>
</span>
),
onClick: () => {
setLocale(key, false);
}
};
});
return (
<Dropdown menu={{ items }}>
<span style={{ padding: '0 12px', cursor: 'pointer' }}>
<GlobalOutlined />
</span>
</Dropdown>
);
};
export default LangSelect;

@ -1,13 +1,14 @@
import LogoIcon from '@/assets/images/gpustack-logo.png';
import { initialPasswordAtom, userAtom } from '@/atoms/user';
import LangSelect from '@/components/lang-select';
import SealInput from '@/components/seal-form/seal-input';
import {
getRememberMe,
rememberMe,
removeRememberMe
} from '@/utils/localstore/index';
import { GlobalOutlined, LockOutlined, UserOutlined } from '@ant-design/icons';
import { SelectLang, history, useIntl, useModel } from '@umijs/max';
import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { history, useIntl, useModel } from '@umijs/max';
import { Button, Checkbox, Form } from 'antd';
import CryptoJS from 'crypto-js';
import { useAtom } from 'jotai';
@ -147,10 +148,10 @@ const LoginForm = () => {
position: 'fixed',
right: 0,
top: 0,
padding: '0 20px'
padding: '20px'
}}
>
<SelectLang icon={<GlobalOutlined />} reload={false} />
<LangSelect />
</div>
<div>
<Form

Loading…
Cancel
Save