Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
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
zhaowei
dlink
Commits
4ce997d6
Unverified
Commit
4ce997d6
authored
Jun 28, 2022
by
aiwenmo
Committed by
GitHub
Jun 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature-654][web] Add task info tab (#655)
Co-authored-by:
wenmo
<
32723967+wenmo@users.noreply.github.com
>
parent
bb8f3706
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
25 deletions
+136
-25
index.less
...mponents/Studio/StudioRightTool/StudioTaskInfo/index.less
+14
-0
index.tsx
...omponents/Studio/StudioRightTool/StudioTaskInfo/index.tsx
+87
-0
index.tsx
dlink-web/src/components/Studio/StudioRightTool/index.tsx
+35
-25
No files found.
dlink-web/src/components/Studio/StudioRightTool/StudioTaskInfo/index.less
0 → 100644
View file @
4ce997d6
@import '~antd/es/style/themes/default.less';
.form_setting{
padding-left: 10px;
}
.form_item{
margin-bottom: 5px;
}
:global {
.ant-descriptions-small div.ant-typography, .ant-typography p {
margin-bottom: 0;
}
}
dlink-web/src/components/Studio/StudioRightTool/StudioTaskInfo/index.tsx
0 → 100644
View file @
4ce997d6
import
{
connect
}
from
"umi"
;
import
{
StateType
}
from
"@/pages/DataStudio/model"
;
import
{
Form
,
Row
,
Col
,
Tooltip
,
Button
,
Input
,
Descriptions
,
Typography
}
from
"antd"
;
import
{
MinusSquareOutlined
}
from
"@ant-design/icons"
;
import
styles
from
"./index.less"
;
import
{
Scrollbars
}
from
'react-custom-scrollbars'
;
const
{
TextArea
}
=
Input
;
const
{
Paragraph
}
=
Typography
;
const
StudioTaskInfo
=
(
props
:
any
)
=>
{
const
{
current
,
form
,
dispatch
,
tabs
,
toolHeight
}
=
props
;
form
.
setFieldsValue
(
current
.
task
);
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
let
newTabs
=
tabs
;
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
)
{
if
(
newTabs
.
panes
[
i
].
key
==
newTabs
.
activeKey
)
{
for
(
let
key
in
change
)
{
newTabs
.
panes
[
i
].
task
[
key
]
=
change
[
key
];
}
break
;
}
}
dispatch
&&
dispatch
({
type
:
"Studio/saveTabs"
,
payload
:
newTabs
,
});
};
return
(
<>
<
Row
>
<
Col
span=
{
24
}
>
<
div
style=
{
{
float
:
"right"
}
}
>
<
Tooltip
title=
"最小化"
>
<
Button
type=
"text"
icon=
{
<
MinusSquareOutlined
/>
}
/>
</
Tooltip
>
</
div
>
</
Col
>
</
Row
>
<
Scrollbars
style=
{
{
height
:
(
toolHeight
-
32
)}
}
>
<
Descriptions
bordered
size=
"small"
column=
{
1
}
>
<
Descriptions
.
Item
label=
"ID"
>
<
Paragraph
copyable
>
{
current
.
task
.
id
}
</
Paragraph
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"标题"
>
{
current
.
task
.
alias
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"方言"
>
{
current
.
task
.
dialect
}
</
Descriptions
.
Item
>
</
Descriptions
>
<
Form
form=
{
form
}
layout=
"vertical"
className=
{
styles
.
form_setting
}
onValuesChange=
{
onValuesChange
}
>
<
Row
>
<
Col
span=
{
24
}
>
<
Form
.
Item
label=
"备注"
className=
{
styles
.
form_item
}
name=
"note"
>
<
TextArea
rows=
{
4
}
maxLength=
{
255
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Form
>
</
Scrollbars
>
</>
);
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
current
:
Studio
.
current
,
tabs
:
Studio
.
tabs
,
toolHeight
:
Studio
.
toolHeight
,
}))(
StudioTaskInfo
);
dlink-web/src/components/Studio/StudioRightTool/index.tsx
View file @
4ce997d6
import
{
Tabs
,
Empty
,
Form
}
from
"antd"
;
import
{
Tabs
}
from
"antd"
;
import
{
SettingOutlined
,
Schedule
Outlined
}
from
"@ant-design/icons"
;
import
{
SettingOutlined
,
ScheduleOutlined
,
Container
Outlined
}
from
"@ant-design/icons"
;
import
{
StateType
}
from
"@/pages/DataStudio/model"
;
import
{
StateType
}
from
"@/pages/DataStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
"umi"
;
import
StudioConfig
from
"./StudioConfig"
;
import
StudioConfig
from
"./StudioConfig"
;
...
@@ -10,33 +10,42 @@ import StudioSqlConfig from "./StudioSqlConfig";
...
@@ -10,33 +10,42 @@ import StudioSqlConfig from "./StudioSqlConfig";
import
StudioUDFInfo
from
"./StudioUDFInfo"
;
import
StudioUDFInfo
from
"./StudioUDFInfo"
;
import
StudioJarSetting
from
"./StudioJarSetting"
;
import
StudioJarSetting
from
"./StudioJarSetting"
;
import
StudioGuide
from
"./StudioGuide"
;
import
StudioGuide
from
"./StudioGuide"
;
import
StudioTaskInfo
from
"./StudioTaskInfo"
;
import
{
DIALECT
,
isSql
}
from
"@/components/Studio/conf"
;
import
{
DIALECT
,
isSql
}
from
"@/components/Studio/conf"
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
const
StudioRightTool
=
(
props
:
any
)
=>
{
const
StudioRightTool
=
(
props
:
any
)
=>
{
const
{
current
,
form
,
toolHeight
}
=
props
;
const
{
current
,
form
,
toolHeight
}
=
props
;
const
renderContent
=
()
=>
{
const
renderContent
=
()
=>
{
if
(
isSql
(
current
.
task
.
dialect
))
{
if
(
isSql
(
current
.
task
.
dialect
))
{
return
renderSqlContent
();
return
renderSqlContent
();
}
}
if
(
DIALECT
.
FLINKJAR
===
current
.
task
.
dialect
)
{
if
(
DIALECT
.
FLINKJAR
===
current
.
task
.
dialect
)
{
return
renderJarContent
();
return
renderJarContent
();
}
}
if
(
DIALECT
.
FLINKSQLENV
===
current
.
task
.
dialect
)
{
if
(
DIALECT
.
FLINKSQLENV
===
current
.
task
.
dialect
)
{
return
renderEnvContent
();
return
renderEnvContent
();
}
}
if
(
DIALECT
.
JAVA
===
current
.
task
.
dialect
)
{
if
(
DIALECT
.
JAVA
===
current
.
task
.
dialect
)
{
return
renderUDFContent
();
return
renderUDFContent
();
}
}
return
renderFlinkSqlContent
();
return
renderFlinkSqlContent
();
};
};
const
renderTaskInfoContent
=
()
=>
{
return
(
<
TabPane
tab=
{
<
span
><
ContainerOutlined
/>
作业信息
</
span
>
}
key=
"StudioTaskInfo"
>
<
StudioTaskInfo
form=
{
form
}
/>
</
TabPane
>
)
};
const
renderSqlContent
=
()
=>
{
const
renderSqlContent
=
()
=>
{
return
(<>
return
(<>
<
TabPane
tab=
{
<
span
><
S
cheduleOutlined
/>
执行配置
</
span
>
}
key=
"StudioSqlConfig"
>
<
TabPane
tab=
{
<
span
><
S
ettingOutlined
/>
执行配置
</
span
>
}
key=
"StudioSqlConfig"
>
<
StudioSqlConfig
form=
{
form
}
/>
<
StudioSqlConfig
form=
{
form
}
/>
</
TabPane
>
</
TabPane
>
</>)
</>)
...
@@ -44,7 +53,7 @@ const StudioRightTool = (props: any) => {
...
@@ -44,7 +53,7 @@ const StudioRightTool = (props: any) => {
const
renderJarContent
=
()
=>
{
const
renderJarContent
=
()
=>
{
return
(<>
return
(<>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioJarSetting"
>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioJarSetting"
>
<
StudioJarSetting
form=
{
form
}
/>
<
StudioJarSetting
form=
{
form
}
/>
</
TabPane
>
</
TabPane
>
</>)
</>)
...
@@ -52,7 +61,7 @@ const StudioRightTool = (props: any) => {
...
@@ -52,7 +61,7 @@ const StudioRightTool = (props: any) => {
const
renderEnvContent
=
()
=>
{
const
renderEnvContent
=
()
=>
{
return
(<>
return
(<>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioEnvSetting"
>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioEnvSetting"
>
<
StudioEnvSetting
form=
{
form
}
/>
<
StudioEnvSetting
form=
{
form
}
/>
</
TabPane
>
</
TabPane
>
</>)
</>)
...
@@ -60,36 +69,37 @@ const StudioRightTool = (props: any) => {
...
@@ -60,36 +69,37 @@ const StudioRightTool = (props: any) => {
const
renderUDFContent
=
()
=>
{
const
renderUDFContent
=
()
=>
{
return
(<>
return
(<>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
UDF信息
</
span
>
}
key=
"StudioUDFInfo"
>
<
TabPane
tab=
{
<
span
><
SettingOutlined
/>
UDF信息
</
span
>
}
key=
"StudioUDFInfo"
>
<
StudioUDFInfo
form=
{
form
}
/>
<
StudioUDFInfo
form=
{
form
}
/>
</
TabPane
>
</
TabPane
>
</>)
</>)
};
};
const
renderFlinkSqlContent
=
()
=>
{
const
renderFlinkSqlContent
=
()
=>
{
return
(<><
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioSetting"
>
return
(<><
TabPane
tab=
{
<
span
><
SettingOutlined
/>
作业配置
</
span
>
}
key=
"StudioSetting"
>
<
StudioSetting
form=
{
form
}
/>
<
StudioSetting
form=
{
form
}
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
><
S
cheduleOutlined
/>
执行配置
</
span
>
}
key=
"StudioConfig"
>
<
TabPane
tab=
{
<
span
><
S
ettingOutlined
/>
执行配置
</
span
>
}
key=
"StudioConfig"
>
<
StudioConfig
form=
{
form
}
/>
<
StudioConfig
form=
{
form
}
/>
</
TabPane
>
</
TabPane
>
<
TabPane
tab=
{
<
span
><
ScheduleOutlined
/>
保存点
</
span
>
}
key=
"StudioSavePoint"
>
<
TabPane
tab=
{
<
span
><
ScheduleOutlined
/>
保存点
</
span
>
}
key=
"StudioSavePoint"
>
<
StudioSavePoint
/>
<
StudioSavePoint
/>
</
TabPane
>
</
TabPane
>
</>)
</>)
};
};
return
(
return
(
<>
<>
{
current
?.
task
?
{
current
?.
task
?
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
toolHeight
}
}
>
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
toolHeight
}
}
>
{
renderContent
()
}
{
renderContent
()
}
</
Tabs
>:<
StudioGuide
toolHeight=
{
toolHeight
}
/>
}
{
renderTaskInfoContent
()
}
</
Tabs
>
:
<
StudioGuide
toolHeight=
{
toolHeight
}
/>
}
</>
</>
);
);
};
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
sql
:
Studio
.
sql
,
sql
:
Studio
.
sql
,
toolHeight
:
Studio
.
toolHeight
,
toolHeight
:
Studio
.
toolHeight
,
current
:
Studio
.
current
,
current
:
Studio
.
current
,
...
...
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