Unverified Commit be7b7701 authored by gaoyan's avatar gaoyan Committed by GitHub

Optimized the Flink configuration form (#2725)

* fix log error * Optimized the Flink configuration form * Optimized the Flink configuration form * formate code
parent 2056376a
...@@ -180,7 +180,7 @@ sys.env.settings.dinkyAddr.note=该地址必须与Dinky Application后台url中 ...@@ -180,7 +180,7 @@ sys.env.settings.dinkyAddr.note=该地址必须与Dinky Application后台url中
sys.env.settings.maxRetainDays=作业历史最大保留天数 sys.env.settings.maxRetainDays=作业历史最大保留天数
sys.env.settings.maxRetainDays.note=提交的作业历史与自动注册的集群记录最大保留天数,过期会被自动删除 sys.env.settings.maxRetainDays.note=提交的作业历史与自动注册的集群记录最大保留天数,过期会被自动删除
sys.env.settings.maxRetainCount=作业历史最大保留数量 sys.env.settings.maxRetainCount=作业历史最大保留数量
sys.env.settings.maxRetainCount.note=提交的作业历史与自动注册的集群记录最大保留数量,如果不足该数量,则不会被删除,即使已经过了做大保留天数 sys.env.settings.maxRetainCount.note=提交的作业历史与自动注册的集群记录最大保留数量,如果不足该数量,则不会被删除,即使已经过了最大保留天数
sys.dolphinscheduler.settings.enable=是否启用 DolphinScheduler sys.dolphinscheduler.settings.enable=是否启用 DolphinScheduler
sys.dolphinscheduler.settings.enable.note=是否启用 DolphinScheduler ,启用后才能使用 DolphinScheduler 的相关功能,请先填写下列配置项,完成后再开启此项配置, 另:请确保 DolphinScheduler 的相关配置正确 sys.dolphinscheduler.settings.enable.note=是否启用 DolphinScheduler ,启用后才能使用 DolphinScheduler 的相关功能,请先填写下列配置项,完成后再开启此项配置, 另:请确保 DolphinScheduler 的相关配置正确
......
/*
*
* 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
*
* 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.
*
*/
import { l } from '@/utils/intl';
import { ProFormSelect } from '@ant-design/pro-components';
import { ProFormSelectProps } from '@ant-design/pro-form/es/components/Select';
import { Divider, Typography } from 'antd';
const { Link } = Typography;
export type FlinkOptionsProps = ProFormSelectProps & {};
const FlinkOptionsSelect = (props: FlinkOptionsProps) => {
const renderTemplateDropDown = (item: any) => {
return (
<>
<Link href={'#/registration/document'}>+ {l('rc.cc.addConfig')}</Link>
<Divider style={{ margin: '8px 0' }} />
{item}
</>
);
};
return (
<ProFormSelect
{...props}
fieldProps={{ dropdownRender: (item) => renderTemplateDropDown(item) }}
/>
);
};
export default FlinkOptionsSelect;
...@@ -32,7 +32,7 @@ import { transformTableDataToCsv } from '@/utils/function'; ...@@ -32,7 +32,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, Tabs} from 'antd'; import { Button, Empty, Input, InputRef, Space, Table, Tabs } 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';
...@@ -44,7 +44,7 @@ type Data = { ...@@ -44,7 +44,7 @@ type Data = {
columns?: string[]; columns?: string[];
rowData?: object[]; rowData?: object[];
}; };
type DataList=Data[]; type DataList = Data[];
const Result = (props: any) => { const Result = (props: any) => {
const { const {
tabs: { panes, activeKey } tabs: { panes, activeKey }
...@@ -132,11 +132,9 @@ const Result = (props: any) => { ...@@ -132,11 +132,9 @@ const Result = (props: any) => {
const consoleData = currentTabs.console; const consoleData = currentTabs.console;
if (consoleData.result && !isRefresh) { if (consoleData.result && !isRefresh) {
setData(consoleData.result); setData(consoleData.result);
} } else if (consoleData.results && !isRefresh) {
else if(consoleData.results && !isRefresh){ setDataList(consoleData.results);
setDataList(consoleData.results) } else {
}
else {
if (current.dialect && current.dialect.toLowerCase() == DIALECT.FLINK_SQL) { if (current.dialect && current.dialect.toLowerCase() == DIALECT.FLINK_SQL) {
// flink sql // flink sql
// to do: get job data by history id list, not flink jid // to do: get job data by history id list, not flink jid
...@@ -173,7 +171,7 @@ const Result = (props: any) => { ...@@ -173,7 +171,7 @@ const Result = (props: any) => {
setData({}); setData({});
setDataList([]); setDataList([]);
loadData(); loadData();
}, [currentTabs?.console?.result,currentTabs?.console?.results]); }, [currentTabs?.console?.result, currentTabs?.console?.results]);
const getColumns = (columns: string[]) => { const getColumns = (columns: string[]) => {
return columns?.map((item) => { return columns?.map((item) => {
...@@ -243,10 +241,8 @@ const Result = (props: any) => { ...@@ -243,10 +241,8 @@ const Result = (props: any) => {
})} })}
loading={loading} loading={loading}
/> />
) : ( ) : dataList.length > 0 ? (
dataList.length>0?( <Tabs defaultActiveKey='0'>
<Tabs defaultActiveKey="0">
{dataList.map((data, index) => { {dataList.map((data, index) => {
return ( return (
<Tabs.TabPane key={index} tab={`Table ${index + 1}`}> <Tabs.TabPane key={index} tab={`Table ${index + 1}`}>
...@@ -261,10 +257,10 @@ const Result = (props: any) => { ...@@ -261,10 +257,10 @@ const Result = (props: any) => {
</Tabs.TabPane> </Tabs.TabPane>
); );
})} })}
</Tabs>): </Tabs>
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)} )}
</div> </div>
); );
}; };
......
...@@ -223,8 +223,7 @@ const HeaderContainer = (props: connect) => { ...@@ -223,8 +223,7 @@ const HeaderContainer = (props: connect) => {
if (isSql(currentData.dialect)) { if (isSql(currentData.dialect)) {
currentData.status = JOB_STATUS.FINISHED; currentData.status = JOB_STATUS.FINISHED;
if (currentTab) currentTab.console.results = res.data.results; if (currentTab) currentTab.console.results = res.data.results;
} } else {
else {
if (currentTab) currentTab.console.result = res.data.result; if (currentTab) currentTab.console.result = res.data.result;
} }
// Common sql task is synchronized, so it needs to automatically update the status to finished. // Common sql task is synchronized, so it needs to automatically update the status to finished.
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* *
*/ */
import FlinkOptionsSelect from '@/components/Flink/OptionsSelect';
import { SAVE_POINT_TYPE } from '@/pages/DataStudio/constants'; import { SAVE_POINT_TYPE } from '@/pages/DataStudio/constants';
import { import {
getCurrentData, getCurrentData,
...@@ -305,7 +306,7 @@ const JobConfig = (props: any) => { ...@@ -305,7 +306,7 @@ const JobConfig = (props: any) => {
> >
<ProFormGroup> <ProFormGroup>
<Space key={'config'} align='baseline'> <Space key={'config'} align='baseline'>
<ProFormSelect <FlinkOptionsSelect
name='key' name='key'
width={calculatorWidth(rightContainer.width) + 30} width={calculatorWidth(rightContainer.width) + 30}
mode={'single'} mode={'single'}
......
...@@ -110,7 +110,7 @@ export type TaskType = { ...@@ -110,7 +110,7 @@ export type TaskType = {
}; };
export type ConsoleType = { export type ConsoleType = {
results:{}[]; results: {}[];
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
result: {}; result: {};
// eslint-disable-next-line @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/ban-types
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
import CodeEdit from '@/components/CustomEditor/CodeEdit'; import CodeEdit from '@/components/CustomEditor/CodeEdit';
import FlinkOptionsSelect from '@/components/Flink/OptionsSelect';
import { TagAlignCenter } from '@/components/StyledComponents'; import { TagAlignCenter } from '@/components/StyledComponents';
import { StateType } from '@/pages/DataStudio/model'; import { StateType } from '@/pages/DataStudio/model';
import { import {
...@@ -209,7 +210,7 @@ const FlinkK8s = (props: { type: string; value: any; form: FormInstance<Values> ...@@ -209,7 +210,7 @@ const FlinkK8s = (props: { type: string; value: any; form: FormInstance<Values>
> >
<ProFormGroup key='flinkGroup'> <ProFormGroup key='flinkGroup'>
<Space key={'config'} style={{ display: 'flex' }} align='baseline'> <Space key={'config'} style={{ display: 'flex' }} align='baseline'>
<ProFormSelect <FlinkOptionsSelect
name='name' name='name'
width={'md'} width={'md'}
mode={'single'} mode={'single'}
......
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