Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
3ec1e1fd
Unverified
Commit
3ec1e1fd
authored
Nov 17, 2023
by
zhu-mingye
Committed by
GitHub
Nov 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve some feature (#2543)
* improve some feature * Spotless Apply --------- Co-authored-by:
zhu-mingye
<
zhu-mingye@users.noreply.github.com
>
parent
0bb94597
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
203 additions
and
131 deletions
+203
-131
index.tsx
dinky-web/src/components/CustomEditor/CodeEdit/index.tsx
+1
-1
DBIcons.tsx
dinky-web/src/components/Icons/DBIcons.tsx
+44
-12
index.tsx
...eb/src/pages/DataStudio/BottomContainer/Lineage/index.tsx
+14
-14
function.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/function.tsx
+5
-3
index.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
+23
-6
constants.tsx
.../src/pages/DataStudio/LeftContainer/Project/constants.tsx
+14
-17
index.tsx
...web/src/pages/DataStudio/MiddleContainer/Editor/index.tsx
+3
-12
function.tsx
dinky-web/src/pages/DataStudio/MiddleContainer/function.tsx
+33
-0
function.tsx
...rc/pages/DataStudio/RightContainer/JobConfig/function.tsx
+3
-2
index.tsx
...b/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
+15
-29
constants.tsx
dinky-web/src/pages/DataStudio/constants.tsx
+26
-14
route.tsx
dinky-web/src/pages/DataStudio/route.tsx
+1
-1
index.tsx
dinky-web/src/pages/Metrics/Job/index.tsx
+0
-0
constans.ts
...y-web/src/pages/RegCenter/Alert/AlertInstance/constans.ts
+15
-13
index.tsx
...ConfigurationModal/ConfigurationForm/YarnConfig/index.tsx
+3
-3
constants.tsx
dinky-web/src/services/constants.tsx
+3
-4
No files found.
dinky-web/src/components/CustomEditor/CodeEdit/index.tsx
View file @
3ec1e1fd
...
@@ -292,7 +292,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
...
@@ -292,7 +292,7 @@ const CodeEdit = (props: CodeEditFormProps & connect) => {
wordWrap
:
autoWrap
,
wordWrap
:
autoWrap
,
autoDetectHighContrast
:
true
,
autoDetectHighContrast
:
true
,
lineNumbers
,
lineNumbers
,
...
options
,
...
options
};
};
return
(
return
(
<>
<>
...
...
dinky-web/src/components/Icons/DBIcons.tsx
View file @
3ec1e1fd
/*
/*
* 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
* 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.
*
*
* 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
Icon
from
'@ant-design/icons'
;
import
Icon
from
'@ant-design/icons'
;
...
@@ -56,6 +58,36 @@ export const MysqlIcons = (props: any) => {
...
@@ -56,6 +58,36 @@ export const MysqlIcons = (props: any) => {
);
);
};
};
export
const
SQLIcons
=
(
props
:
any
)
=>
{
const
size
=
props
.
size
||
defaultSvgSize
;
return
(
<>
<
Icon
style=
{
style
}
component=
{
()
=>
(
<
svg
className=
'icon'
viewBox=
'0 0 1024 1024'
version=
'1.1'
xmlns=
'http://www.w3.org/2000/svg'
width=
{
size
}
height=
{
size
}
>
<
path
d=
'M841.14 36.57H182.86A146.29 146.29 0 0 0 36.57 182.86v658.28a146.29 146.29 0 0 0 146.29 146.29h658.28a146.29 146.29 0 0 0 146.29-146.29V182.86A146.29 146.29 0 0 0 841.14 36.57zM249.42 658.29a146.29 146.29 0 0 1-105.33-43.52l27.43-32.18a114.83 114.83 0 0 0 79 36.57c36.57 0 56-16.82 56-41.69s-20.11-36.57-47.54-47.54l-39.5-20.11a85.21 85.21 0 0 1-62.17-77.9 88.14 88.14 0 0 1 93.86-82q2.45 0.16 4.89 0.47a126.9 126.9 0 0 1 89.6 36.57l-24.5 29.62a94.35 94.35 0 0 0-65.1-25.6c-30.35 0-49.74 14.63-49.74 36.57s23.77 36.57 47.91 44.62l38.4 19a82.65 82.65 0 0 1 60.34 80.09c0.68 47.53-38.82 87.03-103.55 87.03z m365.71 73.14a119.59 119.59 0 0 1-115.2-73.14c-64-11-106.79-67.29-106.79-152.87 0-95.45 52.66-152.5 128.73-152.5S651 410 651 505.42c0 83.38-40.59 139-101.3 151.77a75.7 75.7 0 0 0 70.58 36.57 109.71 109.71 0 0 0 31.45-4.39l8.78 36.57a117.39 117.39 0 0 1-45.35 2.93z m269.53-76.8H712.78V355.84h46.81v256h125.07z'
fill=
'#FF5C5C'
></
path
>
<
path
d=
'M603.43 502.86c0-69.49-32.18-111.91-81.19-111.91s-80.82 42.42-80.82 111.91 31.82 116.3 80.82 116.3 81.19-44.62 81.19-116.3z'
fill=
'#FF5C5C'
></
path
>
</
svg
>
)
}
/>
</>
);
};
export
const
OracleIcons
=
(
props
:
any
)
=>
{
export
const
OracleIcons
=
(
props
:
any
)
=>
{
const
size
=
props
.
size
||
defaultSvgSize
;
const
size
=
props
.
size
||
defaultSvgSize
;
return
(
return
(
...
...
dinky-web/src/pages/DataStudio/BottomContainer/Lineage/index.tsx
View file @
3ec1e1fd
/*
/*
*
*
*
Licensed to the Apache Software Foundation (ASF) under one or more
* Licensed to the Apache Software Foundation (ASF) under one or more
*
contributor license agreements. See the NOTICE file distributed with
* contributor license agreements. See the NOTICE file distributed with
*
this work for additional information regarding copyright ownership.
* this work for additional information regarding copyright ownership.
*
The ASF licenses this file to You under the Apache License, Version 2.0
* 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 not use this file except in compliance with
*
the License. You may obtain a copy of the License at
* 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
* Unless required by applicable law or agreed to in writing, software
*
distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS,
*
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
*
limitations under the License.
* limitations under the License.
*
*
*/
*/
...
@@ -56,11 +56,11 @@ const Lineage: React.FC<connect> = (props) => {
...
@@ -56,11 +56,11 @@ const Lineage: React.FC<connect> = (props) => {
const
params
:
StudioLineageParams
=
{
const
params
:
StudioLineageParams
=
{
type
:
1
,
// todo: 暂时写死 ,后续优化
type
:
1
,
// todo: 暂时写死 ,后续优化
dialect
:
dialect
,
dialect
:
dialect
,
envId
:
envId
,
envId
:
envId
??
-
1
,
fragment
:
fragment
,
fragment
:
fragment
,
statement
:
statement
,
statement
:
statement
,
statementSet
:
statementSet
,
statementSet
:
statementSet
,
databaseId
:
databaseId
,
databaseId
:
databaseId
??
0
,
variables
:
{}
variables
:
{}
};
};
getDataByParams
(
API_CONSTANTS
.
STUDIO_GET_LINEAGE
,
params
).
then
((
res
)
=>
getDataByParams
(
API_CONSTANTS
.
STUDIO_GET_LINEAGE
,
params
).
then
((
res
)
=>
...
...
dinky-web/src/pages/DataStudio/HeaderContainer/function.tsx
View file @
3ec1e1fd
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
import
{
TabsPageType
,
TaskDataType
}
from
'@/pages/DataStudio/model'
;
import
{
TabsPageType
,
TaskDataType
}
from
'@/pages/DataStudio/model'
;
import
{
JOB_LIFE_CYCLE
,
JOB_STATUS
}
from
'@/pages/DevOps/constants'
;
import
{
JOB_LIFE_CYCLE
,
JOB_STATUS
}
from
'@/pages/DevOps/constants'
;
import
{
Home
Outlined
}
from
'@ant-design/icons'
;
import
{
Environment
Outlined
}
from
'@ant-design/icons'
;
/**
/**
* @description: 生成面包屑
* @description: 生成面包屑
...
@@ -27,10 +27,12 @@ import { HomeOutlined } from '@ant-design/icons';
...
@@ -27,10 +27,12 @@ import { HomeOutlined } from '@ant-design/icons';
export
const
buildBreadcrumbItems
=
(
breadcrumb
:
string
)
=>
{
export
const
buildBreadcrumbItems
=
(
breadcrumb
:
string
)
=>
{
// 如果有 activeBreadcrumbTitle, 则切割 activeBreadcrumbTitle, 生成面包屑数组, 并映射
// 如果有 activeBreadcrumbTitle, 则切割 activeBreadcrumbTitle, 生成面包屑数组, 并映射
const
activeBreadcrumbTitleList
=
Array
.
from
(
breadcrumb
.
split
(
'/'
)).
map
((
title
)
=>
({
const
activeBreadcrumbTitleList
=
Array
.
from
(
breadcrumb
.
split
(
'/'
)).
map
((
title
)
=>
({
title
:
<>
{
title
}
</>
title
:
title
,
// path: `/${title}`,
breadcrumbName
:
title
}));
}));
return
[{
title
:
<
Home
Outlined
/>
},
...
activeBreadcrumbTitleList
];
return
[{
title
:
<
Environment
Outlined
/>
},
...
activeBreadcrumbTitleList
];
};
};
export
const
projectCommonShow
=
(
type
?:
TabsPageType
)
=>
{
export
const
projectCommonShow
=
(
type
?:
TabsPageType
)
=>
{
...
...
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
View file @
3ec1e1fd
...
@@ -35,11 +35,18 @@ import {
...
@@ -35,11 +35,18 @@ import {
executeSql
,
executeSql
,
getJobPlan
getJobPlan
}
from
'@/pages/DataStudio/HeaderContainer/service'
;
}
from
'@/pages/DataStudio/HeaderContainer/service'
;
import
{
StateType
,
TabsPageSubType
,
TabsPageType
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
DataStudioTabsItemType
,
StateType
,
TabsPageSubType
,
TabsPageType
,
VIEW
}
from
'@/pages/DataStudio/model'
;
import
{
JOB_LIFE_CYCLE
,
JOB_STATUS
}
from
'@/pages/DevOps/constants'
;
import
{
JOB_LIFE_CYCLE
,
JOB_STATUS
}
from
'@/pages/DevOps/constants'
;
import
{
ConfigStateType
}
from
'@/pages/SettingCenter/GlobalSetting/model'
;
import
{
ConfigStateType
}
from
'@/pages/SettingCenter/GlobalSetting/model'
;
import
{
SettingConfigKeyEnum
}
from
'@/pages/SettingCenter/GlobalSetting/SettingOverView/constants'
;
import
{
SettingConfigKeyEnum
}
from
'@/pages/SettingCenter/GlobalSetting/SettingOverView/constants'
;
import
{
handlePutDataJson
}
from
'@/services/BusinessCrud'
;
import
{
handlePutDataJson
}
from
'@/services/BusinessCrud'
;
import
{
DIALECT
}
from
'@/services/constants'
;
import
{
BaseConfigProperties
}
from
'@/types/SettingCenter/data'
;
import
{
BaseConfigProperties
}
from
'@/types/SettingCenter/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
SuccessMessageAsync
}
from
'@/utils/messages'
;
import
{
SuccessMessageAsync
}
from
'@/utils/messages'
;
...
@@ -104,7 +111,7 @@ const HeaderContainer = (props: any) => {
...
@@ -104,7 +111,7 @@ const HeaderContainer = (props: any) => {
);
);
const
currentData
=
getCurrentData
(
panes
,
activeKey
);
const
currentData
=
getCurrentData
(
panes
,
activeKey
);
const
currentTab
=
getCurrentTab
(
panes
,
activeKey
);
const
currentTab
=
getCurrentTab
(
panes
,
activeKey
)
as
DataStudioTabsItemType
;
useEffect
(()
=>
{
useEffect
(()
=>
{
queryDsConfig
(
SettingConfigKeyEnum
.
DOLPHIN_SCHEDULER
.
toLowerCase
());
queryDsConfig
(
SettingConfigKeyEnum
.
DOLPHIN_SCHEDULER
.
toLowerCase
());
...
@@ -215,6 +222,8 @@ const HeaderContainer = (props: any) => {
...
@@ -215,6 +222,8 @@ const HeaderContainer = (props: any) => {
}
}
};
};
console
.
log
(
'currentData'
,
props
,
currentData
);
const
showExplain
=
async
()
=>
{
const
showExplain
=
async
()
=>
{
modal
.
confirm
({
modal
.
confirm
({
title
:
l
(
'pages.datastudio.explain.validate.msg'
),
title
:
l
(
'pages.datastudio.explain.validate.msg'
),
...
@@ -242,7 +251,10 @@ const HeaderContainer = (props: any) => {
...
@@ -242,7 +251,10 @@ const HeaderContainer = (props: any) => {
// 执行图按钮
// 执行图按钮
icon
:
<
ApartmentOutlined
/>,
icon
:
<
ApartmentOutlined
/>,
title
:
l
(
'button.graph'
),
title
:
l
(
'button.graph'
),
isShow
:
projectCommonShow
(
currentTab
?.
type
),
isShow
:
(
projectCommonShow
(
currentTab
?.
type
)
&&
currentData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
)
||
currentData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINKJAR
,
click
:
async
()
=>
showDagGraph
()
click
:
async
()
=>
showDagGraph
()
},
},
{
{
...
@@ -266,7 +278,9 @@ const HeaderContainer = (props: any) => {
...
@@ -266,7 +278,9 @@ const HeaderContainer = (props: any) => {
// 发布按钮
// 发布按钮
icon
:
isOnline
(
currentData
)
?
<
MergeCellsOutlined
/>
:
<
FundOutlined
/>,
icon
:
isOnline
(
currentData
)
?
<
MergeCellsOutlined
/>
:
<
FundOutlined
/>,
title
:
isOnline
(
currentData
)
?
l
(
'button.offline'
)
:
l
(
'button.publish'
),
title
:
isOnline
(
currentData
)
?
l
(
'button.offline'
)
:
l
(
'button.publish'
),
isShow
:
currentTab
?.
type
==
TabsPageType
.
project
,
isShow
:
currentTab
?.
type
==
TabsPageType
.
project
&&
currentData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
,
click
:
()
=>
handleChangeJobLife
()
click
:
()
=>
handleChangeJobLife
()
},
},
{
{
...
@@ -302,7 +316,10 @@ const HeaderContainer = (props: any) => {
...
@@ -302,7 +316,10 @@ const HeaderContainer = (props: any) => {
click: handlerDebug,
click: handlerDebug,
hotKey: (e: KeyboardEvent) => e.shiftKey && e.key === 'F9',
hotKey: (e: KeyboardEvent) => e.shiftKey && e.key === 'F9',
hotKeyDesc: 'Shift+F9',
hotKeyDesc: 'Shift+F9',
isShow: currentTab?.type == TabsPageType.project && !isRunning(currentData),
isShow:
currentTab?.type == TabsPageType.project &&
!isRunning(currentData) &&
currentData?.dialect?.toLowerCase() === DIALECT.FLINK_SQL,
props: {
props: {
style: { background: '#52c41a' },
style: { background: '#52c41a' },
type: 'primary'
type: 'primary'
...
@@ -345,7 +362,7 @@ const HeaderContainer = (props: any) => {
...
@@ -345,7 +362,7 @@ const HeaderContainer = (props: any) => {
return (
return (
<FlexCenterDiv style={{ width: (size.width - 2 * VIEW.paddingInline) / 2 }}>
<FlexCenterDiv style={{ width: (size.width - 2 * VIEW.paddingInline) / 2 }}>
<Breadcrumb separator={'
>
'} items={buildBreadcrumbItems(activeBreadcrumbTitle)} />
<Breadcrumb separator={'
/
'} items={buildBreadcrumbItems(activeBreadcrumbTitle)} />
</FlexCenterDiv>
</FlexCenterDiv>
);
);
};
};
...
...
dinky-web/src/pages/DataStudio/LeftContainer/Project/constants.tsx
View file @
3ec1e1fd
/*
/*
*
*
*
Licensed to the Apache Software Foundation (ASF) under one or more
* Licensed to the Apache Software Foundation (ASF) under one or more
*
contributor license agreements. See the NOTICE file distributed with
* contributor license agreements. See the NOTICE file distributed with
*
this work for additional information regarding copyright ownership.
* this work for additional information regarding copyright ownership.
*
The ASF licenses this file to You under the Apache License, Version 2.0
* 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 not use this file except in compliance with
*
the License. You may obtain a copy of the License at
* 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
* Unless required by applicable law or agreed to in writing, software
*
distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS,
*
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
*
limitations under the License.
* limitations under the License.
*
*
*/
*/
...
@@ -89,7 +89,8 @@ export const JOB_RIGHT_MENU = (disabled = false): MenuItemType[] => [
...
@@ -89,7 +89,8 @@ export const JOB_RIGHT_MENU = (disabled = false): MenuItemType[] => [
{
{
key
:
'exportJson'
,
key
:
'exportJson'
,
icon
:
<
UpCircleTwoTone
/>,
icon
:
<
UpCircleTwoTone
/>,
label
:
l
(
'right.menu.exportJson'
)
label
:
l
(
'right.menu.exportJson'
),
disabled
:
true
// todo: 此功能暂时不实现 先禁用掉
},
},
{
{
key
:
'copy'
,
key
:
'copy'
,
...
@@ -128,10 +129,6 @@ export const JOB_TYPE: DefaultOptionType[] = [
...
@@ -128,10 +129,6 @@ export const JOB_TYPE: DefaultOptionType[] = [
{
{
value
:
'FlinkSqlEnv'
,
value
:
'FlinkSqlEnv'
,
label
:
'FlinkSqlEnv'
label
:
'FlinkSqlEnv'
},
{
value
:
'KubernetesApplication'
,
label
:
'KubernetesApplication'
}
}
]
]
},
},
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/Editor/index.tsx
View file @
3ec1e1fd
...
@@ -21,6 +21,7 @@ import CodeEdit from '@/components/CustomEditor/CodeEdit';
...
@@ -21,6 +21,7 @@ import CodeEdit from '@/components/CustomEditor/CodeEdit';
import
{
useEditor
}
from
'@/hooks/useEditor'
;
import
{
useEditor
}
from
'@/hooks/useEditor'
;
import
{
TASK_VAR_FILTER
}
from
'@/pages/DataStudio/MiddleContainer/Editor/constants'
;
import
{
TASK_VAR_FILTER
}
from
'@/pages/DataStudio/MiddleContainer/Editor/constants'
;
import
DiffModal
from
'@/pages/DataStudio/MiddleContainer/Editor/DiffModal'
;
import
DiffModal
from
'@/pages/DataStudio/MiddleContainer/Editor/DiffModal'
;
import
{
matchLanguage
}
from
'@/pages/DataStudio/MiddleContainer/function'
;
import
{
import
{
DataStudioTabsItemType
,
DataStudioTabsItemType
,
StateType
,
StateType
,
...
@@ -29,7 +30,6 @@ import {
...
@@ -29,7 +30,6 @@ import {
TaskDataType
TaskDataType
}
from
'@/pages/DataStudio/model'
;
}
from
'@/pages/DataStudio/model'
;
import
{
JOB_LIFE_CYCLE
}
from
'@/pages/DevOps/constants'
;
import
{
JOB_LIFE_CYCLE
}
from
'@/pages/DevOps/constants'
;
import
{
DIALECT
}
from
'@/services/constants'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
,
useRequest
}
from
'@@/exports'
;
import
{
connect
,
useRequest
}
from
'@@/exports'
;
...
@@ -141,11 +141,7 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
...
@@ -141,11 +141,7 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
<
DiffModal
<
DiffModal
diffs=
{
diff
}
diffs=
{
diff
}
open=
{
isModalOpen
}
open=
{
isModalOpen
}
language=
{
language=
{
matchLanguage
(
tabsItem
?.
params
?.
taskData
?.
dialect
)
}
tabsItem
?.
params
?.
taskData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
?
'flinksql'
:
'sql'
}
fileName=
{
currentData
?.
name
}
fileName=
{
currentData
?.
name
}
onUse=
{
upDateTask
}
onUse=
{
upDateTask
}
/>
/>
...
@@ -153,12 +149,7 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
...
@@ -153,12 +149,7 @@ const CodeEditor: React.FC<EditorProps & any> = (props) => {
monacoRef=
{
monacoInstance
}
monacoRef=
{
monacoInstance
}
editorRef=
{
editorInstance
}
editorRef=
{
editorInstance
}
code=
{
tabsItem
?.
params
?.
taskData
?.
statement
}
code=
{
tabsItem
?.
params
?.
taskData
?.
statement
}
language=
{
language=
{
matchLanguage
(
tabsItem
?.
params
?.
taskData
?.
dialect
)
}
tabsItem
?.
params
?.
taskData
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
?
'flinksql'
:
'sql'
}
// language={'sql'}
editorDidMount=
{
editorDidMount
}
editorDidMount=
{
editorDidMount
}
onChange=
{
handleEditChange
}
onChange=
{
handleEditChange
}
enableSuggestions=
{
true
}
enableSuggestions=
{
true
}
...
...
dinky-web/src/pages/DataStudio/MiddleContainer/function.tsx
View file @
3ec1e1fd
...
@@ -40,11 +40,42 @@ import {
...
@@ -40,11 +40,42 @@ import {
PhoenixIcons
,
PhoenixIcons
,
PostgresqlIcons
,
PostgresqlIcons
,
PrestoIcons
,
PrestoIcons
,
SQLIcons
,
SqlServerIcons
,
SqlServerIcons
,
StarRocksIcons
StarRocksIcons
}
from
'@/components/Icons/DBIcons'
;
}
from
'@/components/Icons/DBIcons'
;
import
{
DIALECT
}
from
'@/services/constants'
;
import
{
DIALECT
}
from
'@/services/constants'
;
export
const
matchLanguage
=
(
language
=
DIALECT
.
FLINK_SQL
)
=>
{
switch
(
language
.
toLowerCase
())
{
case
DIALECT
.
FLINK_SQL
:
case
DIALECT
.
FLINKSQLENV
:
case
DIALECT
.
FLINKJAR
:
return
DIALECT
.
FLINK_SQL
;
case
DIALECT
.
SQL
:
case
DIALECT
.
SQLSERVER
:
case
DIALECT
.
POSTGRESQL
:
case
DIALECT
.
HIVE
:
case
DIALECT
.
CLICKHOUSE
:
case
DIALECT
.
ORACLE
:
case
DIALECT
.
DORIS
:
case
DIALECT
.
PHOENIX
:
case
DIALECT
.
PRESTO
:
case
DIALECT
.
MYSQL
:
case
DIALECT
.
STARROCKS
:
return
DIALECT
.
SQL
;
case
DIALECT
.
PYTHON
:
case
DIALECT
.
PYTHON_LONG
:
return
DIALECT
.
PYTHON
;
case
DIALECT
.
SCALA
:
return
DIALECT
.
SCALA
;
case
DIALECT
.
JAVA
:
return
DIALECT
.
JAVA
;
default
:
return
DIALECT
.
SQL
;
}
};
//
export
const
getTabIcon
=
(
type
:
string
,
size
?:
number
)
=>
{
export
const
getTabIcon
=
(
type
:
string
,
size
?:
number
)
=>
{
if
(
!
type
)
{
if
(
!
type
)
{
return
<
FileIcon
/>;
return
<
FileIcon
/>;
...
@@ -78,6 +109,8 @@ export const getTabIcon = (type: string, size?: number) => {
...
@@ -78,6 +109,8 @@ export const getTabIcon = (type: string, size?: number) => {
return
<
FlinkSQLSvg
/>;
return
<
FlinkSQLSvg
/>;
case
DIALECT
.
FLINKSQLENV
:
case
DIALECT
.
FLINKSQLENV
:
return
<
FlinkSQLEnvSvg
/>;
return
<
FlinkSQLEnvSvg
/>;
case
DIALECT
.
SQL
:
return
<
SQLIcons
size=
{
size
}
/>;
case
DIALECT
.
MYSQL
:
case
DIALECT
.
MYSQL
:
return
<
MysqlIcons
size=
{
size
}
/>;
return
<
MysqlIcons
size=
{
size
}
/>;
case
DIALECT
.
ORACLE
:
case
DIALECT
.
ORACLE
:
...
...
dinky-web/src/pages/DataStudio/RightContainer/JobConfig/function.tsx
View file @
3ec1e1fd
...
@@ -118,7 +118,7 @@ export const buildClusterConfigOptions = (current: any, clusterConfiguration: Cl
...
@@ -118,7 +118,7 @@ export const buildClusterConfigOptions = (current: any, clusterConfiguration: Cl
/**
/**
* build env options
* build env options
*/
*/
export
const
buildEnvOptions
=
(
env
:
any
[])
=>
{
export
const
buildEnvOptions
=
(
env
:
any
[]
,
isDisabled
:
boolean
)
=>
{
const
envList
:
DefaultOptionType
[]
=
[
const
envList
:
DefaultOptionType
[]
=
[
{
{
label
:
l
(
'button.disable'
),
label
:
l
(
'button.disable'
),
...
@@ -139,7 +139,8 @@ export const buildEnvOptions = (env: any[]) => {
...
@@ -139,7 +139,8 @@ export const buildEnvOptions = (env: any[]) => {
envList
.
push
({
envList
.
push
({
label
:
tag
,
label
:
tag
,
value
:
item
.
id
,
value
:
item
.
id
,
key
:
item
.
id
key
:
item
.
id
,
disabled
:
!
item
.
enabled
||
!
isDisabled
});
});
}
}
return
envList
;
return
envList
;
...
...
dinky-web/src/pages/DataStudio/RightContainer/JobConfig/index.tsx
View file @
3ec1e1fd
...
@@ -33,7 +33,7 @@ import {
...
@@ -33,7 +33,7 @@ import {
calculatorWidth
calculatorWidth
}
from
'@/pages/DataStudio/RightContainer/JobConfig/function'
;
}
from
'@/pages/DataStudio/RightContainer/JobConfig/function'
;
import
{
AlertStateType
,
ALERT_MODEL_ASYNC
}
from
'@/pages/RegCenter/Alert/AlertInstance/model'
;
import
{
AlertStateType
,
ALERT_MODEL_ASYNC
}
from
'@/pages/RegCenter/Alert/AlertInstance/model'
;
import
{
RUN_MODE
,
SWITCH_OPTIONS
}
from
'@/services/constants'
;
import
{
DIALECT
,
RUN_MODE
,
SWITCH_OPTIONS
}
from
'@/services/constants'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
InfoCircleOutlined
}
from
'@ant-design/icons'
;
import
{
InfoCircleOutlined
}
from
'@ant-design/icons'
;
import
{
import
{
...
@@ -46,7 +46,6 @@ import {
...
@@ -46,7 +46,6 @@ import {
ProFormText
ProFormText
}
from
'@ant-design/pro-components'
;
}
from
'@ant-design/pro-components'
;
import
{
Badge
,
Space
,
Typography
}
from
'antd'
;
import
{
Badge
,
Space
,
Typography
}
from
'antd'
;
import
{
useForm
}
from
'antd/es/form/Form'
;
import
{
debounce
}
from
'lodash'
;
import
{
debounce
}
from
'lodash'
;
import
{
useEffect
}
from
'react'
;
import
{
useEffect
}
from
'react'
;
import
{
connect
}
from
'umi'
;
import
{
connect
}
from
'umi'
;
...
@@ -171,6 +170,7 @@ const JobConfig = (props: any) => {
...
@@ -171,6 +170,7 @@ const JobConfig = (props: any) => {
className=
{
'data-studio-form'
}
className=
{
'data-studio-form'
}
style=
{
{
paddingInline
:
'15px'
,
overflow
:
'scroll'
}
}
style=
{
{
paddingInline
:
'15px'
,
overflow
:
'scroll'
}
}
form=
{
form
}
form=
{
form
}
initialValues=
{
current
}
submitter=
{
false
}
submitter=
{
false
}
layout=
'vertical'
layout=
'vertical'
onValuesChange=
{
debounce
(
onValuesChange
,
500
)
}
onValuesChange=
{
debounce
(
onValuesChange
,
500
)
}
...
@@ -211,7 +211,7 @@ const JobConfig = (props: any) => {
...
@@ -211,7 +211,7 @@ const JobConfig = (props: any) => {
name=
'envId'
name=
'envId'
label=
{
l
(
'pages.datastudio.label.jobConfig.flinksql.env'
)
}
label=
{
l
(
'pages.datastudio.label.jobConfig.flinksql.env'
)
}
tooltip=
{
l
(
'pages.datastudio.label.jobConfig.flinksql.env.tip1'
)
}
tooltip=
{
l
(
'pages.datastudio.label.jobConfig.flinksql.env.tip1'
)
}
options=
{
buildEnvOptions
(
env
)
}
options=
{
buildEnvOptions
(
env
,
current
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
)
}
rules=
{
[
rules=
{
[
{
required
:
true
,
message
:
l
(
'pages.datastudio.label.jobConfig.flinksql.env.tip1'
)
}
{
required
:
true
,
message
:
l
(
'pages.datastudio.label.jobConfig.flinksql.env.tip1'
)
}
]
}
]
}
...
@@ -227,17 +227,19 @@ const JobConfig = (props: any) => {
...
@@ -227,17 +227,19 @@ const JobConfig = (props: any) => {
max=
{
9999
}
max=
{
9999
}
min=
{
1
}
min=
{
1
}
/>
/>
{
current
?.
dialect
?.
toLowerCase
()
===
DIALECT
.
FLINK_SQL
&&
(
<
ProFormSwitch
label=
{
l
(
'pages.datastudio.label.jobConfig.insert'
)
}
name=
'statementSet'
valuePropName=
'checked'
tooltip=
{
{
title
:
l
(
'pages.datastudio.label.jobConfig.insert.tip'
),
icon
:
<
InfoCircleOutlined
/>
}
}
{
...
SWITCH_OPTIONS
()}
/>
)
}
<
ProFormSwitch
label=
{
l
(
'pages.datastudio.label.jobConfig.insert'
)
}
name=
'statementSet'
valuePropName=
'checked'
tooltip=
{
{
title
:
l
(
'pages.datastudio.label.jobConfig.insert.tip'
),
icon
:
<
InfoCircleOutlined
/>
}
}
{
...
SWITCH_OPTIONS
()}
/>
<
ProFormSwitch
<
ProFormSwitch
label=
{
l
(
'pages.datastudio.label.jobConfig.fragment'
)
}
label=
{
l
(
'pages.datastudio.label.jobConfig.fragment'
)
}
name=
'fragment'
name=
'fragment'
...
@@ -295,22 +297,6 @@ const JobConfig = (props: any) => {
...
@@ -295,22 +297,6 @@ const JobConfig = (props: any) => {
>
>
<
ProFormGroup
>
<
ProFormGroup
>
<
Space
key=
{
'config'
}
align=
'baseline'
>
<
Space
key=
{
'config'
}
align=
'baseline'
>
{
/* todo: 级联组件会受组件的 name 属性一致的影响,造成相同 name 属性值自动填充一样的值, 待寻找合适解决方案 */
}
{
/*<ProFormCascader*/
}
{
/* name={['index','key']} allowClear*/
}
{
/* width={calculatorWidth(rightContainer.width) + 30}*/
}
{
/* placeholder={l('pages.datastudio.label.jobConfig.addConfig.params')}*/
}
{
/* fieldProps={{*/
}
{
/* options: flinkConfigOptions,*/
}
{
/* showSearch: true,*/
}
{
/* }}*/
}
{
/* rules={[*/
}
{
/* {*/
}
{
/* required: true,*/
}
{
/* message: l('pages.datastudio.label.jobConfig.addConfig.params')*/
}
{
/* }*/
}
{
/* ]}*/
}
{
/*/>*/
}
<
ProFormSelect
<
ProFormSelect
name=
'key'
name=
'key'
width=
{
calculatorWidth
(
rightContainer
.
width
)
+
30
}
width=
{
calculatorWidth
(
rightContainer
.
width
)
+
30
}
...
...
dinky-web/src/pages/DataStudio/constants.tsx
View file @
3ec1e1fd
/*
/*
*
*
*
Licensed to the Apache Software Foundation (ASF) under one or more
* Licensed to the Apache Software Foundation (ASF) under one or more
*
contributor license agreements. See the NOTICE file distributed with
* contributor license agreements. See the NOTICE file distributed with
*
this work for additional information regarding copyright ownership.
* this work for additional information regarding copyright ownership.
*
The ASF licenses this file to You under the Apache License, Version 2.0
* 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 not use this file except in compliance with
*
the License. You may obtain a copy of the License at
* 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
* Unless required by applicable law or agreed to in writing, software
*
distributed under the License is distributed on an "AS IS" BASIS,
* distributed under the License is distributed on an "AS IS" BASIS,
*
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
*
limitations under the License.
* limitations under the License.
*
*
*/
*/
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
CloseCircleTwoTone
,
IssuesCloseOutlined
}
from
'@ant-design/icons'
;
import
{
Space
}
from
'antd'
;
import
{
DefaultOptionType
}
from
'antd/es/select'
;
import
{
DefaultOptionType
}
from
'antd/es/select'
;
import
{
MenuItemType
}
from
'rc-menu/lib/interface'
;
import
{
MenuItemType
}
from
'rc-menu/lib/interface'
;
export
const
STUDIO_TAG_RIGHT_CONTEXT_MENU
:
MenuItemType
[]
=
[
export
const
STUDIO_TAG_RIGHT_CONTEXT_MENU
:
MenuItemType
[]
=
[
{
{
key
:
'closeAll'
,
key
:
'closeAll'
,
label
:
l
(
'right.menu.closeAll'
)
label
:
(
<
Space
>
<
CloseCircleTwoTone
/>
{
l
(
'right.menu.closeAll'
)
}
</
Space
>
)
},
},
{
{
key
:
'closeOther'
,
key
:
'closeOther'
,
label
:
l
(
'right.menu.closeOther'
)
label
:
(
<
Space
>
<
IssuesCloseOutlined
className=
{
'blue-icon'
}
/>
{
l
(
'right.menu.closeOther'
)
}
</
Space
>
)
}
}
];
];
...
...
dinky-web/src/pages/DataStudio/route.tsx
View file @
3ec1e1fd
...
@@ -126,7 +126,7 @@ export const RightSide: TabProp[] = [
...
@@ -126,7 +126,7 @@ export const RightSide: TabProp[] = [
icon
:
<
InfoCircleOutlined
/>,
icon
:
<
InfoCircleOutlined
/>,
label
:
l
(
'menu.datastudio.jobInfo'
),
label
:
l
(
'menu.datastudio.jobInfo'
),
children
:
<
JobInfo
/>,
children
:
<
JobInfo
/>,
isShow
:
(
type
)
=>
type
!==
TabsPageType
.
None
isShow
:
(
type
)
=>
type
===
TabsPageType
.
project
}
}
];
];
...
...
dinky-web/src/pages/Metrics/Job/index.tsx
View file @
3ec1e1fd
This diff is collapsed.
Click to expand it.
dinky-web/src/pages/RegCenter/Alert/AlertInstance/constans.ts
View file @
3ec1e1fd
/*
/*
* 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
* 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.
*
*
* 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
{
ALERT_TYPE
}
from
'@/types/RegCenter/data.d'
;
import
{
ALERT_TYPE
}
from
'@/types/RegCenter/data.d'
;
...
@@ -43,7 +45,7 @@ export const ALERT_TYPE_LIST_OPTIONS: DefaultOptionType[] = [
...
@@ -43,7 +45,7 @@ export const ALERT_TYPE_LIST_OPTIONS: DefaultOptionType[] = [
{
{
label
:
l
(
'rc.ai.sms'
),
label
:
l
(
'rc.ai.sms'
),
value
:
ALERT_TYPE
.
SMS
,
value
:
ALERT_TYPE
.
SMS
,
disabled
:
false
disabled
:
true
// todo: 短信功能暂时不实现, 禁用, 后续实现后再打开
}
}
];
];
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/YarnConfig/index.tsx
View file @
3ec1e1fd
...
@@ -39,7 +39,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
...
@@ -39,7 +39,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
<
Divider
>
{
l
(
'rc.cc.hadoopConfig'
)
}
</
Divider
>
<
Divider
>
{
l
(
'rc.cc.hadoopConfig'
)
}
</
Divider
>
<
ProFormGroup
>
<
ProFormGroup
>
<
ProFormText
<
ProFormText
name=
{
[
'config'
,
'clusterConfig'
,
'hadoopConfigPath'
]
}
name=
{
[
'config'
,
'clusterConfig'
,
'hadoopConfigPath'
]
}
label=
{
l
(
'rc.cc.hadoopConfigPath'
)
}
label=
{
l
(
'rc.cc.hadoopConfigPath'
)
}
width=
'md'
width=
'md'
rules=
{
[
rules=
{
[
...
@@ -79,7 +79,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
...
@@ -79,7 +79,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
<
Divider
>
{
l
(
'rc.cc.flinkConfig'
)
}
</
Divider
>
<
Divider
>
{
l
(
'rc.cc.flinkConfig'
)
}
</
Divider
>
<
ProFormGroup
>
<
ProFormGroup
>
<
ProFormText
<
ProFormText
name=
{
[
'config'
,
'clusterConfig'
,
'flinkLibPath'
]
}
name=
{
[
'config'
,
'clusterConfig'
,
'flinkLibPath'
]
}
label=
{
l
(
'rc.cc.libPath'
)
}
label=
{
l
(
'rc.cc.libPath'
)
}
width=
'md'
width=
'md'
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.cc.libPathPlaceholder'
)
}]
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.cc.libPathPlaceholder'
)
}]
}
...
@@ -88,7 +88,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
...
@@ -88,7 +88,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
/>
/>
<
ProFormText
<
ProFormText
name=
{
[
'config'
,
'clusterConfig'
,
'flinkConfigPath'
]
}
name=
{
[
'config'
,
'clusterConfig'
,
'flinkConfigPath'
]
}
label=
{
l
(
'rc.cc.flinkConfigPath'
)
}
label=
{
l
(
'rc.cc.flinkConfigPath'
)
}
width=
'md'
width=
'md'
rules=
{
[
rules=
{
[
...
...
dinky-web/src/services/constants.tsx
View file @
3ec1e1fd
...
@@ -219,13 +219,12 @@ export const DIALECT = {
...
@@ -219,13 +219,12 @@ export const DIALECT = {
ORACLE
:
'oracle'
,
ORACLE
:
'oracle'
,
SQLSERVER
:
'sqlserver'
,
SQLSERVER
:
'sqlserver'
,
POSTGRESQL
:
'postgresql'
,
POSTGRESQL
:
'postgresql'
,
CLICKHOUSE
:
'click
H
ouse'
,
CLICKHOUSE
:
'click
h
ouse'
,
DORIS
:
'doris'
,
DORIS
:
'doris'
,
HIVE
:
'hive'
,
HIVE
:
'hive'
,
PHOENIX
:
'phoenix'
,
PHOENIX
:
'phoenix'
,
STARROCKS
:
'starRocks'
,
STARROCKS
:
'starrocks'
,
PRESTO
:
'presto'
,
PRESTO
:
'presto'
KUBERNETES_APPLICATION
:
'kubernetesapplication'
};
};
export
const
RUN_MODE
=
{
export
const
RUN_MODE
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment