feat: login page
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
WechatWorkOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { useIntl, useNavigate } from '@umijs/max';
|
||||
import { Access, useAccess, useIntl, useNavigate } from '@umijs/max';
|
||||
import {
|
||||
App,
|
||||
Button,
|
||||
@@ -48,6 +48,7 @@ const dataSource = [
|
||||
|
||||
const Models: React.FC = () => {
|
||||
const { modal } = App.useApp();
|
||||
const access = useAccess();
|
||||
const intl = useIntl();
|
||||
const navigate = useNavigate();
|
||||
const rowSelection = useTableRowSelection();
|
||||
@@ -164,14 +165,16 @@ const Models: React.FC = () => {
|
||||
>
|
||||
{intl?.formatMessage?.({ id: 'models.button.deploy' })}
|
||||
</Button>
|
||||
<Button
|
||||
icon={<DeleteOutlined />}
|
||||
danger
|
||||
onClick={handleDelete}
|
||||
disabled={!rowSelection.selectedRowKeys.length}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
<Access accessible={access.canDelete}>
|
||||
<Button
|
||||
icon={<DeleteOutlined />}
|
||||
danger
|
||||
onClick={handleDelete}
|
||||
disabled={!rowSelection.selectedRowKeys.length}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
</Access>
|
||||
</Space>
|
||||
}
|
||||
></PageTools>
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import LogoIcon from '@/assets/images/logo.png';
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { LockOutlined, UserOutlined } from '@ant-design/icons';
|
||||
import { Button, Checkbox, Form } from 'antd';
|
||||
|
||||
const renderLogo = () => {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
width: '400px',
|
||||
display: 'flex',
|
||||
marginBottom: 24,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
}}
|
||||
>
|
||||
<img src={LogoIcon} alt="logo" style={{ width: '44px' }} />
|
||||
<span style={{ fontSize: 34, marginLeft: 12 }}>SEAL</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
const Login = () => {
|
||||
return (
|
||||
<Form style={{ width: '400px', margin: '5% auto 0' }}>
|
||||
<div>{renderLogo()}</div>
|
||||
<Form.Item
|
||||
name="username"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: 'Please input your Username!'
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Input label="Username" prefix={<UserOutlined />} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
name="password"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: 'Please input your Password!'
|
||||
}
|
||||
]}
|
||||
>
|
||||
<SealInput.Password prefix={<LockOutlined />} label="Password" />
|
||||
</Form.Item>
|
||||
<Form.Item name="autoLogin">
|
||||
<div style={{ paddingLeft: 10 }}>
|
||||
<Checkbox>Auto login</Checkbox>
|
||||
</div>
|
||||
</Form.Item>
|
||||
<Button htmlType="submit" type="primary" block>
|
||||
Login
|
||||
</Button>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
export default Login;
|
||||
@@ -1,3 +1,4 @@
|
||||
import SealInput from '@/components/seal-form/seal-input';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { useState } from 'react';
|
||||
import '../style/ground-left.less';
|
||||
@@ -54,6 +55,9 @@ const MessageList: React.FC = () => {
|
||||
return (
|
||||
<div className="ground-left">
|
||||
<PageContainer title={false} className="message-list-wrap">
|
||||
<div style={{ marginBottom: '40px' }}>
|
||||
<SealInput.TextArea label="Message"></SealInput.TextArea>
|
||||
</div>
|
||||
<div>
|
||||
{messageList.map((item, index) => {
|
||||
return (
|
||||
|
||||
@@ -21,6 +21,9 @@ const Profile: React.FC = () => {
|
||||
const handleOnFinishFailed = (errorInfo: any) => {
|
||||
console.log('handleOnFinishFailed', errorInfo);
|
||||
};
|
||||
const handleCancel = () => {
|
||||
form.resetFields();
|
||||
};
|
||||
|
||||
return (
|
||||
<StrictMode>
|
||||
@@ -69,8 +72,8 @@ const Profile: React.FC = () => {
|
||||
style={{ width: INPUT_WIDTH.default }}
|
||||
></SealInput.Password>
|
||||
</Form.Item>
|
||||
<FormButtons htmlType="submit" onCancel={handleCancel}></FormButtons>
|
||||
</Form>
|
||||
<FormButtons></FormButtons>
|
||||
</PageContainer>
|
||||
</StrictMode>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user