From b73dc7ba546e3f773ef6eb8f5f76489e9d6490e7 Mon Sep 17 00:00:00 2001 From: ZackYoung Date: Thu, 28 Nov 2024 17:37:20 +0800 Subject: [PATCH] optimize_login_page --- .../components/Flink/FlinkDag/functions.tsx | 3 +- .../src/pages/Other/Login/LoginForm/index.tsx | 94 ++++++++++--------- dinky-web/src/pages/Other/Login/index.tsx | 1 - 3 files changed, 51 insertions(+), 47 deletions(-) diff --git a/dinky-web/src/components/Flink/FlinkDag/functions.tsx b/dinky-web/src/components/Flink/FlinkDag/functions.tsx index 552aef63f8..cde1bbfa02 100644 --- a/dinky-web/src/components/Flink/FlinkDag/functions.tsx +++ b/dinky-web/src/components/Flink/FlinkDag/functions.tsx @@ -26,8 +26,7 @@ export const buildDag = (job: Jobs.JobPlan) => { const nodes: any = []; if (!job) return { nodes: nodes, edges: edges }; - - job.nodes.forEach((node) => { + job.nodes?.forEach((node) => { nodes.push({ id: node.id, shape: 'data-processing-dag-node', diff --git a/dinky-web/src/pages/Other/Login/LoginForm/index.tsx b/dinky-web/src/pages/Other/Login/LoginForm/index.tsx index 1d83bf60df..c12e470a3a 100644 --- a/dinky-web/src/pages/Other/Login/LoginForm/index.tsx +++ b/dinky-web/src/pages/Other/Login/LoginForm/index.tsx @@ -17,26 +17,26 @@ * */ -import { API_CONSTANTS } from '@/services/endpoints'; -import { l } from '@/utils/intl'; -import { GithubOutlined, LockOutlined, UserOutlined } from '@ant-design/icons'; -import { DefaultFooter, ProForm, ProFormCheckbox, ProFormText } from '@ant-design/pro-components'; -import { SubmitterProps } from '@ant-design/pro-form/es/components'; -import { Col, Flex, Row } from 'antd'; -import React, { useState } from 'react'; +import {API_CONSTANTS} from '@/services/endpoints'; +import {l} from '@/utils/intl'; +import {GithubOutlined, LockOutlined, UserOutlined} from '@ant-design/icons'; +import {DefaultFooter, ProForm, ProFormCheckbox, ProFormText} from '@ant-design/pro-components'; +import {SubmitterProps} from '@ant-design/pro-form/es/components'; +import {Col, Flex, Row} from 'antd'; +import React, {useState} from 'react'; import style from '../../../../global.less'; import Lottie from 'react-lottie'; import DataPlatform from '../../../../../public/login_animation.json'; -import { useRequest } from '@@/exports'; -import { history } from '@umijs/max'; -import { GLOBAL_SETTING_KEYS } from '@/types/SettingCenter/data.d'; +import {useRequest} from '@@/exports'; +import {history} from '@umijs/max'; +import {GLOBAL_SETTING_KEYS} from '@/types/SettingCenter/data.d'; type LoginFormProps = { onSubmit: (values: any) => Promise; }; const LoginForm: React.FC = (props) => { - const { onSubmit } = props; + const {onSubmit} = props; const [form] = ProForm.useForm(); @@ -55,7 +55,7 @@ const LoginForm: React.FC = (props) => { const handleClickLogin = async () => { setSubmitting(true); - await onSubmit({ ...form.getFieldsValue() }); + await onSubmit({...form.getFieldsValue()}); setSubmitting(false); }; @@ -66,7 +66,7 @@ const LoginForm: React.FC = (props) => { name='username' fieldProps={{ size: 'large', - prefix: + prefix: }} required placeholder={l('login.username.placeholder')} @@ -81,7 +81,7 @@ const LoginForm: React.FC = (props) => { name='password' fieldProps={{ size: 'large', - prefix: + prefix: }} placeholder={l('login.password.placeholder')} rules={[ @@ -95,7 +95,7 @@ const LoginForm: React.FC = (props) => { {l('login.rememberMe')} - + @@ -106,7 +106,7 @@ const LoginForm: React.FC = (props) => { }; const proFormSubmitter: SubmitterProps = { - searchConfig: { submitText: l('menu.login') }, + searchConfig: {submitText: l('menu.login')}, resetButtonProps: false, submitButtonProps: { loading: submitting, @@ -114,7 +114,7 @@ const LoginForm: React.FC = (props) => { htmlType: 'submit', size: 'large', shape: 'round', - style: { width: '100%' } + style: {width: '100%'} } }; @@ -140,34 +140,40 @@ const LoginForm: React.FC = (props) => { }} > - - {''} -

{l('layouts.userLayout.title')}

-
+ + + + {''}/ +

{l('layouts.userLayout.title')}

+
+ - - {renderLoginForm()} - + + + {renderLoginForm()} + + +
= (props) => { }, { key: 'github', - title: , + title: , href: 'https://github.com/DataLinkDC/dinky', blankTarget: true } @@ -187,9 +193,9 @@ const LoginForm: React.FC = (props) => { = (props) => { height: '100%' }} > - + = (props) => { src={'./icons/footer-bg.svg'} width={'100%'} alt={''} - style={{ position: 'absolute', bottom: 0 }} + style={{position: 'absolute', bottom: 0}} /> ); diff --git a/dinky-web/src/pages/Other/Login/index.tsx b/dinky-web/src/pages/Other/Login/index.tsx index 4a0ee89c74..ef974db1dd 100644 --- a/dinky-web/src/pages/Other/Login/index.tsx +++ b/dinky-web/src/pages/Other/Login/index.tsx @@ -17,7 +17,6 @@ * */ -import Footer from '@/components/Footer'; import ChooseModal from '@/pages/Other/Login/ChooseModal'; import { gotoRedirectUrl, initSomeThing, redirectToLogin } from '@/pages/Other/Login/function'; import LangSwitch from '@/pages/Other/Login/LangSwitch';