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 {
* @param dataBaseDTO {@link DataBaseDTO}
* @return {@link Result}< {@link Void}>
*/
@PutMapping
@PutMapping("/saveOrUpdate")
@Log(title = "Insert Or Update DataBase", businessType = BusinessType.INSERT_OR_UPDATE)
@ApiOperation("Insert Or Update DataBase")
@ApiImplicitParam(
......
......@@ -17,6 +17,8 @@
*
*/
import { l } from '@/utils/intl';
import { WarningMessage } from '@/utils/messages';
import { Transfer, Tree } from 'antd';
import type { TransferDirection, TransferItem } from 'antd/es/transfer';
import type { DataNode } from 'antd/es/tree';
......@@ -75,11 +77,19 @@ export const TreeTransfer: React.FC<TreeTransferProps> = ({
defaultExpandAll
checkedKeys={checkedKeys}
treeData={generateTree(dataSource, targetKeys)}
onCheck={(_, { node: { key } }) => {
onItemSelect(key as string, !isChecked(checkedKeys, key));
onCheck={async (_, { node: { key, isLeaf } }) => {
if (isLeaf) {
onItemSelect(key as string, !isChecked(checkedKeys, key));
} else {
WarningMessage(l('rc.udf.register.select'));
}
}}
onSelect={(_, { node: { key } }) => {
onItemSelect(key as string, !isChecked(checkedKeys, key));
onSelect={async (_, { node: { key, isLeaf } }) => {
if (isLeaf) {
onItemSelect(key as string, !isChecked(checkedKeys, key));
} else {
WarningMessage(l('rc.udf.register.select'));
}
}}
/>
);
......
......@@ -168,7 +168,8 @@ export default {
'devops.jobinfo.savepoint.stop': 'SavePoint Pause',
'devops.jobinfo.savepoint.trigger': 'SavePoint Triggers',
'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.sure': 'Are you sure you want to remove this version?V{version}',
'devops.jobinfo.version.latestVersion': 'Current Version',
......@@ -857,6 +858,7 @@ export default {
'rc.udf.register.className': 'Class Name',
'rc.udf.register.deleteConfirm': 'Are you sure you want to delete this UDF? ',
'rc.udf.register': 'Register UDF',
'rc.udf.register.select': 'Please select a non-directory node',
/**
*
* role
......
......@@ -818,6 +818,7 @@ export default {
'rc.udf.register.className': '类名',
'rc.udf.register.deleteConfirm': '确定删除该 UDF 吗?',
'rc.udf.register': '注册 UDF',
'rc.udf.register.select': '请选择非目录节点!',
/**
*
......
......@@ -31,7 +31,7 @@ import { transformTableDataToCsv } from '@/utils/function';
import { l } from '@/utils/intl';
import { SearchOutlined } from '@ant-design/icons';
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 { FilterConfirmProps } from 'antd/es/table/interface';
import { DataIndex } from 'rc-table/es/interface';
......
......@@ -21,11 +21,11 @@ import FlinkDag from '@/components/FlinkDag';
import { JobProps } from '@/pages/DevOps/JobDetail/data';
import FlinkTable from '@/pages/DevOps/JobDetail/JobOverview/components/FlinkTable';
import JobDesc from '@/pages/DevOps/JobDetail/JobOverview/components/JobDesc';
import { l } from '@/utils/intl';
import { ProCard } from '@ant-design/pro-components';
import { Button, Empty, Result } from 'antd';
import { useState } from 'react';
import { isStatusDone } from '../../function';
import { l } from '@/utils/intl';
const JobConfigTab = (props: JobProps) => {
const { jobDetail } = props;
......@@ -34,33 +34,41 @@ const JobConfigTab = (props: JobProps) => {
return (
<>
{
isStatusDone(jobDetail?.instance?.status as string) && !showHistory ? <Result
status="warning"
{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)}}>
<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
style={{
height: '40vh'
}}
>
{job ? (
<FlinkDag job={job} checkPoints={jobDetail.jobDataDto.checkpoints}/>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE}/>
)}
</ProCard>
/>
) : undefined}
{showHistory || !isStatusDone(jobDetail?.instance?.status as string) ? (
<>
<JobDesc jobDetail={jobDetail} />
<ProCard
style={{
height: '40vh'
}}
>
{job ? (
<FlinkDag job={job} checkPoints={jobDetail.jobDataDto.checkpoints} />
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</ProCard>
<FlinkTable jobDetail={jobDetail} /></> : undefined
}
<FlinkTable jobDetail={jobDetail} />
</>
) : undefined}
</>
);
};
......
......@@ -18,6 +18,7 @@
*/
import JobLifeCycleTag from '@/components/JobTags/JobLifeCycleTag';
import StatusTag from '@/components/JobTags/StatusTag';
import AlertHistory from '@/pages/DevOps/JobDetail/AlertHistory';
import CheckPoints from '@/pages/DevOps/JobDetail/CheckPointsTab';
import JobLineage from '@/pages/DevOps/JobDetail/JobLineage';
......@@ -36,7 +37,6 @@ import { useRequest } from '@umijs/max';
import { Tag } from 'antd';
import { useState } from 'react';
import { connect, useLocation } from 'umi';
import StatusTag from "@/components/JobTags/StatusTag";
/**
* Enum defining different operators for the JobDetail component.
......
/*
*
* 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
* 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
* 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.
* 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.
*
*/
......@@ -35,5 +35,5 @@ export const handleTest = async (item: Partial<DataSources.DataSource>) => {
* @param item
*/
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 {
CLUSTER_CONFIGURATION_START = '/api/cluster/deploySessionClusterInstance',
// cluster configuration 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_ENABLE = '/api/clusterConfiguration/enable',
CLUSTER_CONFIGURATION_TEST = '/api/clusterConfiguration/testConnect',
// datasource registries list
DATASOURCE = '/api/database/list',
DATASOURCE_ADD_OR_UPDATE = '/api/database/saveOrUpdate',
// datasource registries delete
DATASOURCE_DELETE = '/api/database/delete',
// 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