Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-job-model-render-bug' into f…
Browse files Browse the repository at this point in the history
…ix-job-model-render-bug

# Conflicts:
#	dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
  • Loading branch information
Zzm0809 committed Jan 18, 2024
2 parents 5b88926 + c77b881 commit 29c9df5
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
*
*/

import {TagAlignLeft} from '@/components/StyledComponents';
import {getAlertIcon} from '@/pages/RegCenter/Alert/AlertInstance/function';
import {RUN_MODE} from '@/services/constants';
import {Alert, ALERT_TYPE, Cluster} from '@/types/RegCenter/data.d';
import {TaskInfo} from '@/types/Studio/data.d';
import {l} from '@/utils/intl';
import {PaperClipOutlined} from '@ant-design/icons';
import {Badge, Space, Tag} from 'antd';
import {DefaultOptionType} from 'antd/es/select';
import { TagAlignLeft } from '@/components/StyledComponents';
import { getAlertIcon } from '@/pages/RegCenter/Alert/AlertInstance/function';
import { RUN_MODE } from '@/services/constants';
import { Alert, ALERT_TYPE, Cluster } from '@/types/RegCenter/data.d';
import { TaskInfo } from '@/types/Studio/data.d';
import { l } from '@/utils/intl';
import { PaperClipOutlined } from '@ant-design/icons';
import { Badge, Space, Tag } from 'antd';
import { DefaultOptionType } from 'antd/es/select';

/**
* build job run model
Expand Down Expand Up @@ -156,8 +156,8 @@ export const buildEnvOptions = (env: TaskInfo[] = []) => {
for (const item of env) {
const tag = (
<TagAlignLeft>
{item.enabled ? <Badge status='success'/> : <Badge status='error'/>}
{item.fragment ? <PaperClipOutlined/> : undefined}
{item.enabled ? <Badge status='success' /> : <Badge status='error' />}
{item.fragment ? <PaperClipOutlined /> : undefined}
{item.name}
</TagAlignLeft>
);
Expand Down
87 changes: 44 additions & 43 deletions dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,61 +153,62 @@ const JobConfig = (props: any) => {
}}
allowClear={false}
/>
{ selectRunMode !== RUN_MODE.LOCAL && <>
{/*集群实例渲染逻辑*/}
{isCanRenderClusterInstance(selectRunMode) && (
<>
{selectRunMode !== RUN_MODE.LOCAL && (
<>
{/*集群实例渲染逻辑*/}
{isCanRenderClusterInstance(selectRunMode) && (
<>
<ProFormSelect
style={{ width: '100%' }}
placeholder={l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: current?.type
})}
label={l('pages.datastudio.label.jobConfig.cluster')}
tooltip={l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: current?.type
})}
rules={[
{
required: true,
message: l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: current?.type
})
}
]}
name='clusterId'
options={buildClusterOptions(selectRunMode, sessionCluster)}
fieldProps={{
onChange: onChangeClusterSession
}}
/>
</>
)}

{/*集群配置渲染逻辑*/}
{isCanRenderClusterConfiguration(selectRunMode) && (
<ProFormSelect
style={{ width: '100%' }}
name='clusterConfigurationId'
placeholder={l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: current?.type
type: selectRunMode
})}
label={l('pages.datastudio.label.jobConfig.cluster')}
tooltip={l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: current?.type
label={l('pages.datastudio.label.jobConfig.clusterConfig')}
tooltip={l('pages.datastudio.label.jobConfig.clusterConfig.tip2', '', {
type: selectRunMode
})}
rules={[
{
required: true,
message: l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: current?.type
type: selectRunMode
})
}
]}
name='clusterId'
options={buildClusterOptions(selectRunMode, sessionCluster)}
fieldProps={{
onChange: onChangeClusterSession
}}
options={buildClusterConfigOptions(selectRunMode, clusterConfiguration)}
allowClear={false}
/>
</>
)}

{/*集群配置渲染逻辑*/}
{isCanRenderClusterConfiguration(selectRunMode) && (
<ProFormSelect
name='clusterConfigurationId'
placeholder={l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: selectRunMode
})}
label={l('pages.datastudio.label.jobConfig.clusterConfig')}
tooltip={l('pages.datastudio.label.jobConfig.clusterConfig.tip2', '', {
type: selectRunMode
})}
rules={[
{
required: true,
message: l('pages.datastudio.label.jobConfig.clusterConfig.tip1', '', {
type: selectRunMode
})
}
]}
options={buildClusterConfigOptions(selectRunMode, clusterConfiguration)}
allowClear={false}
/>
)}
</>}

)}
</>
)}

{current?.dialect && current?.dialect?.toLowerCase() === DIALECT.FLINK_SQL && (
<ProFormSelect
Expand Down
14 changes: 7 additions & 7 deletions dinky-web/src/pages/DataStudio/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
*
*/

import {l} from '@/utils/intl';
import {CloseCircleTwoTone, IssuesCloseOutlined} from '@ant-design/icons';
import {Space} from 'antd';
import {DefaultOptionType} from 'antd/es/select';
import {MenuItemType} from 'rc-menu/lib/interface';
import { l } from '@/utils/intl';
import { CloseCircleTwoTone, IssuesCloseOutlined } from '@ant-design/icons';
import { Space } from 'antd';
import { DefaultOptionType } from 'antd/es/select';
import { MenuItemType } from 'rc-menu/lib/interface';

export const STUDIO_TAG_RIGHT_CONTEXT_MENU: MenuItemType[] = [
{
key: 'closeAll',
label: (
<Space>
<CloseCircleTwoTone/>
<CloseCircleTwoTone />
{l('right.menu.closeAll')}
</Space>
)
Expand All @@ -37,7 +37,7 @@ export const STUDIO_TAG_RIGHT_CONTEXT_MENU: MenuItemType[] = [
key: 'closeOther',
label: (
<Space>
<IssuesCloseOutlined className={'blue-icon'}/>
<IssuesCloseOutlined className={'blue-icon'} />
{l('right.menu.closeOther')}
</Space>
)
Expand Down

0 comments on commit 29c9df5

Please sign in to comment.