Unverified Commit 20272b32 authored by ZackYoung's avatar ZackYoung Committed by GitHub

add_clear_page_cache (#2348)

parent 21b2c228
...@@ -19,91 +19,103 @@ ...@@ -19,91 +19,103 @@
import DagDataNode from '@/components/FlinkDag/component/DagDataNode'; import DagDataNode from '@/components/FlinkDag/component/DagDataNode';
import DagPlanNode from '@/components/FlinkDag/component/DagPlanNode'; import DagPlanNode from '@/components/FlinkDag/component/DagPlanNode';
import { edgeConfig, graphConfig, layoutConfig, portConfig } from '@/components/FlinkDag/config'; import {edgeConfig, graphConfig, layoutConfig, portConfig} from '@/components/FlinkDag/config';
import { buildDag, regConnect, updateDag } from '@/components/FlinkDag/functions'; import {buildDag, regConnect, updateDag} from '@/components/FlinkDag/functions';
import { Jobs } from '@/types/DevOps/data'; import {Jobs} from '@/types/DevOps/data';
import { DagreLayout } from '@antv/layout'; import {DagreLayout} from '@antv/layout';
import { Edge, Graph } from '@antv/x6'; import {Edge, Graph} from '@antv/x6';
import { register } from '@antv/x6-react-shape'; import {register} from '@antv/x6-react-shape';
import { useEffect, useRef, useState } from 'react'; import {useEffect, useRef, useState} from 'react';
import './index.css'; import './index.css';
import {Slider} from "antd";
import {z} from "@umijs/utils/compiled/zod";
export type DagProps = { export type DagProps = {
job: Jobs.Job; job: Jobs.Job;
onlyPlan?: boolean; onlyPlan?: boolean;
}; };
const FlinkDag = (props: DagProps) => { const FlinkDag = (props: DagProps) => {
const container = useRef(null); const container = useRef(null);
const { job, onlyPlan = false } = props; const {job, onlyPlan = false} = props;
const [graph, setGraph] = useState<Graph>(); const [graph, setGraph] = useState<Graph>();
const [curentJob, setCurentJob] = useState<string>(); const [zoom, setZoom] = useState<number>(1);
const [currentJob, setCurrentJob] = useState<string>();
const initGraph = (flinkData: any) => { const initGraph = (flinkData: any) => {
register({ register({
shape: 'data-processing-dag-node', shape: 'data-processing-dag-node',
width: 212, width: 212,
height: 48, height: 48,
component: onlyPlan ? DagPlanNode : DagDataNode, component: onlyPlan ? DagPlanNode : DagDataNode,
ports: portConfig ports: portConfig
}); });
Edge.config(edgeConfig); Edge.config(edgeConfig);
Graph.registerConnector('curveConnector', regConnect, true); Graph.registerConnector('curveConnector', regConnect, true);
Graph.registerEdge('data-processing-curve', Edge, true); Graph.registerEdge('data-processing-curve', Edge, true);
const graph: Graph = new Graph({ const graph: Graph = new Graph({
// @ts-ignore // @ts-ignore
container: container.current, container: container.current,
...graphConfig ...graphConfig
}); });
// Adaptive layout // Adaptive layout
const dagreLayout = new DagreLayout(layoutConfig); const dagreLayout = new DagreLayout(layoutConfig);
const model = dagreLayout.layout(flinkData); const model = dagreLayout.layout(flinkData);
graph.fromJSON(model); graph.fromJSON(model);
// Automatically zoom to fit // Automatically zoom to fit
const zoomOptions = { const zoomOptions = {
padding: { padding: {
left: 50, left: 50,
right: 50, right: 50,
bottom: 100 bottom: 100
} },
};
graph.zoomToFit(zoomOptions);
graph.centerContent();
graph.on('scale', ({ sx }) => setZoom(sx))
updateDag(job.vertices, graph);
return graph;
}; };
graph.zoomToFit(zoomOptions);
graph.centerContent();
updateDag(job.vertices, graph);
return graph;
};
useEffect(() => { useEffect(() => {
const flinkData = buildDag(job.plan); const flinkData = buildDag(job.plan);
// Clean up old data // Clean up old data
if (graph) { if (graph) {
graph.clearCells(); graph.clearCells();
} }
setGraph(initGraph(flinkData)); setGraph(initGraph(flinkData));
}, [curentJob]); }, [currentJob]);
useEffect(() => {
graph?.zoomTo(zoom)
}, [zoom]);
useEffect(() => { useEffect(() => {
updateDag(job.vertices, graph); updateDag(job.vertices, graph);
if (curentJob != job.jid) { if (currentJob != job.jid) {
setCurentJob(job.jid); setCurrentJob(job.jid);
} }
}, [job]); }, [job]);
return ( return (
<div <span>
style={{ <div style={{height: 200, position: "absolute", top: "50%", right: 12, marginTop: -100,zIndex:999999999}}>
height: '100%', <Slider vertical value={zoom} min={0.5} max={1.5} tooltip={{open:false}} step={0.01} onChange={setZoom}/>
width: '100%' </div>
}} <div
ref={container} style={{
/> height: '100%',
); width: '100%'
}}
ref={container}
/>
</span>
);
}; };
export default FlinkDag; export default FlinkDag;
...@@ -19,7 +19,7 @@ import { chooseTenantSubmit, outLogin } from '@/services/BusinessCrud'; ...@@ -19,7 +19,7 @@ import { chooseTenantSubmit, outLogin } from '@/services/BusinessCrud';
import { setTenantStorageAndCookie } from '@/utils/function'; import { setTenantStorageAndCookie } from '@/utils/function';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { ErrorNotification, SuccessNotification } from '@/utils/messages'; import { ErrorNotification, SuccessNotification } from '@/utils/messages';
import { LogoutOutlined, TeamOutlined, UserOutlined, UserSwitchOutlined } from '@ant-design/icons'; import {ClearOutlined, LogoutOutlined, TeamOutlined, UserOutlined, UserSwitchOutlined} from '@ant-design/icons';
import { setAlpha } from '@ant-design/pro-components'; import { setAlpha } from '@ant-design/pro-components';
import { useEmotionCss } from '@ant-design/use-emotion-css'; import { useEmotionCss } from '@ant-design/use-emotion-css';
import { history, useModel } from '@umijs/max'; import { history, useModel } from '@umijs/max';
...@@ -212,6 +212,18 @@ const AvatarDropdown = () => { ...@@ -212,6 +212,18 @@ const AvatarDropdown = () => {
{ {
type: 'divider' as const type: 'divider' as const
}, },
{
key: 'clearPageCache',
icon: <ClearOutlined />,
label: l('menu.account.clearPageCache'),
onClick: ()=>{
window.localStorage.removeItem('persist:root');
window.location.reload();
}
},
{
type: 'divider' as const
},
{ {
key: 'logout', key: 'logout',
icon: <LogoutOutlined />, icon: <LogoutOutlined />,
......
...@@ -18,184 +18,185 @@ ...@@ -18,184 +18,185 @@
*/ */
export default { export default {
'button.create': 'Create', 'button.create': 'Create',
'button.close': 'Close', 'button.close': 'Close',
'button.confirm': 'Confirm', 'button.confirm': 'Confirm',
'button.recovery': 'Recovery', 'button.recovery': 'Recovery',
'button.cancel': 'Cancel', 'button.cancel': 'Cancel',
'button.finish': 'Finish', 'button.finish': 'Finish',
'button.back': 'Back', 'button.back': 'Back',
'button.save': 'Save', 'button.save': 'Save',
'button.delete': 'Delete', 'button.delete': 'Delete',
'button.batchDelete': 'Batch Delete', 'button.batchDelete': 'Batch Delete',
'button.batchEnable': 'Batch Enable', 'button.batchEnable': 'Batch Enable',
'button.batchDisable': 'Batch Disable', 'button.batchDisable': 'Batch Disable',
'button.more': 'More', 'button.more': 'More',
'button.config': 'Config', 'button.config': 'Config',
'button.modify': 'Modify', 'button.modify': 'Modify',
'button.edit': 'Edit', 'button.edit': 'Edit',
'button.start': 'Start', 'button.start': 'Start',
'button.stop': 'Stop', 'button.stop': 'Stop',
'button.assignUser': 'Assign Users', 'button.assignUser': 'Assign Users',
'button.assignRole': 'Assign Role', 'button.assignRole': 'Assign Role',
'button.changePassword': 'Change Password', 'button.changePassword': 'Change Password',
'button.enable': 'Enable', 'button.enable': 'Enable',
'button.disable': 'Disable', 'button.disable': 'Disable',
'button.reset': 'Reset', 'button.reset': 'Reset',
'button.search': 'Search', 'button.search': 'Search',
'button.upload': 'Upload', 'button.upload': 'Upload',
'button.import': 'Import', 'button.import': 'Import',
'button.export': 'Export', 'button.export': 'Export',
'button.submit': 'Submit', 'button.submit': 'Submit',
'button.createDir': 'Create Directory', 'button.createDir': 'Create Directory',
'button.heartbeat': 'Heartbeat', 'button.heartbeat': 'Heartbeat',
'button.recycle': 'Recycle', 'button.recycle': 'Recycle',
'button.refresh': 'Refresh', 'button.refresh': 'Refresh',
'button.expand-all': 'Expand All', 'button.expand-all': 'Expand All',
'button.collapse-all': 'Collapse All', 'button.collapse-all': 'Collapse All',
'button.test': 'Test', 'button.test': 'Test',
'button.clear': 'Clear', 'button.clear': 'Clear',
'button.copy': 'Copy', 'button.copy': 'Copy',
'button.refreshData': 'Refresh Data', 'button.refreshData': 'Refresh Data',
'button.collapseDir': 'Collapse Directory', 'button.collapseDir': 'Collapse Directory',
'button.asc': 'ASC', 'button.asc': 'ASC',
'button.desc': 'DESC', 'button.desc': 'DESC',
'button.query': 'Query', 'button.query': 'Query',
'button.exit': 'Exit', 'button.exit': 'Exit',
'button.build': 'Build', 'button.build': 'Build',
'button.next': 'Next', 'button.next': 'Next',
'button.prev': 'Previous', 'button.prev': 'Previous',
'button.showLog': 'Show Log', 'button.showLog': 'Show Log',
'button.showCode': 'Show Code', 'button.showCode': 'Show Code',
'button.backTop': 'Back Top', 'button.backTop': 'Back Top',
'button.backBottom': 'Back Bottom', 'button.backBottom': 'Back Bottom',
'button.downScroll': 'Down Scroll', 'button.downScroll': 'Down Scroll',
'button.upScroll': 'Up Scroll', 'button.upScroll': 'Up Scroll',
'button.stopRefresh': 'Stop Auto Refresh', 'button.stopRefresh': 'Stop Auto Refresh',
'button.startRefresh': 'Start Auto Refresh(5s/e)', 'button.startRefresh': 'Start Auto Refresh(5s/e)',
'menu.menu': 'Menu', 'menu.menu': 'Menu',
'right.menu.open': 'Open', 'right.menu.open': 'Open',
'right.menu.submit': 'Sync Submit', 'right.menu.submit': 'Sync Submit',
'right.menu.addSub': 'Add Sub Item', 'right.menu.addSub': 'Add Sub Item',
'right.menu.createSubFolder': 'Create Sub Folder', 'right.menu.createSubFolder': 'Create Sub Folder',
'right.menu.exportJson': 'Export JSON', 'right.menu.exportJson': 'Export JSON',
'right.menu.importJson': 'Import JSON', 'right.menu.importJson': 'Import JSON',
'right.menu.rename': 'Rename', 'right.menu.rename': 'Rename',
'right.menu.refresh': 'Refresh', 'right.menu.refresh': 'Refresh',
'right.menu.createFolder': 'Create Folder', 'right.menu.createFolder': 'Create Folder',
'right.menu.copy': 'Copy', 'right.menu.copy': 'Copy',
'right.menu.cut': 'Cut', 'right.menu.cut': 'Cut',
'right.menu.paste': 'Paste', 'right.menu.paste': 'Paste',
'right.menu.delete': 'Delete', 'right.menu.delete': 'Delete',
'right.menu.createCatalogue': 'Create Directory', 'right.menu.createCatalogue': 'Create Directory',
'right.menu.createRoot': 'Create Root Directory', 'right.menu.createRoot': 'Create Root Directory',
'right.menu.uploadZipToCreate': 'Upload Zip To Create', 'right.menu.uploadZipToCreate': 'Upload Zip To Create',
'right.menu.createTask': 'Create Task', 'right.menu.createTask': 'Create Task',
'right.menu.closeAll': 'Close All', 'right.menu.closeAll': 'Close All',
'right.menu.closeOther': 'Close Others', 'right.menu.closeOther': 'Close Others',
'tips.selected': 'Selected {total} Item', 'tips.selected': 'Selected {total} Item',
'tips.notSelected': 'Not Select', 'tips.notSelected': 'Not Select',
'tips.enter': 'Please Enter', 'tips.enter': 'Please Enter',
'tips.confirm.delete.table': ' Are you sure you want to delete table [{tableName}]?', 'tips.confirm.delete.table': ' Are you sure you want to delete table [{tableName}]?',
'status.enabled': 'Enabled', 'status.enabled': 'Enabled',
'status.disabled': 'Disabled', 'status.disabled': 'Disabled',
'global.time.second': 'S ', 'global.time.second': 'S ',
'global.time.minute': 'M ', 'global.time.minute': 'M ',
'global.time.hour': 'H ', 'global.time.hour': 'H ',
'global.time.day': 'D ', 'global.time.day': 'D ',
'global.time.millisecond': 'ms ', 'global.time.millisecond': 'ms ',
'global.stay.tuned': 'Stay tuned', 'global.stay.tuned': 'Stay tuned',
'global.mini': 'Mini Size', 'global.mini': 'Mini Size',
'global.max': 'Max Size', 'global.max': 'Max Size',
'global.table.operate': 'Operation', 'global.table.operate': 'Operation',
'global.table.config': 'Config', 'global.table.config': 'Config',
'global.table.edit': 'Edit', 'global.table.edit': 'Edit',
'global.table.delete': 'Delete', 'global.table.delete': 'Delete',
'global.table.more': 'More', 'global.table.more': 'More',
'global.table.updateTime': 'Update Time', 'global.table.updateTime': 'Update Time',
'global.table.lastUpdateTime': 'Last Update Time', 'global.table.lastUpdateTime': 'Last Update Time',
'global.table.createTime': 'Create Time', 'global.table.createTime': 'Create Time',
'global.table.startTime': 'Start Time', 'global.table.startTime': 'Start Time',
'global.table.startUpTime': 'StartUp Time', 'global.table.startUpTime': 'StartUp Time',
'global.table.endTime': 'End Time', 'global.table.endTime': 'End Time',
'global.table.finishTime': 'Finished Time', 'global.table.finishTime': 'Finished Time',
'global.table.useTime': 'Duration', 'global.table.useTime': 'Duration',
'global.table.registType': 'Regist Type', 'global.table.registType': 'Regist Type',
'global.table.registType.manual': 'Manual', 'global.table.registType.manual': 'Manual',
'global.table.registType.automatic': 'Automatic', 'global.table.registType.automatic': 'Automatic',
'global.table.isEnable': 'Is Enable', 'global.table.isEnable': 'Is Enable',
'global.table.note': 'Note', 'global.table.note': 'Note',
'global.table.status': 'Status', 'global.table.status': 'Status',
'global.table.jobid': 'Job ID',
'global.table.notePlaceholder': 'please input Note',
'global.table.status.normal': 'Normal', 'global.table.notePlaceholder': 'please input Note',
'global.table.status.abnormal': 'Abnormal', 'global.table.status.normal': 'Normal',
'global.table.status.abnormal': 'Abnormal',
'global.table.jobname': 'Job Name',
'global.table.lifecycle': 'Life Cycle', 'global.table.jobname': 'Job Name',
'global.table.lifecycle.all': 'All', 'global.table.lifecycle': 'Life Cycle',
'global.table.lifecycle.dev': 'Develop', 'global.table.lifecycle.all': 'All',
'global.table.execmode.batch': 'Batch Mode', 'global.table.lifecycle.dev': 'Develop',
'global.table.execmode.streaming': 'Stream Mode', 'global.table.execmode.batch': 'Batch Mode',
'global.table.lifecycle.publish': 'Publish', 'global.table.execmode.streaming': 'Stream Mode',
'global.table.lifecycle.online': 'Online', 'global.table.lifecycle.publish': 'Publish',
'global.table.lifecycle.unknown': 'Unknown', 'global.table.lifecycle.online': 'Online',
'global.table.execmode': 'Execution mode', 'global.table.lifecycle.unknown': 'Unknown',
'global.table.runmode': 'Run Mode', 'global.table.execmode': 'Execution mode',
'global.table.runmode.local': 'Local', 'global.table.runmode': 'Run Mode',
'global.table.runmode.remote': 'Remote', 'global.table.runmode.local': 'Local',
'global.table.runmode.remote': 'Remote',
'global.search.text': 'Input Key to Search',
'global.search.text': 'Input Key to Search',
'global.savepoint.strategy.disabled': 'Disabled',
'global.savepoint.strategy.latest': 'Latest', 'global.savepoint.strategy.disabled': 'Disabled',
'global.savepoint.strategy.earliest': 'Earliest', 'global.savepoint.strategy.latest': 'Latest',
'global.savepoint.strategy.custom': 'Custom', 'global.savepoint.strategy.earliest': 'Earliest',
'global.savepoint.strategy.custom': 'Custom',
'global.fullScreen': 'FullScreen',
'global.fullScreen.exit': 'Exit FullScreen', 'global.fullScreen': 'FullScreen',
'global.yes': 'Yes', 'global.fullScreen.exit': 'Exit FullScreen',
'global.no': 'No', 'global.yes': 'Yes',
'global.no': 'No',
'global.info': 'Info',
'global.error': 'Error', 'global.info': 'Info',
'global.result': 'Result', 'global.error': 'Error',
'global.warning': 'Warning', 'global.result': 'Result',
'global.success': 'Success', 'global.warning': 'Warning',
'global.getdata.tips': 'Get Data', 'global.success': 'Success',
'global.getdata.tips': 'Get Data',
'global.notification.iknow': 'I understand',
'global.notification.full-error': 'Complete error message', 'global.notification.iknow': 'I understand',
'global.notification.full-error': 'Complete error message',
'global.item': 'Pieces',
'global.bout': 'Times', 'global.item': 'Pieces',
'global.size': ' Size: {size}', 'global.bout': 'Times',
'global.size': ' Size: {size}',
'global.week.sunday': 'Sunday',
'global.week.monday': 'Monday', 'global.week.sunday': 'Sunday',
'global.week.tuesday': 'Tuesday', 'global.week.monday': 'Monday',
'global.week.wednesday': 'Wednesday', 'global.week.tuesday': 'Tuesday',
'global.week.thursday': 'Thursday', 'global.week.wednesday': 'Wednesday',
'global.week.friday': 'Friday', 'global.week.thursday': 'Thursday',
'global.week.saturday': 'Saturday', 'global.week.friday': 'Friday',
'global.month.january': 'January', 'global.week.saturday': 'Saturday',
'global.month.february': 'February', 'global.month.january': 'January',
'global.month.march': 'March', 'global.month.february': 'February',
'global.month.april': 'April', 'global.month.march': 'March',
'global.month.may': 'May', 'global.month.april': 'April',
'global.month.june': 'June', 'global.month.may': 'May',
'global.month.july': 'July', 'global.month.june': 'June',
'global.month.august': 'August', 'global.month.july': 'July',
'global.month.september': 'September', 'global.month.august': 'August',
'global.month.october': 'October', 'global.month.september': 'September',
'global.month.november': 'November', 'global.month.october': 'October',
'global.month.december': 'December' 'global.month.november': 'November',
'global.month.december': 'December'
}; };
...@@ -31,6 +31,7 @@ export default { ...@@ -31,6 +31,7 @@ export default {
'menu.account.tenant': 'Tenant: {tenantCode}', 'menu.account.tenant': 'Tenant: {tenantCode}',
'menu.account.center': 'Account Center', 'menu.account.center': 'Account Center',
'menu.account.logout': 'Logout', 'menu.account.logout': 'Logout',
'menu.account.clearPageCache': 'Clear Page Cache',
'menu.account.changePassword': 'Change Password', 'menu.account.changePassword': 'Change Password',
'menu.account.checkTenant': 'Switch Tenant', 'menu.account.checkTenant': 'Switch Tenant',
'menu.account.checkTenantConfirm': 'Are you sure to switch tenant [ {tenantCode} ] ?', 'menu.account.checkTenantConfirm': 'Are you sure to switch tenant [ {tenantCode} ] ?',
......
...@@ -132,6 +132,8 @@ export default { ...@@ -132,6 +132,8 @@ export default {
'global.table.isEnable': '是否启用', 'global.table.isEnable': '是否启用',
'global.table.note': '备注', 'global.table.note': '备注',
'global.table.notePlaceholder': '请输入描述/备注!', 'global.table.notePlaceholder': '请输入描述/备注!',
'global.table.jobid': '作业 ID',
'global.table.status': '状态', 'global.table.status': '状态',
'global.table.status.normal': '正常', 'global.table.status.normal': '正常',
'global.table.status.abnormal': '异常', 'global.table.status.abnormal': '异常',
......
...@@ -31,6 +31,7 @@ export default { ...@@ -31,6 +31,7 @@ export default {
'menu.account.tenant': '租户: {tenantCode}', 'menu.account.tenant': '租户: {tenantCode}',
'menu.account.settings': '个人设置', 'menu.account.settings': '个人设置',
'menu.account.logout': '退出登录', 'menu.account.logout': '退出登录',
'menu.account.clearPageCache': '清除页面缓存',
'menu.account.changePassword': '修改密码', 'menu.account.changePassword': '修改密码',
'menu.account.checkTenant': '切换租户', 'menu.account.checkTenant': '切换租户',
'menu.account.checkTenantConfirm': '你确定切换租户【{tenantCode}】吗?', 'menu.account.checkTenantConfirm': '你确定切换租户【{tenantCode}】吗?',
......
...@@ -181,23 +181,7 @@ const HeaderContainer = (props: any) => { ...@@ -181,23 +181,7 @@ const HeaderContainer = (props: any) => {
(getCurrentTab(panes, activeKey)?.params as DataStudioParams).taskData.jobInstanceId = (getCurrentTab(panes, activeKey)?.params as DataStudioParams).taskData.jobInstanceId =
res.datas.jobInstanceId; res.datas.jobInstanceId;
saveTabs({ ...props.tabs }); saveTabs({ ...props.tabs });
} else {
ErrorNotification(
res.datas.error,
l('pages.datastudio.editor.exec.error', '', { jobName: param.name }),
null
);
} }
// let newTabs = tabs;
// for (const element of newTabs.panes) {
// if (element.key == key) {
// element.console.result = res.datas;
// break;
// }
// }
// props.saveTabs(newTabs);
// useSession && showTables(currentSession.session, dispatch);
} }
); );
}; };
......
...@@ -23,6 +23,7 @@ import { API_CONSTANTS } from '@/services/endpoints'; ...@@ -23,6 +23,7 @@ import { API_CONSTANTS } from '@/services/endpoints';
import { useRequest } from '@@/exports'; import { useRequest } from '@@/exports';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { Spin, Tabs, Typography } from 'antd'; import { Spin, Tabs, Typography } from 'antd';
import {EditorLanguage} from "monaco-editor/esm/metadata";
const { Text, Paragraph } = Typography; const { Text, Paragraph } = Typography;
...@@ -45,10 +46,17 @@ const JobManagerLogsTab = (props: JobProps) => { ...@@ -45,10 +46,17 @@ const JobManagerLogsTab = (props: JobProps) => {
params: { address: jmaddr } params: { address: jmaddr }
}); });
const getLog = (ur: any) => { const getLog = (ur: any,language?:EditorLanguage) => {
return ( return (
<Spin spinning={ur.loading}> <Spin spinning={ur.loading}>
<CodeShow code={ur.data ? ur.data : 'No Log'} height={600} /> <CodeShow language={language} code={ur.data ? ur.data : 'No Log'} height={600} />
</Spin>
);
};
const getDump = (ur: any) => {
return (
<Spin spinning={ur.loading}>
<CodeShow language={"kotlin"} code={ur.data ? (JSON.parse(ur.data)['threadInfos'] as any[]).map(x=>x['stringifiedThreadInfo']).join("") : 'No Log'} height={600} />
</Spin> </Spin>
); );
}; };
...@@ -58,9 +66,9 @@ const JobManagerLogsTab = (props: JobProps) => { ...@@ -58,9 +66,9 @@ const JobManagerLogsTab = (props: JobProps) => {
<Tabs <Tabs
size={'small'} size={'small'}
items={[ items={[
{ label: 'Log', key: 'LOG', children: getLog(log) }, { label: 'Log', key: 'LOG', children: getLog(log,"java") },
{ label: 'Std Out', key: 'STDOUT', children: getLog(stdout) }, { label: 'Std Out', key: 'STDOUT', children: getLog(stdout) },
{ label: 'Thread Dump', key: 'DUMP', children: getLog(dump) } { label: 'Thread Dump', key: 'DUMP', children: getDump(dump) }
]} ]}
/> />
</ProCard> </ProCard>
......
...@@ -6,7 +6,7 @@ import { queryList } from '@/services/api'; ...@@ -6,7 +6,7 @@ import { queryList } from '@/services/api';
import { PROTABLE_OPTIONS_PUBLIC } from '@/services/constants'; import { PROTABLE_OPTIONS_PUBLIC } from '@/services/constants';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { Jobs } from '@/types/DevOps/data'; import { Jobs } from '@/types/DevOps/data';
import { parseSecondStr } from '@/utils/function'; import {parseMilliSecondStr, parseSecondStr} from '@/utils/function';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { ClockCircleTwoTone, EyeTwoTone } from '@ant-design/icons'; import { ClockCircleTwoTone, EyeTwoTone } from '@ant-design/icons';
import type { ActionType, ProColumns } from '@ant-design/pro-components'; import type { ActionType, ProColumns } from '@ant-design/pro-components';
...@@ -53,7 +53,7 @@ const JobList = () => { ...@@ -53,7 +53,7 @@ const JobList = () => {
{ {
title: l('global.table.useTime'), title: l('global.table.useTime'),
hideInSearch: true, hideInSearch: true,
render: (_: any, row: Jobs.JobInstance) => parseSecondStr(row.duration) render: (_: any, row: Jobs.JobInstance) => parseMilliSecondStr(row.duration)
}, },
{ {
title: l('global.table.status'), title: l('global.table.status'),
......
...@@ -32,6 +32,7 @@ interface DataType { ...@@ -32,6 +32,7 @@ interface DataType {
rank: React.Key; rank: React.Key;
name: string; name: string;
value: number; value: number;
key: string;
} }
const JobErrorView: React.FC = () => { const JobErrorView: React.FC = () => {
...@@ -39,42 +40,50 @@ const JobErrorView: React.FC = () => { ...@@ -39,42 +40,50 @@ const JobErrorView: React.FC = () => {
{ {
rank: 1, rank: 1,
name: '任务1', name: '任务1',
value: 10000 value: 10000,
key: '任务1'
}, },
{ {
rank: 2, rank: 2,
name: '任务2', name: '任务2',
value: 20000 value: 20000,
key: '任务2'
}, },
{ {
rank: 3, rank: 3,
name: '任务3', name: '任务3',
value: 30000 value: 30000,
key: '任务3'
}, },
{ {
rank: 4, rank: 4,
name: '任务4', name: '任务4',
value: 40000 value: 40000,
key: '任务4'
}, },
{ {
rank: 5, rank: 5,
name: '任务5', name: '任务5',
value: 50000 value: 50000,
key: '任务5'
}, },
{ {
rank: 6, rank: 6,
name: '任务6', name: '任务6',
value: 60000 value: 60000,
key: '任务6'
}, },
{ {
rank: 7, rank: 7,
name: '任务7', name: '任务7',
value: 70000 value: 70000,
key: '任务7'
}, },
{ {
rank: 8, rank: 8,
name: '任务8', name: '任务8',
value: 80000 value: 80000,
key: '任务8'
} }
]); ]);
......
...@@ -23,67 +23,70 @@ import JobRecoveryView from '@/pages/Home/JobOverView/JobRecoveryView'; ...@@ -23,67 +23,70 @@ 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 = { const noPadding = {
paddingInline: '0', paddingInline: '0',
paddingBlock: '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');
return ( return (
<RcResizeObserver <RcResizeObserver.Collection>
key='resize-observer' <RcResizeObserver
onResize={(offset) => { key='resize-observer'
setSplit(offset.width < 596 ? 'horizontal' : 'vertical'); onResize={(offset) => {
}} setSplit(offset.width < 596 ? 'horizontal' : 'vertical');
> }}
<ProCard >
title={ <ProCard
<> title={
<Badge status='processing' /> <>
{l('home.job.metrics')} <Badge status='processing'/>
</> {l('home.job.metrics')}
} </>
headerBordered }
bordered headerBordered
size='small' bordered
split={split} size='small'
bodyStyle={noPadding} split={split}
> bodyStyle={noPadding}
<ProCard split={split} bodyStyle={noPadding}> >
<ProCard split='horizontal'> <ProCard split={split} bodyStyle={noPadding}>
<ProCard bodyStyle={{ padding: '0 12px' }}> <ProCard split='horizontal'>
<JobRunView /> <ProCard bodyStyle={{padding: '0 12px'}}>
</ProCard> <JobRunView/>
<ProCard bodyStyle={{ padding: '0 12px' }}> </ProCard>
<JobFinishedView /> <ProCard bodyStyle={{padding: '0 12px'}}>
</ProCard> <JobFinishedView/>
<ProCard bodyStyle={{ padding: '0 12px' }}> </ProCard>
<JobRecoveryView /> <ProCard bodyStyle={{padding: '0 12px'}}>
</ProCard> <JobRecoveryView/>
</ProCard> </ProCard>
<ProCard title={l('home.job.running.status')} bodyStyle={noPadding}> </ProCard>
<JobStatusPie /> <ProCard title={l('home.job.running.status')} bodyStyle={noPadding}>
</ProCard> <JobStatusPie/>
</ProCard> </ProCard>
<ProCard split={split} bodyStyle={noPadding}> </ProCard>
<ProCard title={l('home.server.load')} bodyStyle={noPadding}> <ProCard split={split} bodyStyle={noPadding}>
<LoadScoreGauge /> <ProCard title={l('home.server.load')} bodyStyle={noPadding}>
</ProCard> <LoadScoreGauge/>
<ProCard split='horizontal' bodyStyle={noPadding}> </ProCard>
<JobErrorView /> <ProCard split='horizontal' bodyStyle={noPadding}>
</ProCard> <JobErrorView/>
</ProCard> </ProCard>
</ProCard> </ProCard>
</RcResizeObserver> </ProCard>
);
</RcResizeObserver>
</RcResizeObserver.Collection>
);
}; };
export default JobOverView; export default JobOverView;
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