Unverified Commit 873ffedf authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

hotfix datasource cannot save bug (#2527)

* hotfix datasource cannot save bug * Spotless Apply * fix --------- Co-authored-by: 's avatarzhu-mingye <zhu-mingye@users.noreply.github.com>
parent f8610dbb
...@@ -78,7 +78,7 @@ public class DataBaseController { ...@@ -78,7 +78,7 @@ public class DataBaseController {
* @param dataBaseDTO {@link DataBaseDTO} * @param dataBaseDTO {@link DataBaseDTO}
* @return {@link Result}< {@link Void}> * @return {@link Result}< {@link Void}>
*/ */
@PutMapping @PutMapping("/saveOrUpdate")
@Log(title = "Insert Or Update DataBase", businessType = BusinessType.INSERT_OR_UPDATE) @Log(title = "Insert Or Update DataBase", businessType = BusinessType.INSERT_OR_UPDATE)
@ApiOperation("Insert Or Update DataBase") @ApiOperation("Insert Or Update DataBase")
@ApiImplicitParam( @ApiImplicitParam(
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* *
*/ */
import { l } from '@/utils/intl';
import { WarningMessage } from '@/utils/messages';
import { Transfer, Tree } from 'antd'; import { Transfer, Tree } from 'antd';
import type { TransferDirection, TransferItem } from 'antd/es/transfer'; import type { TransferDirection, TransferItem } from 'antd/es/transfer';
import type { DataNode } from 'antd/es/tree'; import type { DataNode } from 'antd/es/tree';
...@@ -75,11 +77,19 @@ export const TreeTransfer: React.FC<TreeTransferProps> = ({ ...@@ -75,11 +77,19 @@ export const TreeTransfer: React.FC<TreeTransferProps> = ({
defaultExpandAll defaultExpandAll
checkedKeys={checkedKeys} checkedKeys={checkedKeys}
treeData={generateTree(dataSource, targetKeys)} treeData={generateTree(dataSource, targetKeys)}
onCheck={(_, { node: { key } }) => { onCheck={async (_, { node: { key, isLeaf } }) => {
if (isLeaf) {
onItemSelect(key as string, !isChecked(checkedKeys, key)); onItemSelect(key as string, !isChecked(checkedKeys, key));
} else {
WarningMessage(l('rc.udf.register.select'));
}
}} }}
onSelect={(_, { node: { key } }) => { onSelect={async (_, { node: { key, isLeaf } }) => {
if (isLeaf) {
onItemSelect(key as string, !isChecked(checkedKeys, key)); onItemSelect(key as string, !isChecked(checkedKeys, key));
} else {
WarningMessage(l('rc.udf.register.select'));
}
}} }}
/> />
); );
......
...@@ -168,7 +168,8 @@ export default { ...@@ -168,7 +168,8 @@ 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.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',
...@@ -857,6 +858,7 @@ export default { ...@@ -857,6 +858,7 @@ export default {
'rc.udf.register.className': 'Class Name', 'rc.udf.register.className': 'Class Name',
'rc.udf.register.deleteConfirm': 'Are you sure you want to delete this UDF? ', 'rc.udf.register.deleteConfirm': 'Are you sure you want to delete this UDF? ',
'rc.udf.register': 'Register UDF', 'rc.udf.register': 'Register UDF',
'rc.udf.register.select': 'Please select a non-directory node',
/** /**
* *
* role * role
......
...@@ -818,6 +818,7 @@ export default { ...@@ -818,6 +818,7 @@ export default {
'rc.udf.register.className': '类名', 'rc.udf.register.className': '类名',
'rc.udf.register.deleteConfirm': '确定删除该 UDF 吗?', 'rc.udf.register.deleteConfirm': '确定删除该 UDF 吗?',
'rc.udf.register': '注册 UDF', 'rc.udf.register': '注册 UDF',
'rc.udf.register.select': '请选择非目录节点!',
/** /**
* *
......
...@@ -31,7 +31,7 @@ import { transformTableDataToCsv } from '@/utils/function'; ...@@ -31,7 +31,7 @@ import { transformTableDataToCsv } from '@/utils/function';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { 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 } from 'antd';
import { ColumnsType, ColumnType } from 'antd/es/table'; import { ColumnsType, ColumnType } from 'antd/es/table';
import { FilterConfirmProps } from 'antd/es/table/interface'; import { FilterConfirmProps } from 'antd/es/table/interface';
import { DataIndex } from 'rc-table/es/interface'; import { DataIndex } from 'rc-table/es/interface';
......
...@@ -21,11 +21,11 @@ import FlinkDag from '@/components/FlinkDag'; ...@@ -21,11 +21,11 @@ import FlinkDag from '@/components/FlinkDag';
import { JobProps } from '@/pages/DevOps/JobDetail/data'; 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 { l } from '@/utils/intl';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { Button, Empty, Result } from 'antd'; import { Button, Empty, Result } from 'antd';
import { useState } from 'react'; import { useState } from 'react';
import { isStatusDone } from '../../function'; import { isStatusDone } from '../../function';
import { l } from '@/utils/intl';
const JobConfigTab = (props: JobProps) => { const JobConfigTab = (props: JobProps) => {
const { jobDetail } = props; const { jobDetail } = props;
...@@ -34,33 +34,41 @@ const JobConfigTab = (props: JobProps) => { ...@@ -34,33 +34,41 @@ const JobConfigTab = (props: JobProps) => {
return ( return (
<> <>
{ {isStatusDone(jobDetail?.instance?.status as string) && !showHistory ? (
isStatusDone(jobDetail?.instance?.status as string) && !showHistory ? <Result <Result
status="warning" status='warning'
title={l('devops.jobinfo.unable.obtain.status')} title={l('devops.jobinfo.unable.obtain.status')}
extra={ extra={
<Button type="primary" key="console" onClick={()=>{setShowHistory(true)}}> <Button
type='primary'
key='console'
onClick={() => {
setShowHistory(true);
}}
>
{l('devops.jobinfo.recently.job.status')} {l('devops.jobinfo.recently.job.status')}
</Button> </Button>
} }
/> : undefined />
} ) : undefined}
{(showHistory || !isStatusDone(jobDetail?.instance?.status as string)) ? {showHistory || !isStatusDone(jobDetail?.instance?.status as string) ? (
<><JobDesc jobDetail={jobDetail}/> <>
<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} /></> : undefined <FlinkTable jobDetail={jobDetail} />
} </>
) : undefined}
</> </>
); );
}; };
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
import JobLifeCycleTag from '@/components/JobTags/JobLifeCycleTag'; import JobLifeCycleTag from '@/components/JobTags/JobLifeCycleTag';
import StatusTag from '@/components/JobTags/StatusTag';
import AlertHistory from '@/pages/DevOps/JobDetail/AlertHistory'; import AlertHistory from '@/pages/DevOps/JobDetail/AlertHistory';
import CheckPoints from '@/pages/DevOps/JobDetail/CheckPointsTab'; import CheckPoints from '@/pages/DevOps/JobDetail/CheckPointsTab';
import JobLineage from '@/pages/DevOps/JobDetail/JobLineage'; import JobLineage from '@/pages/DevOps/JobDetail/JobLineage';
...@@ -36,7 +37,6 @@ import { useRequest } from '@umijs/max'; ...@@ -36,7 +37,6 @@ 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.
......
...@@ -35,5 +35,5 @@ export const handleTest = async (item: Partial<DataSources.DataSource>) => { ...@@ -35,5 +35,5 @@ export const handleTest = async (item: Partial<DataSources.DataSource>) => {
* @param item * @param item
*/ */
export const saveOrUpdateHandle = async (item: Partial<DataSources.DataSource>) => { export const saveOrUpdateHandle = async (item: Partial<DataSources.DataSource>) => {
await handleAddOrUpdate(API_CONSTANTS.DATASOURCE, item); await handleAddOrUpdate(API_CONSTANTS.DATASOURCE_ADD_OR_UPDATE, item);
}; };
...@@ -113,13 +113,14 @@ export enum API_CONSTANTS { ...@@ -113,13 +113,14 @@ export enum API_CONSTANTS {
CLUSTER_CONFIGURATION_START = '/api/cluster/deploySessionClusterInstance', CLUSTER_CONFIGURATION_START = '/api/cluster/deploySessionClusterInstance',
// cluster configuration list // cluster configuration list
CLUSTER_CONFIGURATION = '/api/clusterConfiguration/list', CLUSTER_CONFIGURATION = '/api/clusterConfiguration/list',
CLUSTER_CONFIGURATION_ADD_OR_UPDATE = '/api/clusterConfiguration/addOrUpdate', CLUSTER_CONFIGURATION_ADD_OR_UPDATE = '/api/clusterConfiguration/saveOrUpdate',
CLUSTER_CONFIGURATION_DELETE = '/api/clusterConfiguration/delete', CLUSTER_CONFIGURATION_DELETE = '/api/clusterConfiguration/delete',
CLUSTER_CONFIGURATION_ENABLE = '/api/clusterConfiguration/enable', CLUSTER_CONFIGURATION_ENABLE = '/api/clusterConfiguration/enable',
CLUSTER_CONFIGURATION_TEST = '/api/clusterConfiguration/testConnect', CLUSTER_CONFIGURATION_TEST = '/api/clusterConfiguration/testConnect',
// datasource registries list // datasource registries list
DATASOURCE = '/api/database/list', DATASOURCE = '/api/database/list',
DATASOURCE_ADD_OR_UPDATE = '/api/database/saveOrUpdate',
// datasource registries delete // datasource registries delete
DATASOURCE_DELETE = '/api/database/delete', DATASOURCE_DELETE = '/api/database/delete',
// datasource registries enable or disable // datasource registries enable or disable
......
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