Unverified Commit 8546bb14 authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Optimization-2284][web] Optimize dinky web and fix some bugs (#2285)

* [Optimization-2284][web] Optimize dinky web and fix some bugs * spotless apply * Resolve code conflicts --------- Co-authored-by: 's avatarwenmo <32723967+wenmo@users.noreply.github.com>
parent bca2f9e3
...@@ -19,8 +19,11 @@ ...@@ -19,8 +19,11 @@
package org.dinky.data.model; package org.dinky.data.model;
import org.dinky.assertion.Asserts;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -54,7 +57,9 @@ public class TaskExtConfig implements Serializable { ...@@ -54,7 +57,9 @@ public class TaskExtConfig implements Serializable {
// 获取自定义配置的所有key-value // 获取自定义配置的所有key-value
public Map<String, String> getCustomConfigMaps() { public Map<String, String> getCustomConfigMaps() {
return customConfig.stream().collect(Collectors.toMap(ConfigItem::getKey, ConfigItem::getValue)); return Asserts.isNotNullCollection(customConfig)
? customConfig.stream().collect(Collectors.toMap(ConfigItem::getKey, ConfigItem::getValue))
: new HashMap<>();
} }
// 是否包含某个key // 是否包含某个key
......
...@@ -61,7 +61,6 @@ const queryUserInfo = async () => { ...@@ -61,7 +61,6 @@ const queryUserInfo = async () => {
return getDataByParamsReturnResult(API_CONSTANTS.CURRENT_USER).then( return getDataByParamsReturnResult(API_CONSTANTS.CURRENT_USER).then(
(result) => { (result) => {
const { user, roleList, tenantList, currentTenant, menuList, saTokenInfo } = result.datas; const { user, roleList, tenantList, currentTenant, menuList, saTokenInfo } = result.datas;
extraRoutes = menuList;
const currentUser: API.CurrentUser = { const currentUser: API.CurrentUser = {
user: { user: {
...user, ...user,
...@@ -74,17 +73,10 @@ const queryUserInfo = async () => { ...@@ -74,17 +73,10 @@ const queryUserInfo = async () => {
tokenInfo: saTokenInfo tokenInfo: saTokenInfo
}; };
return currentUser; return currentUser;
},
(error) => {
history.push(loginPath);
console.log(error);
return undefined;
} }
); );
}; };
const fetchUserInfo = async () => await queryUserInfo();
/** /**
* @see https://umijs.org/zh-CN/plugins/plugin-initial-state * @see https://umijs.org/zh-CN/plugins/plugin-initial-state
* */ * */
...@@ -94,10 +86,21 @@ export async function getInitialState(): Promise<{ ...@@ -94,10 +86,21 @@ export async function getInitialState(): Promise<{
loading?: boolean; loading?: boolean;
fetchUserInfo?: () => Promise<API.CurrentUser | undefined>; fetchUserInfo?: () => Promise<API.CurrentUser | undefined>;
}> { }> {
const fetchUserInfo = async () => {
try {
return await queryUserInfo();
} catch (error) {
history.push(loginPath);
}
return undefined;
};
// 如果不是登录页面,执行 // 如果不是登录页面,执行
const { location } = history; const { location } = history;
if (location.pathname !== loginPath) { if (location.pathname !== loginPath) {
const currentUser = await fetchUserInfo(); const currentUser = await fetchUserInfo();
extraRoutes = currentUser?.menuList;
return { return {
fetchUserInfo, fetchUserInfo,
currentUser, currentUser,
...@@ -129,11 +132,11 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => { ...@@ -129,11 +132,11 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
rightContentRender: () => <RightContent />, rightContentRender: () => <RightContent />,
footerRender: () => <Footer />, footerRender: () => <Footer />,
siderWidth: 180, siderWidth: 180,
waterMarkProps: { /*waterMarkProps: {
content: initialState?.currentUser?.user.username + ' ' + new Date().toLocaleString(), content: initialState?.currentUser?.user.username + ' ' + new Date().toLocaleString(),
fontColor: fontColor:
theme === THEME.light || undefined ? 'rgba(0, 0, 0, 0.15)' : 'rgba(255, 255, 255, 0.15)' theme === THEME.light || undefined ? 'rgba(0, 0, 0, 0.15)' : 'rgba(255, 255, 255, 0.15)'
}, },*/
isChildrenLayout: true, isChildrenLayout: true,
onPageChange: () => { onPageChange: () => {
const { location } = history; const { location } = history;
...@@ -191,7 +194,7 @@ const patch = (oldRoutes: any, routes: SysMenu[]) => { ...@@ -191,7 +194,7 @@ const patch = (oldRoutes: any, routes: SysMenu[]) => {
oldRoutes[1].routes = oldRoutes[1].routes.map( oldRoutes[1].routes = oldRoutes[1].routes.map(
(route: { routes: { path: any; element: JSX.Element }[]; path: string }) => { (route: { routes: { path: any; element: JSX.Element }[]; path: string }) => {
if (route.routes?.length) { if (route.routes?.length) {
const redirect = routes.filter((r) => r.path.startsWith(route.path)); const redirect = routes?.filter((r) => r.path.startsWith(route.path));
if (redirect.length) { if (redirect.length) {
route.routes.shift(); route.routes.shift();
route.routes.unshift({ route.routes.unshift({
...@@ -217,11 +220,11 @@ export function patchClientRoutes({ routes }: { routes: SysMenu[] }) { ...@@ -217,11 +220,11 @@ export function patchClientRoutes({ routes }: { routes: SysMenu[] }) {
* 路由切换并只加载首次 * 路由切换并只加载首次
*/ */
export function onRouteChange({ export function onRouteChange({
location, location,
clientRoutes, clientRoutes,
routes, routes,
action action
}: { }: {
location: any; location: any;
clientRoutes: any; clientRoutes: any;
routes: any; routes: any;
...@@ -229,7 +232,7 @@ export function onRouteChange({ ...@@ -229,7 +232,7 @@ export function onRouteChange({
}) { }) {
if (location.pathname !== loginPath && !rendered) { if (location.pathname !== loginPath && !rendered) {
const filterMenus = (menus: SysMenu[]) => { const filterMenus = (menus: SysMenu[]) => {
return menus.filter((menu) => menu.type !== 'F'); return menus?.filter((menu) => menu.type !== 'F');
}; };
extraRoutes = filterMenus(extraRoutes); extraRoutes = filterMenus(extraRoutes);
patchClientRoutes({ routes: clientRoutes }); patchClientRoutes({ routes: clientRoutes });
......
...@@ -60,44 +60,38 @@ const GlobalHeaderRight: React.FC = () => { ...@@ -60,44 +60,38 @@ const GlobalHeaderRight: React.FC = () => {
/** /**
* css * css
*/ */
const actionClassName = useEmotionCss(({ token }) => { const actionClassName = {
return { display: 'flex',
display: 'flex', float: 'right',
float: 'right', justifyContent: 'center',
justifyContent: 'center', alignItems: 'center',
alignItems: 'center', height: '48px',
height: '48px', marginLeft: 'auto',
marginLeft: 'auto', overflow: 'hidden',
overflow: 'hidden', cursor: 'pointer',
cursor: 'pointer', padding: '0 9px',
padding: '0 9px', color: '#fff',
color: '#fff', '&:hover': {
borderRadius: token.borderRadius, backgroundColor: '#fff'
'&:hover': { }
backgroundColor: token.colorBgTextHover };
}
};
});
/** /**
* full screen css * full screen css
*/ */
const fullScreenClassName = useEmotionCss(({ token }) => { const fullScreenClassName = {
return { display: 'flex',
display: 'flex', float: 'right',
float: 'right', height: '48px',
height: '48px', marginLeft: 'auto',
marginLeft: 'auto', overflow: 'hidden',
overflow: 'hidden', cursor: 'pointer',
cursor: 'pointer', padding: '0 12px',
padding: '0 12px', color: '#fff',
borderRadius: token.borderRadius, '&:hover': {
color: 'red', backgroundColor: '#fff'
'&:hover': { }
backgroundColor: token.colorPrimary };
}
};
});
/** /**
* full screen or exit full screen * full screen or exit full screen
...@@ -110,8 +104,7 @@ const GlobalHeaderRight: React.FC = () => { ...@@ -110,8 +104,7 @@ const GlobalHeaderRight: React.FC = () => {
}; };
const fullScreenProps = { const fullScreenProps = {
style: { color: 'white' }, style: fullScreenClassName
className: fullScreenClassName
}; };
const menuVersion = l('menu.version', '', { version: VERSION }); const menuVersion = l('menu.version', '', { version: VERSION });
...@@ -129,9 +122,9 @@ const GlobalHeaderRight: React.FC = () => { ...@@ -129,9 +122,9 @@ const GlobalHeaderRight: React.FC = () => {
</Tooltip> </Tooltip>
<Avatar /> <Avatar />
<Tooltip placement='bottom' title={<span>{menuVersion}</span>}> <Tooltip placement='bottom' title={<span>{menuVersion}</span>}>
<Space className={actionClassName}>{menuVersion}</Space> <Space style={actionClassName}>{menuVersion}</Space>
</Tooltip> </Tooltip>
<SelectLang icon={<GlobalOutlined />} className={actionClassName} /> <SelectLang icon={<GlobalOutlined />} style={actionClassName} />
<Switch <Switch
key={'themeSwitch'} key={'themeSwitch'}
checked={theme === THEME.dark} checked={theme === THEME.dark}
......
...@@ -24,8 +24,8 @@ body, ...@@ -24,8 +24,8 @@ body,
overflow-x: auto; overflow-x: auto;
overflow-y: auto; overflow-y: auto;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'; 'Noto Color Emoji';
} }
// .login-form style --- start ---- // .login-form style --- start ----
...@@ -48,8 +48,8 @@ body, ...@@ -48,8 +48,8 @@ body,
.logo { .logo {
position: absolute; position: absolute;
top: -5vh; top: 10vh;
left: -30vw; left: 20vw;
display: flex; display: flex;
flex: auto; flex: auto;
flex-flow: column-reverse; flex-flow: column-reverse;
...@@ -57,6 +57,8 @@ body, ...@@ -57,6 +57,8 @@ body,
} }
.desc { .desc {
font-weight: 600;
font-size: 24px;
margin-top: 2rem; margin-top: 2rem;
margin-bottom: 1rem; margin-bottom: 1rem;
//color: @text-color-secondary; //color: @text-color-secondary;
...@@ -82,6 +84,7 @@ body, ...@@ -82,6 +84,7 @@ body,
margin-bottom: -15vh; margin-bottom: -15vh;
margin-left: 60vw; margin-left: 60vw;
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.4); box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.4);
border-radius: 10px;
} }
.loginform { .loginform {
...@@ -244,18 +247,12 @@ ol { ...@@ -244,18 +247,12 @@ ol {
.ant-tree-node-content-wrapper { .ant-tree-node-content-wrapper {
display: flex; display: flex;
:hover {
color: #1eef07;
}
} }
} }
} }
.ant-tree-node-content-wrapper { .ant-tree-node-content-wrapper {
display: flex; display: flex;
:hover {
color: #1eef07;
}
} }
.gitCodeTree { .gitCodeTree {
min-height: 70vh; min-height: 70vh;
...@@ -381,7 +378,7 @@ h5 { ...@@ -381,7 +378,7 @@ h5 {
justify-content: space-between; justify-content: space-between;
line-height: 32px; line-height: 32px;
padding-inline: 10px; padding-inline: 10px;
padding-block: 5px; padding-block: 1px;
border-block: 1px solid; border-block: 1px solid;
} }
...@@ -421,3 +418,4 @@ h5 { ...@@ -421,3 +418,4 @@ h5 {
display: flex !important; display: flex !important;
align-items: baseline !important; align-items: baseline !important;
} }
...@@ -71,12 +71,14 @@ export default { ...@@ -71,12 +71,14 @@ export default {
'home.job.failed.name': 'Job Name', 'home.job.failed.name': 'Job Name',
'home.job.failed.time': 'Abnormal Time', 'home.job.failed.time': 'Abnormal Time',
'home.develop': 'Data Develop', 'home.develop': 'Data Develop',
'home.job.development': 'Development',
'home.job.batch': 'Batch Job', 'home.job.batch': 'Batch Job',
'home.job.stream': 'Streaming Job', 'home.job.stream': 'Streaming Job',
'home.job.total': 'Number of Jobs', 'home.job.total': 'Number of Jobs',
'home.job.onlineRate': 'Number of Jobs Online Rate', 'home.job.onlineRate': 'Number of Jobs Online Rate',
'home.job.type': 'Job Type', 'home.job.type': 'Job Type',
'home.job.rate': 'Proportion of Jobs', 'home.job.rate': 'Proportion of Jobs',
'home.develop.re': 'Resource Registration',
'home.develop.re.ci': 'Flink Cluster Instance', 'home.develop.re.ci': 'Flink Cluster Instance',
'home.develop.re.cc': 'Cluster Configuration', 'home.develop.re.cc': 'Cluster Configuration',
'home.develop.re.ds': 'Data Source', 'home.develop.re.ds': 'Data Source',
......
...@@ -68,12 +68,14 @@ export default { ...@@ -68,12 +68,14 @@ export default {
'home.job.failed.name': '任务名称', 'home.job.failed.name': '任务名称',
'home.job.failed.time': '已异常时间', 'home.job.failed.time': '已异常时间',
'home.develop': ' 数据开发', 'home.develop': ' 数据开发',
'home.job.development': '建设情况',
'home.job.batch': '批作业', 'home.job.batch': '批作业',
'home.job.stream': '流作业', 'home.job.stream': '流作业',
'home.job.total': '作业数', 'home.job.total': '作业数',
'home.job.onlineRate': '作业上线率', 'home.job.onlineRate': '作业上线率',
'home.job.type': '作业类型', 'home.job.type': '作业类型',
'home.job.rate': '作业占比', 'home.job.rate': '作业占比',
'home.develop.re': '资源注册情况',
'home.develop.re.ci': 'Flink 集群实例', 'home.develop.re.ci': 'Flink 集群实例',
'home.develop.re.cc': '集群配置', 'home.develop.re.cc': '集群配置',
'home.develop.re.ds': '数据源', 'home.develop.re.ds': '数据源',
......
...@@ -125,7 +125,6 @@ const JobModal: React.FC<JobModalProps> = (props) => { ...@@ -125,7 +125,6 @@ const JobModal: React.FC<JobModalProps> = (props) => {
name='note' name='note'
label={l('catalog.note')} label={l('catalog.note')}
placeholder={l('catalog.note.placeholder')} placeholder={l('catalog.note.placeholder')}
rules={[{ required: true, message: l('catalog.note.placeholder') }]}
/> />
{isUDF(jobType) && ( {isUDF(jobType) && (
<> <>
......
...@@ -41,7 +41,7 @@ export const buildProjectTree = ( ...@@ -41,7 +41,7 @@ export const buildProjectTree = (
searchValue: string = '', searchValue: string = '',
path?: string[] path?: string[]
): any => ): any =>
data.map((item: Catalogue) => { data?data.map((item: Catalogue) => {
const currentPath = path ? [...path, item.name] : [item.name]; const currentPath = path ? [...path, item.name] : [item.name];
return { return {
// isLeaf: (item.type && item.children.length === 0) , // isLeaf: (item.type && item.children.length === 0) ,
...@@ -60,7 +60,7 @@ export const buildProjectTree = ( ...@@ -60,7 +60,7 @@ export const buildProjectTree = (
taskId: item.taskId, taskId: item.taskId,
children: buildProjectTree(item.children, searchValue, currentPath) children: buildProjectTree(item.children, searchValue, currentPath)
}; };
}); }):[];
export const isUDF = (jobType: string) => { export const isUDF = (jobType: string) => {
return jobType === 'Scala' || jobType === 'Python' || jobType === 'Java'; return jobType === 'Scala' || jobType === 'Python' || jobType === 'Java';
......
...@@ -49,6 +49,7 @@ import { Layout, Menu, Modal, theme, Typography } from 'antd'; ...@@ -49,6 +49,7 @@ import { Layout, Menu, Modal, theme, Typography } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { PersistGate } from 'redux-persist/integration/react'; import { PersistGate } from 'redux-persist/integration/react';
import { connect, getDvaApp } from 'umi'; import { connect, getDvaApp } from 'umi';
import { PageContainer } from '@ant-design/pro-layout';
const { Text } = Typography; const { Text } = Typography;
...@@ -177,7 +178,7 @@ const DataStudio = (props: any) => { ...@@ -177,7 +178,7 @@ const DataStudio = (props: any) => {
return false; return false;
} }
if (JSON.stringify(res[key]) !== JSON.stringify(params.taskData[key])) { if (res && JSON.stringify(res[key]) !== JSON.stringify(params.taskData[key])) {
return true; return true;
} }
}); });
...@@ -226,134 +227,136 @@ const DataStudio = (props: any) => { ...@@ -226,134 +227,136 @@ const DataStudio = (props: any) => {
const access = useAccess(); const access = useAccess();
return ( return (
<PersistGate loading={null} persistor={persist}> <PageContainer title={false} breadcrumb={{ style: { display: 'none' } }}>
<div style={{ marginInline: -10, marginBlock: -5 }}> <PersistGate loading={null} persistor={persist}>
{/* 渲染 header */} <div style={{ marginInline: -10, marginBlock: -5 }}>
{renderHeaderContainer()} {/* 渲染 header */}
<Layout hasSider style={{ minHeight: size.contentHeight, paddingInline: 0 }}> {renderHeaderContainer()}
{/*渲染左侧侧边栏*/} <Layout hasSider style={{ minHeight: size.contentHeight, paddingInline: 0 }}>
<Sider collapsed collapsedWidth={40}> {/*渲染左侧侧边栏*/}
<Menu <Sider collapsed collapsedWidth={40}>
mode='inline' <Menu
selectedKeys={[leftContainer.selectKey]} mode='inline'
items={LeftSide.filter((x) => selectedKeys={[leftContainer.selectKey]}
AuthorizedObject({ path: x.auth, children: x, access }) items={LeftSide.filter((x) =>
).map((x) => ({ AuthorizedObject({ path: x.auth, children: x, access })
key: x.key, ).map((x) => ({
label: x.label, key: x.key,
icon: x.icon label: x.label,
}))} icon: x.icon
style={{ }))}
height: '50%', style={{
borderBlockStart: `1px solid ${themeValue.borderColor}`, height: '50%',
borderInlineEnd: `1px solid ${themeValue.borderColor}` borderBlockStart: `1px solid ${themeValue.borderColor}`,
}} borderInlineEnd: `1px solid ${themeValue.borderColor}`
onClick={(item) => }}
updateSelectLeftKey(item.key === leftContainer.selectKey ? '' : item.key) onClick={(item) =>
} updateSelectLeftKey(item.key === leftContainer.selectKey ? '' : item.key)
/>
{/*底部菜单*/}
<Menu
mode='inline'
selectedKeys={[bottomContainer.selectKey]}
items={LeftBottomSide.filter((x) =>
AuthorizedObject({ path: x.auth, children: x, access })
).map((x) => ({
key: x.key,
label: x.label,
icon: x.icon
}))}
style={{
display: 'flex',
height: '50%',
flexDirection: 'column-reverse',
borderInlineEnd: `1px solid ${themeValue.borderColor}`
}}
onClick={(item) => {
updateSelectBottomKey(item.key === bottomContainer.selectKey ? '' : item.key);
if (
bottomContainer.selectKey !== '' &&
!bottomContainer.selectSubKey[item.key] &&
LeftBottomMoreTabs[item.key]
) {
updateSelectBottomSubKey(LeftBottomMoreTabs[item.key][0].key);
} }
}} />
/>
</Sider> {/*底部菜单*/}
<Menu
<Content mode='inline'
style={{ selectedKeys={[bottomContainer.selectKey]}
flexDirection: 'column-reverse', items={LeftBottomSide.filter((x) =>
display: 'flex', AuthorizedObject({ path: x.auth, children: x, access })
height: size.contentHeight ).map((x) => ({
}} key: x.key,
> label: x.label,
{/*渲染底部内容*/} icon: x.icon
{<BottomContainer size={size} />} }))}
style={{
<div display: 'flex',
height: '50%',
flexDirection: 'column-reverse',
borderInlineEnd: `1px solid ${themeValue.borderColor}`
}}
onClick={(item) => {
updateSelectBottomKey(item.key === bottomContainer.selectKey ? '' : item.key);
if (
bottomContainer.selectKey !== '' &&
!bottomContainer.selectSubKey[item.key] &&
LeftBottomMoreTabs[item.key]
) {
updateSelectBottomSubKey(LeftBottomMoreTabs[item.key][0].key);
}
}}
/>
</Sider>
<Content
style={{ style={{
flexDirection: 'column-reverse',
display: 'flex', display: 'flex',
position: 'absolute', height: size.contentHeight
top: VIEW.headerHeight,
width: size.width - VIEW.sideWidth * 2
}} }}
> >
{renderLeftContainer()} {/*渲染底部内容*/}
{<BottomContainer size={size} />}
<Content <div
style={{ style={{
width: display: 'flex',
size.width - 2 * VIEW.sideWidth - leftContainer.width - rightContainer.width position: 'absolute',
top: VIEW.headerHeight,
width: size.width - VIEW.sideWidth * 2
}} }}
> >
<MiddleContainer /> {renderLeftContainer()}
</Content>
<Content
{renderRightContainer()} style={{
</div> width:
</Content> size.width - 2 * VIEW.sideWidth - leftContainer.width - rightContainer.width
}}
{/* 渲染右侧侧边栏 */} >
<Sider collapsed collapsedWidth={40}> <MiddleContainer />
<Menu </Content>
selectedKeys={[rightContainer.selectKey]}
mode='inline' {renderRightContainer()}
style={{ </div>
height: '100%', </Content>
borderInlineStart: `1px solid ${themeValue.borderColor}`,
borderBlockStart: `1px solid ${themeValue.borderColor}` {/* 渲染右侧侧边栏 */}
}} <Sider collapsed collapsedWidth={40}>
items={RightSide.filter((x) => <Menu
AuthorizedObject({ path: x.auth, children: x, access }) selectedKeys={[rightContainer.selectKey]}
) mode='inline'
.filter((x) => { style={{
if (!x.isShow) { height: '100%',
return true; borderInlineStart: `1px solid ${themeValue.borderColor}`,
} borderBlockStart: `1px solid ${themeValue.borderColor}`
if (parseInt(tabs.activeKey) < 0) { }}
return TabsPageType.None; items={RightSide.filter((x) =>
} AuthorizedObject({ path: x.auth, children: x, access })
const v = (tabs.panes as TabsItemType[]).find( )
(item) => item.key === tabs.activeKey .filter((x) => {
); if (!x.isShow) {
return x.isShow(v?.type ?? TabsPageType.None, v?.subType); return true;
}) }
.map((x) => { if (parseInt(tabs.activeKey) < 0) {
return { key: x.key, label: x.label, icon: x.icon }; return TabsPageType.None;
})} }
onClick={(item) => const v = (tabs.panes as TabsItemType[]).find(
updateSelectRightKey(item.key === rightContainer.selectKey ? '' : item.key) (item) => item.key === tabs.activeKey
} );
/> return x.isShow(v?.type ?? TabsPageType.None, v?.subType);
</Sider> })
</Layout> .map((x) => {
{/* 页脚 */} return { key: x.key, label: x.label, icon: x.icon };
{<FooterContainer token={token} />} })}
</div> onClick={(item) =>
</PersistGate> updateSelectRightKey(item.key === rightContainer.selectKey ? '' : item.key)
}
/>
</Sider>
</Layout>
{/* 页脚 */}
{<FooterContainer token={token} />}
</div>
</PersistGate>
</PageContainer>
); );
}; };
......
...@@ -27,6 +27,11 @@ import { Badge } from 'antd'; ...@@ -27,6 +27,11 @@ import { Badge } from 'antd';
import RcResizeObserver from 'rc-resize-observer'; import RcResizeObserver from 'rc-resize-observer';
import React, { useState } from 'react'; import React, { useState } from 'react';
const noPadding = {
paddingInline: '0',
paddingBlock: '0'
};
const DevOverView: React.FC = () => { const DevOverView: React.FC = () => {
const [split, setSplit] = useState<'vertical' | 'horizontal' | undefined>('vertical'); const [split, setSplit] = useState<'vertical' | 'horizontal' | undefined>('vertical');
...@@ -48,9 +53,10 @@ const DevOverView: React.FC = () => { ...@@ -48,9 +53,10 @@ const DevOverView: React.FC = () => {
bordered bordered
size='small' size='small'
split={split} split={split}
bodyStyle={noPadding}
> >
<ProCard split='vertical'> <ProCard split='vertical' bodyStyle={noPadding}>
<ProCard split='horizontal' colSpan={'40%'}> <ProCard title={l('home.job.development')} split='horizontal' colSpan={'40%'} bodyStyle={noPadding}>
<ProCard> <ProCard>
<BatchStreamProportion /> <BatchStreamProportion />
</ProCard> </ProCard>
...@@ -59,10 +65,10 @@ const DevOverView: React.FC = () => { ...@@ -59,10 +65,10 @@ const DevOverView: React.FC = () => {
</ProCard> </ProCard>
</ProCard> </ProCard>
<ProCard colSpan={'30%'}> <ProCard title={l('home.job.onlineRate')} colSpan={'30%'} bodyStyle={noPadding}>
<TaskDialectRadar /> <TaskDialectRadar />
</ProCard> </ProCard>
<ProCard> <ProCard title={l('home.develop.re')} bodyStyle={noPadding}>
<ResourceView /> <ResourceView />
</ProCard> </ProCard>
</ProCard> </ProCard>
......
...@@ -129,7 +129,7 @@ const JobErrorView: React.FC = () => { ...@@ -129,7 +129,7 @@ const JobErrorView: React.FC = () => {
/> />
<ProTable <ProTable
columns={columns} columns={columns}
scroll={{ y: 230 }} scroll={{ y: 200 }}
dataSource={data} dataSource={data}
search={false} search={false}
toolBarRender={false} toolBarRender={false}
......
...@@ -23,11 +23,16 @@ import JobRecoveryView from '@/pages/Home/JobOverView/JobRecoveryView'; ...@@ -23,11 +23,16 @@ import JobRecoveryView from '@/pages/Home/JobOverView/JobRecoveryView';
import JobRunView from '@/pages/Home/JobOverView/JobRunView'; import JobRunView from '@/pages/Home/JobOverView/JobRunView';
import JobStatusPie from '@/pages/Home/JobOverView/JobStatusPie'; import JobStatusPie from '@/pages/Home/JobOverView/JobStatusPie';
import LoadScoreGauge from '@/pages/Home/JobOverView/LoadScoreGauge'; import LoadScoreGauge from '@/pages/Home/JobOverView/LoadScoreGauge';
import { l } from '@/utils/intl'; import {l} from '@/utils/intl';
import { ProCard } from '@ant-design/pro-components'; import {ProCard} from '@ant-design/pro-components';
import { Badge } from 'antd'; import {Badge} from 'antd';
import RcResizeObserver from 'rc-resize-observer'; import RcResizeObserver from 'rc-resize-observer';
import React, { useState } from 'react'; import React, {useState} from 'react';
const noPadding = {
paddingInline: '0',
paddingBlock: '0'
};
const JobOverView: React.FC = () => { const JobOverView: React.FC = () => {
const [split, setSplit] = useState<'vertical' | 'horizontal' | undefined>('vertical'); const [split, setSplit] = useState<'vertical' | 'horizontal' | undefined>('vertical');
...@@ -42,7 +47,7 @@ const JobOverView: React.FC = () => { ...@@ -42,7 +47,7 @@ const JobOverView: React.FC = () => {
<ProCard <ProCard
title={ title={
<> <>
<Badge status='processing' /> <Badge status='processing'/>
{l('home.job.metrics')} {l('home.job.metrics')}
</> </>
} }
...@@ -50,29 +55,30 @@ const JobOverView: React.FC = () => { ...@@ -50,29 +55,30 @@ const JobOverView: React.FC = () => {
bordered bordered
size='small' size='small'
split={split} split={split}
bodyStyle={noPadding}
> >
<ProCard split={split}> <ProCard split={split} bodyStyle={noPadding}>
<ProCard split='horizontal'> <ProCard split='horizontal'>
<ProCard bodyStyle={{ padding: '0 12px' }}> <ProCard bodyStyle={{padding: '0 12px'}}>
<JobRunView /> <JobRunView/>
</ProCard> </ProCard>
<ProCard bodyStyle={{ padding: '0 12px' }}> <ProCard bodyStyle={{padding: '0 12px'}}>
<JobFinishedView /> <JobFinishedView/>
</ProCard> </ProCard>
<ProCard bodyStyle={{ padding: '0 12px' }}> <ProCard bodyStyle={{padding: '0 12px'}}>
<JobRecoveryView /> <JobRecoveryView/>
</ProCard> </ProCard>
</ProCard> </ProCard>
<ProCard title={l('home.job.running.status')}> <ProCard title={l('home.job.running.status')} bodyStyle={noPadding}>
<JobStatusPie /> <JobStatusPie/>
</ProCard> </ProCard>
</ProCard> </ProCard>
<ProCard split={split}> <ProCard split={split} bodyStyle={noPadding}>
<ProCard title={l('home.server.load')}> <ProCard title={l('home.server.load')} bodyStyle={noPadding}>
<LoadScoreGauge /> <LoadScoreGauge/>
</ProCard> </ProCard>
<ProCard split='horizontal'> <ProCard split='horizontal' bodyStyle={noPadding}>
<JobErrorView /> <JobErrorView/>
</ProCard> </ProCard>
</ProCard> </ProCard>
</ProCard> </ProCard>
......
...@@ -25,12 +25,9 @@ const MainWithStyle = (props: any) => { ...@@ -25,12 +25,9 @@ const MainWithStyle = (props: any) => {
return ( return (
<div className={style.loginformMain} style={{ backgroundImage: `url('/icons/main-bg.svg')` }}> <div className={style.loginformMain} style={{ backgroundImage: `url('/icons/main-bg.svg')` }}>
<Scale> <img className={style.logo} src={Settings.logo} />
<img className={style.logo} src={Settings.logo} />
</Scale>
<div className={style.form}> <div className={style.form}>
<div className={style.top}> <div className={style.top}>
<div className={style.header}>Dinky</div>
<div className={style.desc}>{l('layouts.userLayout.title')}</div> <div className={style.desc}>{l('layouts.userLayout.title')}</div>
</div> </div>
{children} {children}
......
...@@ -17,16 +17,16 @@ ...@@ -17,16 +17,16 @@
* *
*/ */
import Pop from '@/components/Animation/Pop'; import SlowlyAppear from '@/components/Animation/SlowlyAppear';
import ConfigurationList from '@/pages/RegCenter/Cluster/Configuration/components/ConfigurationList'; import ConfigurationList from '@/pages/RegCenter/Cluster/Configuration/components/ConfigurationList';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
export default () => { export default () => {
return ( return (
<Pop> <SlowlyAppear>
<PageContainer title={false}> <PageContainer title={false}>
<ConfigurationList /> <ConfigurationList />
</PageContainer> </PageContainer>
</Pop> </SlowlyAppear>
); );
}; };
...@@ -17,16 +17,16 @@ ...@@ -17,16 +17,16 @@
* *
*/ */
import Pop from '@/components/Animation/Pop'; import SlowlyAppear from '@/components/Animation/SlowlyAppear';
import InstanceList from '@/pages/RegCenter/Cluster/Instance/components/InstanceList'; import InstanceList from '@/pages/RegCenter/Cluster/Instance/components/InstanceList';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
export default () => { export default () => {
return ( return (
<Pop> <SlowlyAppear>
<PageContainer title={false}> <PageContainer title={false}>
<InstanceList /> <InstanceList />
</PageContainer> </PageContainer>
</Pop> </SlowlyAppear>
); );
}; };
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import Pop from '@/components/Animation/Pop'; import SlowlyAppear from '@/components/Animation/SlowlyAppear';
import DataSourceTable from '@/pages/RegCenter/DataSource/components/DataSourceList'; import DataSourceTable from '@/pages/RegCenter/DataSource/components/DataSourceList';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
...@@ -24,10 +24,10 @@ import { PageContainer } from '@ant-design/pro-components'; ...@@ -24,10 +24,10 @@ import { PageContainer } from '@ant-design/pro-components';
*/ */
export default () => { export default () => {
return ( return (
<Pop> <SlowlyAppear>
<PageContainer title={false}> <PageContainer title={false}>
<DataSourceTable /> <DataSourceTable />
</PageContainer> </PageContainer>
</Pop> </SlowlyAppear>
); );
}; };
...@@ -17,16 +17,16 @@ ...@@ -17,16 +17,16 @@
* *
*/ */
import Scale from '@/components/Animation/Scale'; import SlowlyAppear from '@/components/Animation/SlowlyAppear';
import ResourceOverView from '@/pages/RegCenter/Resource/components/ResourceOverView'; import ResourceOverView from '@/pages/RegCenter/Resource/components/ResourceOverView';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
export default () => { export default () => {
return ( return (
<Scale> <SlowlyAppear>
<PageContainer breadcrumb={{ style: { display: 'none' } }} title={false}> <PageContainer breadcrumb={{ style: { display: 'none' } }} title={false}>
<ResourceOverView /> <ResourceOverView />
</PageContainer> </PageContainer>
</Scale> </SlowlyAppear>
); );
}; };
...@@ -17,13 +17,14 @@ ...@@ -17,13 +17,14 @@
import SettingOverView from '@/pages/SettingCenter/GlobalSetting/SettingOverView'; import SettingOverView from '@/pages/SettingCenter/GlobalSetting/SettingOverView';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
import SlowlyAppear from "@/components/Animation/SlowlyAppear";
export default () => { export default () => {
return ( return (
<> <SlowlyAppear>
<PageContainer title={false}> <PageContainer title={false}>
<SettingOverView /> <SettingOverView />
</PageContainer> </PageContainer>
</> </SlowlyAppear>
); );
}; };
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