Unverified Commit f8610dbb authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Optimization-2361][web] Optimize the display of job which unable to obtain the…

[Optimization-2361][web] Optimize the display of job which unable to obtain the latest status (#2526) * [Optimization-2361][web] Optimize the display of job which unable to obtain the latest status * add en --------- Co-authored-by: 's avatarwenmo <32723967+wenmo@users.noreply.github.com>
parent eb6136bd
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
export default { export default {
'button.check': 'Check',
'button.graph': 'DAG',
'button.create': 'Create', 'button.create': 'Create',
'button.close': 'Close', 'button.close': 'Close',
'button.daemon': 'Daemon Mode', 'button.daemon': 'Daemon Mode',
......
...@@ -160,6 +160,7 @@ export default { ...@@ -160,6 +160,7 @@ export default {
'devops.jobinfo.metrics.metricsItems': 'Metrics Items', 'devops.jobinfo.metrics.metricsItems': 'Metrics Items',
'devops.jobinfo.metrics.selected': 'Selected', 'devops.jobinfo.metrics.selected': 'Selected',
'devops.jobinfo.offline': 'Offline', 'devops.jobinfo.offline': 'Offline',
'devops.jobinfo.recently.job.status': 'View recently saved job status information',
'devops.jobinfo.reonline': 'Re-Online', 'devops.jobinfo.reonline': 'Re-Online',
'devops.jobinfo.restart': 'Restart', 'devops.jobinfo.restart': 'Restart',
'devops.jobinfo.savepoint.cancel': 'SavePoint Stop', 'devops.jobinfo.savepoint.cancel': 'SavePoint Stop',
...@@ -167,6 +168,7 @@ export default { ...@@ -167,6 +168,7 @@ export default {
'devops.jobinfo.savepoint.stop': 'SavePoint Pause', 'devops.jobinfo.savepoint.stop': 'SavePoint Pause',
'devops.jobinfo.savepoint.trigger': 'SavePoint Triggers', 'devops.jobinfo.savepoint.trigger': 'SavePoint Triggers',
'devops.jobinfo.smart_stop': 'Smart Stop', 'devops.jobinfo.smart_stop': 'Smart Stop',
'devops.jobinfo.unable.obtain.status': 'Unable to connect to Flink cluster to obtain the latest job status information',
'devops.jobinfo.version.delete': 'Delete Version', 'devops.jobinfo.version.delete': 'Delete Version',
'devops.jobinfo.version.delete.sure': 'Are you sure you want to remove this version?V{version}', 'devops.jobinfo.version.delete.sure': 'Are you sure you want to remove this version?V{version}',
'devops.jobinfo.version.latestVersion': 'Current Version', 'devops.jobinfo.version.latestVersion': 'Current Version',
...@@ -298,7 +300,7 @@ export default { ...@@ -298,7 +300,7 @@ export default {
* *
* */ * */
'pages.datastudio.editor.check': 'Check current FlinkSql', 'pages.datastudio.editor.check': 'Check',
'pages.datastudio.editor.debug': 'Debug', 'pages.datastudio.editor.debug': 'Debug',
'pages.datastudio.editor.exec': 'Execute', 'pages.datastudio.editor.exec': 'Execute',
'pages.datastudio.editor.exec.error': 'Task [{jobName}] execution failed', 'pages.datastudio.editor.exec.error': 'Task [{jobName}] execution failed',
...@@ -319,7 +321,7 @@ export default { ...@@ -319,7 +321,7 @@ export default {
'pages.datastudio.editor.notsave': 'Current changes are not saved! ', 'pages.datastudio.editor.notsave': 'Current changes are not saved! ',
'pages.datastudio.editor.notsave.note': 'pages.datastudio.editor.notsave.note':
'Continue will discard the changes, are you sure to continue?', 'Continue will discard the changes, are you sure to continue?',
'pages.datastudio.to.jobDetail': 'Operation Center', 'pages.datastudio.to.jobDetail': 'Operation',
'pages.datastudio.explain.validate': 'Validating...', 'pages.datastudio.explain.validate': 'Validating...',
'pages.datastudio.explain.validate.allright': 'All Right', 'pages.datastudio.explain.validate.allright': 'All Right',
'pages.datastudio.explain.validate.error': 'There are errors, a total of {errorCount}', 'pages.datastudio.explain.validate.error': 'There are errors, a total of {errorCount}',
......
...@@ -153,6 +153,7 @@ export default { ...@@ -153,6 +153,7 @@ export default {
'devops.jobinfo.metrics.metricsItems': '监控项列表', 'devops.jobinfo.metrics.metricsItems': '监控项列表',
'devops.jobinfo.metrics.selected': '已选择', 'devops.jobinfo.metrics.selected': '已选择',
'devops.jobinfo.offline': '下线', 'devops.jobinfo.offline': '下线',
'devops.jobinfo.recently.job.status': '查看最近保存的作业状态信息',
'devops.jobinfo.reonline': '重新上线', 'devops.jobinfo.reonline': '重新上线',
'devops.jobinfo.restart': '重新启动', 'devops.jobinfo.restart': '重新启动',
'devops.jobinfo.savepoint.cancel': 'SavePoint 停止', 'devops.jobinfo.savepoint.cancel': 'SavePoint 停止',
...@@ -160,6 +161,7 @@ export default { ...@@ -160,6 +161,7 @@ export default {
'devops.jobinfo.savepoint.stop': 'SavePoint 暂停', 'devops.jobinfo.savepoint.stop': 'SavePoint 暂停',
'devops.jobinfo.savepoint.trigger': 'SavePoint 触发', 'devops.jobinfo.savepoint.trigger': 'SavePoint 触发',
'devops.jobinfo.smart_stop': '智能停止', 'devops.jobinfo.smart_stop': '智能停止',
'devops.jobinfo.unable.obtain.status': '无法连接到 Flink 集群获取最新作业状态信息',
'devops.jobinfo.version.delete': '删除版本', 'devops.jobinfo.version.delete': '删除版本',
'devops.jobinfo.version.delete.sure': '确定删除此版本吗?V{version}', 'devops.jobinfo.version.delete.sure': '确定删除此版本吗?V{version}',
'devops.jobinfo.version.latestVersion': '当前版本', 'devops.jobinfo.version.latestVersion': '当前版本',
......
...@@ -29,7 +29,7 @@ import { handleGetOption, handleGetOptionWithoutMsg } from '@/services/BusinessC ...@@ -29,7 +29,7 @@ import { handleGetOption, handleGetOptionWithoutMsg } from '@/services/BusinessC
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { transformTableDataToCsv } from '@/utils/function'; import { transformTableDataToCsv } from '@/utils/function';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { FireOutlined, SearchOutlined } from '@ant-design/icons'; import { SearchOutlined } from '@ant-design/icons';
import { Highlight } from '@ant-design/pro-layout/es/components/Help/Search'; import { Highlight } from '@ant-design/pro-layout/es/components/Help/Search';
import { Button, Empty, Input, InputRef, Space, Table, Tag } from 'antd'; import { Button, Empty, Input, InputRef, Space, Table, Tag } from 'antd';
import { ColumnsType, ColumnType } from 'antd/es/table'; import { ColumnsType, ColumnType } from 'antd/es/table';
...@@ -203,9 +203,6 @@ const Result = (props: any) => { ...@@ -203,9 +203,6 @@ const Result = (props: any) => {
> >
{l('pages.datastudio.label.result.query.latest.data')} {l('pages.datastudio.label.result.query.latest.data')}
</Button> </Button>
<Tag color='blue' key={data.jid}>
<FireOutlined /> {data.jid}
</Tag>
</Space> </Space>
</> </>
) : undefined} ) : undefined}
......
...@@ -22,28 +22,45 @@ import { JobProps } from '@/pages/DevOps/JobDetail/data'; ...@@ -22,28 +22,45 @@ import { JobProps } from '@/pages/DevOps/JobDetail/data';
import FlinkTable from '@/pages/DevOps/JobDetail/JobOverview/components/FlinkTable'; import FlinkTable from '@/pages/DevOps/JobDetail/JobOverview/components/FlinkTable';
import JobDesc from '@/pages/DevOps/JobDetail/JobOverview/components/JobDesc'; import JobDesc from '@/pages/DevOps/JobDetail/JobOverview/components/JobDesc';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { Empty } from 'antd'; import { Button, Empty, Result } from 'antd';
import { useState } from 'react';
import { isStatusDone } from '../../function';
import { l } from '@/utils/intl';
const JobConfigTab = (props: JobProps) => { const JobConfigTab = (props: JobProps) => {
const { jobDetail } = props; const { jobDetail } = props;
const job = jobDetail?.jobDataDto?.job; const job = jobDetail?.jobDataDto?.job;
const [showHistory, setShowHistory] = useState<boolean>(false);
return ( return (
<> <>
<JobDesc jobDetail={jobDetail} /> {
isStatusDone(jobDetail?.instance?.status as string) && !showHistory ? <Result
status="warning"
title={l('devops.jobinfo.unable.obtain.status')}
extra={
<Button type="primary" key="console" onClick={()=>{setShowHistory(true)}}>
{l('devops.jobinfo.recently.job.status')}
</Button>
}
/> : undefined
}
{(showHistory || !isStatusDone(jobDetail?.instance?.status as string)) ?
<><JobDesc jobDetail={jobDetail}/>
<ProCard <ProCard
style={{ style={{
height: '40vh' height: '40vh'
}} }}
> >
{job ? ( {job ? (
<FlinkDag job={job} checkPoints={jobDetail.jobDataDto.checkpoints} /> <FlinkDag job={job} checkPoints={jobDetail.jobDataDto.checkpoints}/>
) : ( ) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/>
)} )}
</ProCard> </ProCard>
<FlinkTable jobDetail={jobDetail} /> <FlinkTable jobDetail={jobDetail} /></> : undefined
}
</> </>
); );
}; };
......
...@@ -36,6 +36,7 @@ import { useRequest } from '@umijs/max'; ...@@ -36,6 +36,7 @@ import { useRequest } from '@umijs/max';
import { Tag } from 'antd'; import { Tag } from 'antd';
import { useState } from 'react'; import { useState } from 'react';
import { connect, useLocation } from 'umi'; import { connect, useLocation } from 'umi';
import StatusTag from "@/components/JobTags/StatusTag";
/** /**
* Enum defining different operators for the JobDetail component. * Enum defining different operators for the JobDetail component.
...@@ -129,6 +130,7 @@ const JobDetail = (props: any) => { ...@@ -129,6 +130,7 @@ const JobDetail = (props: any) => {
tabList={JobOperatorTabs} tabList={JobOperatorTabs}
onTabChange={(key) => setTabKey(key)} onTabChange={(key) => setTabKey(key)}
tags={[ tags={[
<StatusTag status={jobInfoDetail?.instance?.status} />,
<Tag key={'tg1'} color='blue'> <Tag key={'tg1'} color='blue'>
<FireOutlined /> {jobInfoDetail?.instance?.jid} <FireOutlined /> {jobInfoDetail?.instance?.jid}
</Tag>, </Tag>,
......
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