Unverified Commit 9ef3527d authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

[Refactor][web] refactor some layout (#2022)

* refactor about page * refactor about page * refactor some layout
parent 268f085b
...@@ -76,25 +76,6 @@ export default [ ...@@ -76,25 +76,6 @@ export default [
}, },
], ],
}, },
//todo: data center will be merge to the registration center's datasource module , it will be removed in the future
// {
// path: '/datacenter',
// name: 'datacenter',
// icon: 'DatabaseOutlined',
// routes: [
// {
// path: '/datacenter',
// redirect: '/datacenter/metadata',
// },
// {
// path: '/datacenter/metadata',
// name: 'metadata',
// icon: 'DatabaseOutlined',
// // component: './DataCenter/MetaData',
// },
// ],
// },
{ {
path: '/registration', path: '/registration',
name: 'registration', name: 'registration',
...@@ -234,7 +215,7 @@ export default [ ...@@ -234,7 +215,7 @@ export default [
path: '/settings/systemlog', path: '/settings/systemlog',
name: 'systemlog', name: 'systemlog',
icon: 'InfoCircleOutlined', icon: 'InfoCircleOutlined',
component: './SettingCenter/SystemInfo', component: './SettingCenter/SystemLogs',
}, },
{ {
path: '/settings/process', path: '/settings/process',
...@@ -260,7 +241,6 @@ export default [ ...@@ -260,7 +241,6 @@ export default [
}, },
{ {
path: '*', path: '*',
layout: false,
component: './Other/404', component: './Other/404',
}, },
]; ];
...@@ -215,8 +215,9 @@ ol { ...@@ -215,8 +215,9 @@ ol {
height: 100%; height: 100%;
overflow-x: auto; overflow-x: auto;
overflow-y: auto; overflow-y: auto;
max-height: 70vh; max-height: 82vh;
min-height: 70vh; min-height: 82vh;
.ant-tree { .ant-tree {
min-width: max-content; min-width: max-content;
...@@ -231,9 +232,14 @@ ol { ...@@ -231,9 +232,14 @@ ol {
} }
} }
.gitCodeTree{
max-height: 70vh;
min-height: 70vh;
}
.schemaTree{ .schemaTree{
max-height: 90vh; max-height: 89vh;
min-height: 90vh; min-height: 89vh;
} }
.code-content-empty { .code-content-empty {
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Alert, Typography} from 'antd';
import {l} from '@/utils/intl';
import React from 'react';
import {AlertRestProps, TypographyRestProps} from '@/pages/Other/About';
export const CommunityRules = () => {
return <>
<Alert
message={l('about.communityRules')}
type="success"
{...AlertRestProps}
/>
<Typography.Text {...TypographyRestProps}>
<ul>
<li>{l('about.communityRules.1')}</li>
<li>{l('about.communityRules.2')}</li>
<li>{l('about.communityRules.3')}</li>
<li>{l('about.communityRules.4')}</li>
<li>
<a href={'https://github.com/DataLinkDC/dinky/issues/66'} target={'_blank'} rel="noreferrer">
Issue
</a>
{l('about.communityRules.5')}
</li>
</ul>
</Typography.Text>
</>
}
...@@ -15,25 +15,19 @@ ...@@ -15,25 +15,19 @@
* limitations under the License. * limitations under the License.
*/ */
import {Tabs} from "antd"; import {l} from '@/utils/intl';
import RootLogs from "@/pages/SettingCenter/SystemInfo/TagInfo/RootLogs"; import {Alert} from 'antd';
import LogList from "@/pages/SettingCenter/SystemInfo/TagInfo/LogList"; import React from 'react';
import {AlertRestProps} from '@/pages/Other/About';
const {TabPane} = Tabs;
const TagInfo = () => {
export const Precautions = () => {
return <> return <>
<Tabs > <Alert
<TabPane tab={" Root Logs "} key="logs"> message={l('about.precautions')}
<RootLogs/> description={l('about.wechatApply')}
</TabPane> type="warning"
<TabPane tab={" Log List "} key="logList"> {...AlertRestProps}
<LogList/> />
</TabPane>
</Tabs>
</>; </>;
}; };
export default TagInfo;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Alert, Image, Typography} from 'antd';
import {l} from '@/utils/intl';
import {VERSION} from '@/services/constants';
import {SmileOutlined} from '@ant-design/icons';
import React from 'react';
import {AlertRestProps, ImageRestProps, TypographyRestProps} from '@/pages/Other/About';
const { Paragraph } = Typography;
export const QRCode = () => {
return <>
<Alert
message={l('about.Community', '', { version: VERSION })}
type="success"
icon={<SmileOutlined />}
{...AlertRestProps}
/>
<Paragraph>
<Typography.Text
title={l('about.QQcode')}
{...TypographyRestProps}
>
<Image
title={l('about.QQcode')}
{...ImageRestProps}
src="community/qq.png"
/>
</Typography.Text>
<Typography.Text {...TypographyRestProps}>
<Image
title={l('about.wechatCode')}
{...ImageRestProps}
src="community/wechat.jpg"
/>
</Typography.Text>
<Typography.Text {...TypographyRestProps}>
<Image
title={l('about.dingTalkCode')}
{...ImageRestProps}
src="community/dingtalk.jpg"
/>
</Typography.Text>
</Paragraph>
</>
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Alert, Typography} from 'antd';
import {l} from '@/utils/intl';
import {LinkOutlined, SmileOutlined} from '@ant-design/icons';
import React from 'react';
import {AlertRestProps, TypographyRestProps} from '@/pages/Other/About';
const { Paragraph } = Typography;
export const UsingHelp = () => {
return <>
<Alert
message={l('about.usingHelp')}
icon={<SmileOutlined />}
type="info"
{...AlertRestProps}
/>
<Paragraph >
<Typography.Text {...TypographyRestProps}>
<LinkOutlined /> GitHub:
<a href={'https://github.com/DataLinkDC/dinky'} target={'_blank'} rel="noreferrer">
https://github.com/DataLinkDC/dinky
</a>
</Typography.Text>
<br />
<Typography.Text {...TypographyRestProps}>
<LinkOutlined /> Gitee:{' '}
<a href={'https://gitee.com/DataLinkDC/Dinky'} target={'_blank'} rel="noreferrer">
https://gitee.com/DataLinkDC/Dinky
</a>
</Typography.Text>
<br />
<Typography.Text {...TypographyRestProps}>
<LinkOutlined /> Document:{' '}
<a href={'http://www.dlink.top'} target={'_blank'} rel="noreferrer">
http://www.dlink.top
</a>
</Typography.Text>
<br />
<Typography.Text {...TypographyRestProps}>
<LinkOutlined /> bilibili:{' '}
<a href={'https://space.bilibili.com/366484959/video'} target={'_blank'} rel="noreferrer">
https://space.bilibili.com/366484959/video
</a>
</Typography.Text>
</Paragraph>
</>
}
...@@ -15,148 +15,64 @@ ...@@ -15,148 +15,64 @@
* limitations under the License. * limitations under the License.
*/ */
import { VERSION } from '@/services/constants'; import {PageContainer, ProCard} from '@ant-design/pro-components';
import { l } from '@/utils/intl';
import { HeartOutlined, LinkOutlined, SmileOutlined } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-components';
import { Alert, Card, Image, Typography } from 'antd';
import React from 'react'; import React from 'react';
import {QRCode} from '@/pages/Other/About/components/QRCode';
import {UsingHelp} from '@/pages/Other/About/components/UsingHelp';
import {CommunityRules} from '@/pages/Other/About/components/CommunityRules';
import {Precautions} from './components/Precautions';
export const AlertRestProps = {
banner: true,
showIcon: true,
style: {
margin: -12,
marginBottom: 24,
}
};
export const ImageRestProps = {
height: 300,
width: 250,
};
export const TypographyRestProps = {
ellipsis: true,
strong: true,
style: {
marginRight: '2vw',
}
};
const { Paragraph } = Typography;
const About: React.FC = () => { const About: React.FC = () => {
return ( return <>
<PageContainer title={false}> <PageContainer title={false}>
<Card> <ProCard ghost split="vertical">
<Alert <ProCard wrap ghost colSpan="55%">
message={l('about.Community', '', { version: VERSION })} <ProCard>
type="success" <QRCode/>
icon={<SmileOutlined height={30} width={30} />} </ProCard>
showIcon <ProCard>
banner <Precautions/>
style={{ </ProCard>
margin: -12, </ProCard>
marginBottom: 24,
}}
/>
<Paragraph style={{ marginRight: 30 }}>
<Typography.Text
title={l('about.QQcode')}
style={{ marginRight: 80 }}
strong
ellipsis={true}
>
<Image
title={l('about.QQcode')}
height={300}
width={250}
src="community/qq.png"
/>
</Typography.Text>
<Typography.Text style={{ marginRight: 80 }} strong ellipsis={true}> <ProCard wrap ghost>
<Image <ProCard>
title={l('about.wechatCode')} <UsingHelp/>
height={300} </ProCard>
width={250}
src="community/wechat.jpg"
/>
</Typography.Text>
<Typography.Text strong ellipsis={true}> <ProCard>
<Image <CommunityRules/>
title={l('about.dingTalkCode')} </ProCard>
height={300} </ProCard>
width={250} </ProCard>
src="community/dingtalk.jpg"
/>
</Typography.Text>
</Paragraph>
<br />
<Alert
message={l('about.precautions')}
description={l('about.wechatApply')}
type="warning"
showIcon
banner
style={{
margin: -12,
marginBottom: 24,
}}
/>
<br />
<br />
<Typography.Text strong>
<Alert
message={l('about.usingHelp')}
icon={<SmileOutlined />}
type="info"
showIcon
banner
style={{
margin: -12,
marginBottom: 24,
}}
/>
<Paragraph style={{ marginRight: 30 }}>
<Typography.Text ellipsis strong>
<LinkOutlined /> GitHub:
<a href={'https://github.com/DataLinkDC/dinky'} target={'_blank'}>
https://github.com/DataLinkDC/dinky
</a>
</Typography.Text>
<br />
<Typography.Text ellipsis strong>
<LinkOutlined /> Gitee:{' '}
<a href={'https://gitee.com/DataLinkDC/Dinky'} target={'_blank'}>
https://gitee.com/DataLinkDC/Dinky
</a>
</Typography.Text>
<br />
<Typography.Text ellipsis strong>
<LinkOutlined /> Document:{' '}
<a href={'http://www.dlink.top'} target={'_blank'}>
http://www.dlink.top
</a>
</Typography.Text>
<br />
<Typography.Text ellipsis strong>
<LinkOutlined /> bilibili:{' '}
<a href={'https://space.bilibili.com/366484959/video'} target={'_blank'}>
https://space.bilibili.com/366484959/video
</a>
</Typography.Text>
</Paragraph>
<br />
<Alert
message={l('about.communityRules')}
type="success"
showIcon
icon={<HeartOutlined style={{ color: 'red' }} />}
banner
style={{
margin: -12,
marginBottom: 24,
}}
/>
<ul>
<li>{l('about.communityRules.1')}</li>
<li>{l('about.communityRules.2')}</li>
<li>{l('about.communityRules.3')}</li>
<li>{l('about.communityRules.4')}</li>
<li>
<a href={'https://github.com/DataLinkDC/dinky/issues/66'} target={'_blank'}>
Issue
</a>
{l('about.communityRules.5')}
</li>
</ul>
</Typography.Text>
</Card>
</PageContainer> </PageContainer>
); </>;
}; };
export default About; export default About;
...@@ -67,7 +67,7 @@ export const CodeTreeShow: React.FC<CodeTreeShowProps> = (props) => { ...@@ -67,7 +67,7 @@ export const CodeTreeShow: React.FC<CodeTreeShowProps> = (props) => {
*/ */
useEffect(() => { useEffect(() => {
queryCodeTree(); queryCodeTree();
}, []); }, [values.id]);
/** /**
...@@ -87,7 +87,7 @@ export const CodeTreeShow: React.FC<CodeTreeShowProps> = (props) => { ...@@ -87,7 +87,7 @@ export const CodeTreeShow: React.FC<CodeTreeShowProps> = (props) => {
*/ */
return <> return <>
<Row> <Row>
<Col span={6} className={"siderTree"}> <Col span={6} className={"siderTree gitCodeTree"}>
{/* tree */} {/* tree */}
<SiderTree treeData={treeData} onNodeClick={(info: any) => handleNodeClick(info)} loading={loading}/> <SiderTree treeData={treeData} onNodeClick={(info: any) => handleNodeClick(info)} loading={loading}/>
</Col> </Col>
......
...@@ -21,7 +21,7 @@ import {l} from "@/utils/intl"; ...@@ -21,7 +21,7 @@ import {l} from "@/utils/intl";
import {Empty} from "antd"; import {Empty} from "antd";
const CodeEditProps = { const CodeEditProps = {
height: "70vh", height: "82vh",
width: "100%", width: "100%",
lineNumbers: "on", lineNumbers: "on",
language: "java", language: "java",
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import React from "react"; import React from "react";
import {Empty, Tree} from "antd"; import {Empty, Tree} from "antd";
import {PageLoading} from "@ant-design/pro-components";
import {buildTreeData} from "@/utils/function"; import {buildTreeData} from "@/utils/function";
type LogsTreeProps = { type LogsTreeProps = {
......
...@@ -16,16 +16,17 @@ ...@@ -16,16 +16,17 @@
*/ */
import {Col, Row} from "antd"; import {Col, Row} from 'antd';
import React, {useEffect, useState} from "react"; import React, {useEffect, useState} from 'react';
import LogsTree from "@/pages/SettingCenter/SystemInfo/TagInfo/LogList/LogsTree"; import LogsTree from '@/pages/SettingCenter/SystemLogs/TagInfo/LogList/LogsTree';
import LogsShow from "@/pages/SettingCenter/SystemInfo/TagInfo/LogList/LogsShow"; import LogsShow from '@/pages/SettingCenter/SystemLogs/TagInfo/LogList/LogsShow';
import {queryDataByParams} from "@/services/BusinessCrud"; import {queryDataByParams} from '@/services/BusinessCrud';
import {API_CONSTANTS} from "@/services/constants"; import {API_CONSTANTS} from '@/services/constants';
import {ProCard} from '@ant-design/pro-components';
const LogList = () => { const LogList = () => {
const [treeData, setTreeData] = useState<Partial<any>[]>([]); const [treeData, setTreeData] = useState<Partial<any>[]>([]);
const [log, setLog] = useState<string>(""); const [log, setLog] = useState<string>('');
const [clickFileName, setClickFileName] = useState<any>(); const [clickFileName, setClickFileName] = useState<any>();
const queryLogList = async () => { const queryLogList = async () => {
...@@ -61,18 +62,14 @@ const LogList = () => { ...@@ -61,18 +62,14 @@ const LogList = () => {
return <> return <>
<Row> <ProCard ghost>
<Col span={4} className={"siderTree"}> <ProCard ghost colSpan={'18%'} className={"siderTree"} >
{/* tree */}
<LogsTree treeData={treeData} onNodeClick={(info: any) => handleNodeClick(info)}/> <LogsTree treeData={treeData} onNodeClick={(info: any) => handleNodeClick(info)}/>
{/*<SiderTree treeData={treeData} onNodeClick={(info: any) => handleNodeClick(info)} loading={loading}/>*/} </ProCard>
</Col> <ProCard ghost >
<Col span={20}>
{/* code */}
<LogsShow code={log} refreshLogCallback={() => refreshLogByClickNode()}/> <LogsShow code={log} refreshLogCallback={() => refreshLogByClickNode()}/>
{/*<CodeContent code={codeValue} current={currentGitProjectTreeNode}/>*/} </ProCard>
</Col> </ProCard>
</Row>
</>; </>;
}; };
......
...@@ -26,7 +26,7 @@ import {API_CONSTANTS} from "@/services/constants"; ...@@ -26,7 +26,7 @@ import {API_CONSTANTS} from "@/services/constants";
* code edit props * code edit props
*/ */
const CodeEditProps = { const CodeEditProps = {
height: "75vh", height: "82vh",
width: "100%", width: "100%",
lineNumbers: "on", lineNumbers: "on",
language: "java", language: "java",
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Space} from 'antd';
import RootLogs from "@/pages/SettingCenter/SystemLogs/TagInfo/RootLogs";
import LogList from "@/pages/SettingCenter/SystemLogs/TagInfo/LogList";
import React, {useState} from 'react';
import {ProCard} from '@ant-design/pro-components';
import {LogSvg} from '@/components/Icons/CodeLanguageIcon';
const TagInfo = () => {
const [activeKey, setActiveKey] = useState('logs');
// tab list
const tabList = [
{
key: 'logs',
label: <Space><LogSvg/>{'Root Logs'}</Space>,
children: <RootLogs/>,
},
{
key: 'logList',
label: <Space><LogSvg/>{'Log List'}</Space>,
children: <LogList/>,
},
];
// tab props
const restTabProps = {
activeKey: activeKey,
type: 'card',
animated: true,
onChange: (key: string) => setActiveKey(key),
items: tabList,
};
/**
* render
*/
return <>
<ProCard ghost className={'schemaTree'} size="small" bordered tabs={{...restTabProps}}/>
</>;
};
export default TagInfo;
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
*/ */
import {PageContainer} from "@ant-design/pro-components"; import {PageContainer} from "@ant-design/pro-components";
import TagInfo from "@/pages/SettingCenter/SystemInfo/TagInfo"; import TagInfo from "@/pages/SettingCenter/SystemLogs/TagInfo";
export default () => { export default () => {
return <PageContainer title={false}> return <PageContainer title={false}>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {ModalFormProps} from "@ant-design/pro-form/es/layouts/ModalForm"; import {ModalFormProps} from "@ant-design/pro-form/es/layouts/ModalForm";
import {ProTableProps} from "@ant-design/pro-table";
/** /**
* the interface api constants * the interface api constants
...@@ -320,7 +319,6 @@ export const PROTABLE_OPTIONS_PUBLIC : any = { ...@@ -320,7 +319,6 @@ export const PROTABLE_OPTIONS_PUBLIC : any = {
y: "auto", y: "auto",
}, },
search: { search: {
ghost: false,
labelWidth: 80, // must be number labelWidth: 80, // must be number
span: 4, span: 4,
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment