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
16835aa3
Unverified
Commit
16835aa3
authored
Oct 10, 2023
by
zhu-mingye
Committed by
GitHub
Oct 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor lineage (#2369)
* support_lineage * fix dep
parent
578126ce
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
817 additions
and
106 deletions
+817
-106
JobDataDto.java
dinky-admin/src/main/java/org/dinky/data/dto/JobDataDto.java
+3
-3
JobRefreshHandler.java
...rc/main/java/org/dinky/job/handler/JobRefreshHandler.java
+5
-5
db-h2.sql
dinky-admin/src/main/resources/db/db-h2.sql
+1
-1
ExceptionRule.java
...se/src/main/java/org/dinky/alert/Rules/ExceptionRule.java
+7
-6
pom.xml
dinky-common/pom.xml
+4
-1
FlinkJobNodeBackPressure.java
...nky/data/flink/backpressure/FlinkJobNodeBackPressure.java
+1
-1
ExecutionConfig.java
...ain/java/org/dinky/data/flink/config/ExecutionConfig.java
+1
-1
FlinkJobConfigInfo.java
.../java/org/dinky/data/flink/config/FlinkJobConfigInfo.java
+1
-1
FlinkJobExceptionsDetail.java
...dinky/data/flink/exceptions/FlinkJobExceptionsDetail.java
+1
-1
FlinkJobDetailInfo.java
...ain/java/org/dinky/data/flink/job/FlinkJobDetailInfo.java
+1
-1
FlinkJobPlan.java
.../src/main/java/org/dinky/data/flink/job/FlinkJobPlan.java
+1
-1
FlinkJobPlanNode.java
.../main/java/org/dinky/data/flink/job/FlinkJobPlanNode.java
+3
-3
FlinkJobPlanNodeInput.java
.../java/org/dinky/data/flink/job/FlinkJobPlanNodeInput.java
+1
-1
FlinkJobVertex.java
...rc/main/java/org/dinky/data/flink/job/FlinkJobVertex.java
+1
-1
FlinkJobNodeWaterMark.java
...org/dinky/data/flink/watermark/FlinkJobNodeWaterMark.java
+1
-1
package.json
dinky-web/package.json
+2
-0
CircleBtn.tsx
dinky-web/src/components/CallBackButton/CircleBtn.tsx
+2
-2
DagDataNode.tsx
dinky-web/src/components/FlinkDag/component/DagDataNode.tsx
+13
-3
index.tsx
dinky-web/src/components/FlinkDag/index.tsx
+0
-0
index.tsx
dinky-web/src/components/LineageGraph/index.tsx
+353
-0
global.less
dinky-web/src/global.less
+155
-0
pages.ts
dinky-web/src/locales/en-US/pages.ts
+12
-1
pages.ts
dinky-web/src/locales/zh-CN/pages.ts
+12
-1
index.tsx
...eb/src/pages/DataStudio/BottomContainer/Lineage/index.tsx
+79
-0
index.tsx
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
+11
-10
index.tsx
.../pages/DataStudio/LeftContainer/Project/JobTree/index.tsx
+16
-18
index.tsx
...-web/src/pages/DataStudio/LeftContainer/Project/index.tsx
+0
-1
index.tsx
dinky-web/src/pages/DataStudio/LeftContainer/index.tsx
+15
-3
route.tsx
dinky-web/src/pages/DataStudio/route.tsx
+8
-5
CkDesc.tsx
...ges/DevOps/JobDetail/CheckPointsTab/components/CkDesc.tsx
+21
-30
index.tsx
dinky-web/src/pages/DevOps/JobDetail/JobLineage/index.tsx
+46
-0
JobOverview.tsx
...eb/src/pages/DevOps/JobDetail/JobOverview/JobOverview.tsx
+5
-1
index.tsx
dinky-web/src/pages/DevOps/JobDetail/index.tsx
+2
-1
index.tsx
dinky-web/src/pages/Metrics/Job/index.tsx
+0
-0
endpoints.tsx
dinky-web/src/services/endpoints.tsx
+4
-0
data.d.ts
dinky-web/src/types/DevOps/data.d.ts
+25
-0
dinky-mysql.sql
script/sql/dinky-mysql.sql
+1
-1
dinky-pg.sql
script/sql/dinky-pg.sql
+1
-1
dinky_dml.sql
script/sql/upgrade/1.0.0-SNAPSHOT_schema/mysql/dinky_dml.sql
+2
-0
No files found.
dinky-admin/src/main/java/org/dinky/data/dto/JobDataDto.java
View file @
16835aa3
...
@@ -19,10 +19,10 @@
...
@@ -19,10 +19,10 @@
package
org
.
dinky
.
data
.
dto
;
package
org
.
dinky
.
data
.
dto
;
import
org.dinky.data.flink.config.FlinkJobConfigInfo
;
import
org.dinky.data.flink.exceptions.FlinkJobExceptionsDetail
;
import
org.dinky.data.flink.job.FlinkJobDetailInfo
;
import
org.dinky.data.model.JobHistory
;
import
org.dinky.data.model.JobHistory
;
import
org.dinky.data.model.flink.config.FlinkJobConfigInfo
;
import
org.dinky.data.model.flink.exceptions.FlinkJobExceptionsDetail
;
import
org.dinky.data.model.flink.job.FlinkJobDetailInfo
;
import
org.dinky.utils.JsonUtils
;
import
org.dinky.utils.JsonUtils
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
...
dinky-admin/src/main/java/org/dinky/job/handler/JobRefreshHandler.java
View file @
16835aa3
...
@@ -26,13 +26,13 @@ import org.dinky.data.constant.FlinkRestResultConstant;
...
@@ -26,13 +26,13 @@ import org.dinky.data.constant.FlinkRestResultConstant;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.dto.JobDataDto
;
import
org.dinky.data.dto.JobDataDto
;
import
org.dinky.data.enums.JobStatus
;
import
org.dinky.data.enums.JobStatus
;
import
org.dinky.data.flink.backpressure.FlinkJobNodeBackPressure
;
import
org.dinky.data.flink.config.FlinkJobConfigInfo
;
import
org.dinky.data.flink.exceptions.FlinkJobExceptionsDetail
;
import
org.dinky.data.flink.job.FlinkJobDetailInfo
;
import
org.dinky.data.flink.watermark.FlinkJobNodeWaterMark
;
import
org.dinky.data.model.JobInfoDetail
;
import
org.dinky.data.model.JobInfoDetail
;
import
org.dinky.data.model.JobInstance
;
import
org.dinky.data.model.JobInstance
;
import
org.dinky.data.model.flink.backpressure.FlinkJobNodeBackPressure
;
import
org.dinky.data.model.flink.config.FlinkJobConfigInfo
;
import
org.dinky.data.model.flink.exceptions.FlinkJobExceptionsDetail
;
import
org.dinky.data.model.flink.job.FlinkJobDetailInfo
;
import
org.dinky.data.model.flink.watermark.FlinkJobNodeWaterMark
;
import
org.dinky.gateway.Gateway
;
import
org.dinky.gateway.Gateway
;
import
org.dinky.gateway.config.GatewayConfig
;
import
org.dinky.gateway.config.GatewayConfig
;
import
org.dinky.gateway.enums.GatewayType
;
import
org.dinky.gateway.enums.GatewayType
;
...
...
dinky-admin/src/main/resources/db/db-h2.sql
View file @
16835aa3
...
@@ -1338,7 +1338,7 @@ CREATE TABLE `dinky_task` (
...
@@ -1338,7 +1338,7 @@ CREATE TABLE `dinky_task` (
`alert_group_id`
bigint
(
20
)
null
DEFAULT
null
COMMENT
'alert group id'
,
`alert_group_id`
bigint
(
20
)
null
DEFAULT
null
COMMENT
'alert group id'
,
`config_json`
text
null
COMMENT
'configuration json'
,
`config_json`
text
null
COMMENT
'configuration json'
,
`note`
varchar
(
255
)
null
DEFAULT
null
COMMENT
'Job Note'
,
`note`
varchar
(
255
)
null
DEFAULT
null
COMMENT
'Job Note'
,
`step`
int
(
11
)
null
DEFAULT
null
COMMENT
'Job lifecycle'
,
`step`
int
(
11
)
null
DEFAULT
1
COMMENT
'Job lifecycle'
,
`job_instance_id`
bigint
(
20
)
null
DEFAULT
null
COMMENT
'job instance id'
,
`job_instance_id`
bigint
(
20
)
null
DEFAULT
null
COMMENT
'job instance id'
,
`enabled`
tinyint
(
1
)
NOT
null
DEFAULT
1
COMMENT
'is enable'
,
`enabled`
tinyint
(
1
)
NOT
null
DEFAULT
1
COMMENT
'is enable'
,
`create_time`
datetime
(
0
)
null
DEFAULT
null
COMMENT
'create time'
,
`create_time`
datetime
(
0
)
null
DEFAULT
null
COMMENT
'create time'
,
...
...
dinky-alert/dinky-alert-base/src/main/java/org/dinky/alert/Rules/ExceptionRule.java
View file @
16835aa3
...
@@ -19,9 +19,10 @@
...
@@ -19,9 +19,10 @@
package
org
.
dinky
.
alert
.
Rules
;
package
org
.
dinky
.
alert
.
Rules
;
import
org.dinky.data.flink.exceptions.FlinkJobExceptionsDetail
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.google.common.cache.CacheBuilder
;
import
com.google.common.cache.CacheBuilder
;
import
com.google.common.cache.CacheLoader
;
import
com.google.common.cache.CacheLoader
;
import
com.google.common.cache.LoadingCache
;
import
com.google.common.cache.LoadingCache
;
...
@@ -43,20 +44,20 @@ public class ExceptionRule {
...
@@ -43,20 +44,20 @@ public class ExceptionRule {
* @param exceptions The exceptions object containing relevant data.
* @param exceptions The exceptions object containing relevant data.
* @return True if the operation should be executed, false otherwise.
* @return True if the operation should be executed, false otherwise.
*/
*/
public
Boolean
isException
(
Integer
key
,
ObjectNode
exceptions
)
{
public
Boolean
isException
(
Integer
key
,
FlinkJobExceptionsDetail
exceptions
)
{
// If the exception is the same as the previous one, it will not be reported again
// If the exception is the same as the previous one, it will not be reported again
if
(
exceptions
.
get
(
"timestamp"
)
==
null
)
{
if
(
exceptions
.
get
Timestamp
(
)
==
null
)
{
return
false
;
return
false
;
}
}
long
timestamp
=
exceptions
.
get
(
"timestamp"
).
asLong
(
0
);
long
timestamp
=
exceptions
.
get
Timestamp
(
);
Long
hisTimeIfPresent
=
hisTime
.
getIfPresent
(
key
);
Long
hisTimeIfPresent
=
hisTime
.
getIfPresent
(
key
);
if
(
hisTimeIfPresent
!=
null
&&
hisTimeIfPresent
==
timestamp
)
{
if
(
hisTimeIfPresent
!=
null
&&
hisTimeIfPresent
==
timestamp
)
{
return
false
;
return
false
;
}
}
hisTime
.
put
(
key
,
timestamp
);
hisTime
.
put
(
key
,
timestamp
);
if
(
exceptions
.
has
(
"root-exception"
)
)
{
if
(
exceptions
.
getRootException
()
!=
null
)
{
return
!
exceptions
.
get
(
"root-exception"
).
isNull
();
return
!
exceptions
.
get
RootException
().
isEmpty
();
}
else
{
}
else
{
return
false
;
return
false
;
}
}
...
...
dinky-common/pom.xml
View file @
16835aa3
...
@@ -51,7 +51,10 @@
...
@@ -51,7 +51,10 @@
<groupId>
cn.hutool
</groupId>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<artifactId>
hutool-all
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
com.alibaba.fastjson2
</groupId>
<artifactId>
fastjson2
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
com.github.docker-java
</groupId>
<groupId>
com.github.docker-java
</groupId>
<artifactId>
docker-java-core
</artifactId>
<artifactId>
docker-java-core
</artifactId>
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/backpressure/FlinkJobNodeBackPressure.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/backpressure/FlinkJobNodeBackPressure.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
backpressure
;
package
org
.
dinky
.
data
.
flink
.
backpressure
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/config/ExecutionConfig.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/config/ExecutionConfig.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
config
;
package
org
.
dinky
.
data
.
flink
.
config
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/config/FlinkJobConfigInfo.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/config/FlinkJobConfigInfo.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
config
;
package
org
.
dinky
.
data
.
flink
.
config
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/exceptions/FlinkJobExceptionsDetail.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/exceptions/FlinkJobExceptionsDetail.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
exceptions
;
package
org
.
dinky
.
data
.
flink
.
exceptions
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/job/FlinkJobDetailInfo.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/job/FlinkJobDetailInfo.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
job
;
package
org
.
dinky
.
data
.
flink
.
job
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/job/FlinkJobPlan.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/job/FlinkJobPlan.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
job
;
package
org
.
dinky
.
data
.
flink
.
job
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/job/FlinkJobPlanNode.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/job/FlinkJobPlanNode.java
View file @
16835aa3
...
@@ -17,10 +17,10 @@
...
@@ -17,10 +17,10 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
job
;
package
org
.
dinky
.
data
.
flink
.
job
;
import
org.dinky.data.
model.
flink.backpressure.FlinkJobNodeBackPressure
;
import
org.dinky.data.flink.backpressure.FlinkJobNodeBackPressure
;
import
org.dinky.data.
model.
flink.watermark.FlinkJobNodeWaterMark
;
import
org.dinky.data.flink.watermark.FlinkJobNodeWaterMark
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/job/FlinkJobPlanNodeInput.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/job/FlinkJobPlanNodeInput.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
job
;
package
org
.
dinky
.
data
.
flink
.
job
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/job/FlinkJobVertex.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/job/FlinkJobVertex.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
job
;
package
org
.
dinky
.
data
.
flink
.
job
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Map
;
import
java.util.Map
;
...
...
dinky-
admin/src/main/java/org/dinky/data/model
/flink/watermark/FlinkJobNodeWaterMark.java
→
dinky-
common/src/main/java/org/dinky/data
/flink/watermark/FlinkJobNodeWaterMark.java
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
package
org
.
dinky
.
data
.
model
.
flink
.
watermark
;
package
org
.
dinky
.
data
.
flink
.
watermark
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
...
dinky-web/package.json
View file @
16835aa3
...
@@ -47,6 +47,7 @@
...
@@ -47,6 +47,7 @@
"@monaco-editor/react"
:
"^4.5.2"
,
"@monaco-editor/react"
:
"^4.5.2"
,
"@umijs/route-utils"
:
"^4.0.1"
,
"@umijs/route-utils"
:
"^4.0.1"
,
"antd"
:
"^5.9.3"
,
"antd"
:
"^5.9.3"
,
"butterfly-dag"
:
"^4.3.28"
,
"classnames"
:
"^2.3.2"
,
"classnames"
:
"^2.3.2"
,
"dayjs"
:
"^1.11.10"
,
"dayjs"
:
"^1.11.10"
,
"js-cookie"
:
"^3.0.5"
,
"js-cookie"
:
"^3.0.5"
,
...
@@ -62,6 +63,7 @@
...
@@ -62,6 +63,7 @@
"react-countup"
:
"^6.4.2"
,
"react-countup"
:
"^6.4.2"
,
"react-dom"
:
"^18.0.0"
,
"react-dom"
:
"^18.0.0"
,
"react-helmet-async"
:
"^1.3.0"
,
"react-helmet-async"
:
"^1.3.0"
,
"react-lineage-dag"
:
"^2.0.36"
,
"react-markdown"
:
"^8.0.7"
,
"react-markdown"
:
"^8.0.7"
,
"react-spring"
:
"^9.7.3"
,
"react-spring"
:
"^9.7.3"
,
"react-use-cookie"
:
"^1.4.0"
,
"react-use-cookie"
:
"^1.4.0"
,
...
...
dinky-web/src/components/CallBackButton/CircleBtn.tsx
View file @
16835aa3
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
*
*
*/
*/
import
{
TabsItemType
}
from
'@/pages/DataStudio/model'
;
import
{
Button
}
from
'antd'
;
import
{
Button
}
from
'antd'
;
import
React
from
'react'
;
import
React
from
'react'
;
import
{
TabsItemType
}
from
"@/pages/DataStudio/model"
;
export
type
CircleButtonProps
=
{
export
type
CircleButtonProps
=
{
icon
:
React
.
ReactNode
;
icon
:
React
.
ReactNode
;
...
@@ -30,7 +30,7 @@ export type CircleButtonProps = {
...
@@ -30,7 +30,7 @@ export type CircleButtonProps = {
export
type
CircleDataStudioButtonProps
=
{
export
type
CircleDataStudioButtonProps
=
{
icon
:
React
.
ReactNode
;
icon
:
React
.
ReactNode
;
loading
?:
boolean
;
loading
?:
boolean
;
onClick
?:
(
panes
:
TabsItemType
[],
activeKey
:
string
)
=>
void
;
onClick
?:
(
panes
:
TabsItemType
[],
activeKey
:
string
)
=>
void
;
title
?:
string
;
title
?:
string
;
key
?:
string
;
key
?:
string
;
};
};
...
...
dinky-web/src/components/FlinkDag/component/DagDataNode.tsx
View file @
16835aa3
...
@@ -98,13 +98,20 @@ const DagDataNode = (props: any) => {
...
@@ -98,13 +98,20 @@ const DagDataNode = (props: any) => {
<
Text
style=
{
{
display
:
'inline-flex'
,
alignItems
:
'center'
}
}
type=
'secondary'
>
<
Text
style=
{
{
display
:
'inline-flex'
,
alignItems
:
'center'
}
}
type=
'secondary'
>
{
' '
}
{
' '
}
{
l
(
'devops.baseinfo.busy'
)
}
:
{
l
(
'devops.baseinfo.busy'
)
}
:
{
renderRatio
((
backpressure
&&
backpressure
.
subtasks
)?
backpressure
.
subtasks
[
0
]?.
busyRatio
:
0
,
false
)
}
{
renderRatio
(
backpressure
&&
backpressure
.
subtasks
?
backpressure
.
subtasks
[
0
]?.
busyRatio
:
0
,
false
)
}
</
Text
>
</
Text
>
</
Col
>
</
Col
>
<
Col
flex=
'auto'
>
<
Col
flex=
'auto'
>
<
Text
type=
'secondary'
ellipsis
>
<
Text
type=
'secondary'
ellipsis
>
{
l
(
'devops.baseinfo.backpressure'
)
}
:
{
l
(
'devops.baseinfo.backpressure'
)
}
:
<
StatusTag
status=
{
backpressure
?
backpressure
.
status
:
0
}
bordered=
{
false
}
animation=
{
false
}
/>
<
StatusTag
status=
{
backpressure
?
backpressure
.
status
:
0
}
bordered=
{
false
}
animation=
{
false
}
/>
</
Text
>
</
Text
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -113,7 +120,10 @@ const DagDataNode = (props: any) => {
...
@@ -113,7 +120,10 @@ const DagDataNode = (props: any) => {
<
Col
flex=
'35%'
>
<
Col
flex=
'35%'
>
<
Text
style=
{
{
display
:
'inline-flex'
,
alignItems
:
'center'
}
}
type=
'secondary'
>
<
Text
style=
{
{
display
:
'inline-flex'
,
alignItems
:
'center'
}
}
type=
'secondary'
>
{
l
(
'devops.baseinfo.idle'
)
}
:
{
l
(
'devops.baseinfo.idle'
)
}
:
{
renderRatio
((
backpressure
&&
backpressure
.
subtasks
)?
backpressure
.
subtasks
[
0
]?.
idleRatio
:
0
,
true
)
}
{
renderRatio
(
backpressure
&&
backpressure
.
subtasks
?
backpressure
.
subtasks
[
0
]?.
idleRatio
:
0
,
true
)
}
</
Text
>
</
Text
>
</
Col
>
</
Col
>
<
Col
flex=
'auto'
>
<
Col
flex=
'auto'
>
...
...
dinky-web/src/components/FlinkDag/index.tsx
View file @
16835aa3
This diff is collapsed.
Click to expand it.
dinky-web/src/components/LineageGraph/index.tsx
0 → 100644
View file @
16835aa3
import
{
Badge
,
Tooltip
,
Typography
}
from
'antd'
;
import
{
LineageDetailInfo
,
LineageRelations
,
LineageTable
,
LineageTableColumn
}
from
'@/types/DevOps/data.d'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
SuccessNotification
,
WarningNotification
}
from
'@/utils/messages'
;
import
{
CompassOutlined
,
ExpandAltOutlined
,
FullscreenExitOutlined
,
InsertRowAboveOutlined
,
PlusCircleOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
_
from
'lodash'
;
import
React
,
{
useEffect
}
from
'react'
;
import
LineageDag
from
'react-lineage-dag'
;
import
'react-lineage-dag/dist/index.css'
;
const
{
Text
}
=
Typography
;
interface
LineageState
{
lineageData
:
LineageDetailInfo
;
canvas
:
any
;
actionMenu
:
any
[];
tables
:
ITable
[];
relations
:
LineageRelations
[];
columns
:
any
[];
operator
:
any
[];
centerId
:
string
;
showMinimap
:
boolean
;
refresh
:
boolean
;
expandField
:
boolean
;
collapseField
:
boolean
;
expandDownstream
:
boolean
;
collapseDownstream
:
boolean
;
expandUpstream
:
boolean
;
collapseUpstream
:
boolean
;
}
const
InitLineageState
:
LineageState
=
{
lineageData
:
{
tables
:
[],
relations
:
[]
},
canvas
:
undefined
,
actionMenu
:
[],
tables
:
[],
relations
:
[],
columns
:
[],
operator
:
[],
centerId
:
''
,
showMinimap
:
false
,
refresh
:
false
,
expandField
:
false
,
collapseField
:
false
,
expandDownstream
:
false
,
collapseDownstream
:
false
,
expandUpstream
:
false
,
collapseUpstream
:
false
};
type
JobLineageProps
=
{
lineageData
:
LineageDetailInfo
;
refreshCallBack
:
()
=>
void
;
};
type
ITable
=
{
id
:
string
;
name
:
string
;
isCollapse
:
boolean
;
fields
:
LineageTableColumn
[];
};
const
LineageGraph
:
React
.
FC
<
JobLineageProps
>
=
(
props
)
=>
{
const
{
lineageData
,
refreshCallBack
}
=
props
;
const
[
lineageState
,
setLineageState
]
=
React
.
useState
<
LineageState
>
(
InitLineageState
);
useEffect
(()
=>
{
if
(
lineageData
)
{
setLineageState
((
prevState
)
=>
({
...
prevState
,
lineageData
:
lineageData
,
tables
:
buildLineageTables
(
lineageData
.
tables
),
relations
:
buildLineageRelations
(
lineageData
.
relations
)
}));
}
},
[
lineageData
,
lineageState
.
refresh
]);
const
buildLineageColumns
=
(
data
:
LineageDetailInfo
)
=>
{
return
[
{
key
:
'id'
,
width
:
'100'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
{
return
(
<>
<
Badge
count=
{
index
+
1
}
size=
{
'small'
}
color=
{
index
<
10
?
'red'
:
index
<
20
?
'blue'
:
index
<
30
?
'gold'
:
'cyan'
}
/>
</>
);
}
},
{
key
:
'name'
,
primaryKey
:
true
,
width
:
'250'
,
render
:
(
text
:
any
,
record
:
any
,
index
:
number
)
=>
{
return
(
<>
<
InsertRowAboveOutlined
/>
{
text
}
</>
);
}
}
];
};
const
buildLineageTables
=
(
tables
:
LineageTable
[])
=>
{
return
tables
.
map
((
table
:
LineageTable
)
=>
({
id
:
table
?.
id
,
name
:
table
?.
name
,
isCollapse
:
false
,
fields
:
table
?.
columns
}));
};
const
buildLineageRelations
=
(
relations
:
LineageRelations
[])
=>
{
return
relations
.
map
((
relation
:
LineageRelations
)
=>
({
id
:
relation
?.
id
,
srcTableId
:
relation
?.
srcTableId
,
tgtTableId
:
relation
?.
tgtTableId
,
srcTableColName
:
relation
?.
srcTableColName
,
tgtTableColName
:
relation
?.
tgtTableColName
}));
};
function
findTableById
(
id
:
string
)
{
const
{
tables
}
=
lineageState
;
return
tables
.
find
((
item
)
=>
{
return
String
(
item
.
id
)
===
String
(
id
);
});
}
const
handleExpandField
=
(
nodeData
:
any
,
tables
:
ITable
[])
=>
{
const
{
isCollapse
,
id
}
=
nodeData
;
console
.
log
(
id
,
findTableById
(
id
),
tables
);
const
iTable
=
findTableById
(
id
);
if
(
iTable
)
{
iTable
.
isCollapse
=
isCollapse
;
}
// todo: 待实现 展开字段
setLineageState
((
prevState
)
=>
({
...
prevState
,
expandField
:
!
prevState
.
expandField
}));
SuccessNotification
(
lineageState
.
expandField
?
l
(
'lineage.expandField'
)
:
l
(
'lineage.expandField'
)
);
};
const
buildActionMenu
=
(
data
:
ITable
[])
=>
{
return
[
{
id
:
'expandField'
,
name
:
lineageState
.
expandField
?
l
(
'lineage.expandField'
)
:
l
(
'lineage.expandField'
),
icon
:
(
<
Tooltip
title=
{
lineageState
.
expandField
?
l
(
'lineage.expandField'
)
:
l
(
'lineage.expandField'
)
}
>
<
FullscreenExitOutlined
width=
{
300
}
/>
</
Tooltip
>
),
onClick
:
(
nodeData
:
any
)
=>
handleExpandField
(
nodeData
,
_
.
clone
(
data
))
},
{
id
:
'expandDownstream'
,
name
:
lineageState
.
expandDownstream
?
l
(
'lineage.expandDownstream'
)
:
l
(
'lineage.collapseDownstream'
),
icon
:
(
<
Tooltip
title=
{
lineageState
.
expandDownstream
?
l
(
'lineage.expandDownstream'
)
:
l
(
'lineage.collapseDownstream'
)
}
>
<
PlusCircleOutlined
/>
</
Tooltip
>
),
onClick
:
(
nodeData
:
{
id
:
string
})
=>
{
setLineageState
((
prevState
)
=>
({
...
prevState
,
expandDownstream
:
!
prevState
.
expandDownstream
}));
// todo 展开下游
WarningNotification
(
lineageState
.
expandDownstream
?
l
(
'lineage.expandDownstream'
)
:
l
(
'lineage.collapseDownstream'
)
);
}
},
{
id
:
'expandUpstream'
,
name
:
lineageState
.
expandUpstream
?
l
(
'lineage.expandUpstream'
)
:
l
(
'lineage.collapseUpstream'
),
icon
:
(
<
Tooltip
title=
{
lineageState
.
expandUpstream
?
l
(
'lineage.expandUpstream'
)
:
l
(
'lineage.collapseUpstream'
)
}
>
<
ExpandAltOutlined
/>
</
Tooltip
>
),
onClick
:
(
nodeData
:
{
id
:
string
})
=>
{
setLineageState
((
prevState
)
=>
({
...
prevState
,
expandUpstream
:
!
prevState
.
expandUpstream
}));
// todo 展开上游
WarningNotification
(
lineageState
.
expandUpstream
?
l
(
'lineage.expandUpstream'
)
:
l
(
'lineage.collapseUpstream'
)
);
}
}
];
};
const
renderExtActionButton
=
()
=>
{
return
[
{
key
:
'minimap'
,
icon
:
(
<
Tooltip
title=
{
lineageState
.
showMinimap
?
l
(
'lineage.showMap'
)
:
l
(
'lineage.hideMap'
)
}
>
<
CompassOutlined
/>
</
Tooltip
>
),
name
:
lineageState
.
showMinimap
?
l
(
'lineage.showMap'
)
:
l
(
'lineage.hideMap'
),
onClick
:
(
canvas
:
any
)
=>
{
setLineageState
((
prevState
)
=>
({
...
prevState
,
canvas
,
showMinimap
:
!
prevState
.
showMinimap
}));
}
},
{
key
:
'refresh'
,
icon
:
(
<
Tooltip
title=
{
l
(
'lineage.refresh'
)
}
>
<
ReloadOutlined
spin=
{
lineageState
.
refresh
}
/>
</
Tooltip
>
),
title
:
l
(
'lineage.refresh'
),
onClick
:
(
canvas
:
any
)
=>
{
setLineageState
((
prevState
)
=>
({
...
prevState
,
canvas
,
refresh
:
true
}));
refreshCallBack
();
setLineageState
((
prevState
)
=>
({
...
prevState
,
canvas
,
refresh
:
false
}));
}
}
];
};
const
renderTitle
=
(
title
:
string
)
=>
{
return
(
<
Text
title=
{
title
}
strong
ellipsis
type=
{
'secondary'
}
onClick=
{
()
=>
{
lineageState
.
canvas
.
nodes
.
forEach
((
item
:
{
redrawTitle
:
()
=>
void
})
=>
{
item
.
redrawTitle
();
});
}
}
>
<
blockquote
>
{
title
.
toString
().
split
(
'.'
)[
2
]
??
title
}
</
blockquote
>
</
Text
>
);
};
return
(
<>
<
LineageDag
delayDraw=
{
2000
}
tables=
{
buildLineageTables
(
lineageState
.
lineageData
.
tables
)
}
relations=
{
buildLineageRelations
(
lineageState
.
lineageData
.
relations
)
}
columns=
{
buildLineageColumns
(
lineageState
.
lineageData
)
}
operator=
{
buildActionMenu
(
lineageState
.
tables
)
}
centerId=
{
lineageState
.
centerId
}
onLoaded=
{
(
canvas
:
any
)
=>
setLineageState
((
prevState
)
=>
({
...
prevState
,
canvas
}))
}
onChange=
{
(
data
:
any
)
=>
setLineageState
((
prevState
)
=>
({
...
prevState
,
centerId
:
data
.
id
}))
}
config=
{
{
titleRender
:
(
title
:
string
)
=>
renderTitle
(
title
),
minimap
:
{
enable
:
lineageState
.
showMinimap
},
enableHoverChain
:
true
,
showActionIcon
:
true
,
gridMode
:
{
isAdsorb
:
true
,
theme
:
{
shapeType
:
'line'
,
gap
:
20
,
lineWidth
:
1
,
lineColor
:
'#e8e8e8'
,
circleRadiu
:
5
,
circleColor
:
'#e8e8e8'
}
}
// theme:
{
// isMouseMoveStopPropagation: true,
// autoFixCanvas:
{
// enable: true,
// autoMovePadding: [40, 40, 40, 40],
//
},
// edge:
{
// type: 'endpoint',
// shapeType: 'AdvancedBezier',
// hasRadius: true,
// isExpandWidth: true,
// label: '111',
// defaultAnimate: true,
// arrowPosition: 1,
// arrowOffset: -5
//
},
//
}
}
}
butterfly=
{
{
zoomable
:
true
,
draggable
:
true
,
movable
:
true
,
linkable
:
true
}
}
actionMenu=
{
renderExtActionButton
()
}
/>
</>
);
};
export
default
LineageGraph
;
dinky-web/src/global.less
View file @
16835aa3
...
@@ -117,6 +117,7 @@ body,
...
@@ -117,6 +117,7 @@ body,
::-webkit-scrollbar-corner {
::-webkit-scrollbar-corner {
background-color: #f5f5f5;
background-color: #f5f5f5;
}
}
.monaco-scrollable-element > .scrollbar > .slider {
.monaco-scrollable-element > .scrollbar > .slider {
background: #8db7fd !important;
background: #8db7fd !important;
}
}
...
@@ -249,9 +250,11 @@ ol {
...
@@ -249,9 +250,11 @@ ol {
}
}
}
}
}
}
.ant-tree-node-content-wrapper {
.ant-tree-node-content-wrapper {
display: flex;
display: flex;
}
}
.gitCodeTree {
.gitCodeTree {
min-height: 70vh;
min-height: 70vh;
max-height: 70vh;
max-height: 70vh;
...
@@ -344,10 +347,12 @@ h5 {
...
@@ -344,10 +347,12 @@ h5 {
opacity: 1;
opacity: 1;
animation: show-anim 0.5s;
animation: show-anim 0.5s;
}
}
.hide {
.hide {
opacity: 0;
opacity: 0;
animation: hide-anim 0.5s;
animation: hide-anim 0.5s;
}
}
@keyframes show-anim {
@keyframes show-anim {
0% {
0% {
opacity: 0;
opacity: 0;
...
@@ -356,6 +361,7 @@ h5 {
...
@@ -356,6 +361,7 @@ h5 {
opacity: 1;
opacity: 1;
}
}
}
}
@keyframes hide-anim {
@keyframes hide-anim {
0% {
0% {
opacity: 1;
opacity: 1;
...
@@ -373,6 +379,7 @@ h5 {
...
@@ -373,6 +379,7 @@ h5 {
white-space: nowrap;
white-space: nowrap;
text-overflow: ellipsis;
text-overflow: ellipsis;
}
}
.container-header {
.container-header {
display: flex;
display: flex;
align-items: center;
align-items: center;
...
@@ -390,6 +397,7 @@ h5 {
...
@@ -390,6 +397,7 @@ h5 {
scrollbar-color: #d4aa70 #e4e4e4;
scrollbar-color: #d4aa70 #e4e4e4;
scrollbar-width: thin;
scrollbar-width: thin;
}
}
.monaco-float {
.monaco-float {
height: 100%;
height: 100%;
}
}
...
@@ -400,6 +408,7 @@ h5 {
...
@@ -400,6 +408,7 @@ h5 {
.ant-tabs-tab {
.ant-tabs-tab {
padding: 4px 8px;
padding: 4px 8px;
}
}
.ant-tabs-tab-active {
.ant-tabs-tab-active {
box-sizing: content-box;
box-sizing: content-box;
border-block-end: 3px solid #8db7fd;
border-block-end: 3px solid #8db7fd;
...
@@ -422,7 +431,153 @@ h5 {
...
@@ -422,7 +431,153 @@ h5 {
.ant-pro-checkcard {
.ant-pro-checkcard {
overflow: hidden;
overflow: hidden;
.ant-pro-checkcard-body {
.ant-pro-checkcard-body {
width: 100vw;
width: 100vw;
}
}
}
}
// ==================== lineage style start ====================
.butterfly-lineage-dag .table-node.focus {
border-width: 10px;
border-radius: 4px;
box-shadow: 0 0 5px #0d74e8;
}
.butterfly-lineage-dag .table-node:hover {
border-width: 10px;
border-radius: 4px;
box-shadow: 0 0 5px #0d74e8;
}
.butterfly-lineage-dag .table-node .field {
display: flex;
flex-flow: row;
justify-content: space-between;
height: 20px;
border-width: 10px;
border-radius: 4px;
}
.field.hover-chain {
width: 97%;
background: #0d74e8 !important;
}
.butterfly-lineage-dag .table-node .title-con {
.title {
display: inline-flex;
align-items: center;
width: 100%;
height: 40px;
max-height: 4vh;
padding-left: 5px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
background: #63e0e0;
border-radius: 4px;
box-shadow: #0d74e8;
.ant-typography {
display: flex;
flex-flow: row;
align-items: center;
justify-content: space-between;
}
}
}
.butterfly-lineage-dag .table-node .field .point.left-point {
left: -10px;
z-index: 9999;
}
.butterfly-lineage-dag .table-node .field .point.right-point {
right: -10px;
z-index: 9999;
}
.butterfly-lineage-dag .table-node .title-con {
position: relative;
display: flex;
min-width: 40%;
}
.butterfly-lineage-dag .butterflies-link.hover-chain {
transition: all 0.5s ease-in-out;
// 线条缓慢流动
animation: 30s linear 0s infinite normal none running running-line;
stroke: #02f657;
stop-opacity: 1;
}
.butterfly-lineage-dag .butterflies-arrow.hover-chain {
transition: all 0.5s ease-in-out;
animation: 30s linear 0s infinite normal none running running-line;
fill: #28da8f;
stroke: #28da8f;
}
.butterfly-lineage-dag .table-node .field.hover-chain .point {
background: #0095ff;
transition: all 0.5s ease-in-out;
}
.butterfly-lineage-dag .table-node .field {
position: relative;
align-items: center;
height: 26px !important;
margin: 0 6px;
padding: 4px 4px 4px 6px;
white-space: nowrap;
}
.butterfly-lineage-dag .table-node .field.hover-chain {
color: #fff;
transition: all 0.5s ease-in-out;
}
.butterfly-lineage-dag .table-node .title-con .operator {
position: absolute;
top: 2px;
right: 5px;
display: flex;
align-items: baseline;
justify-content: space-between;
height: 100%;
max-height: 4vh;
margin: 0 20px;
.operator-item {
margin-left: 15px;
}
}
.butterflies-link {
transition: all 0.5s ease-in-out; // 线条缓慢流动
fill: none; // 线条填充色
stroke: #04671f; // 线条颜色
stroke-width: 1.5px; // 线条宽度
stroke-dasharray: 5, 8; // 线条样式 5px实线 8px空白
stroke-dashoffset: -2px; // 线条偏移量
stroke-linecap: round; // 线条两端样式
stroke-linejoin: round; // 线条连接样式 miter-clip斜角 miter斜角 round圆角 bevel斜角
}
.butterflies-link:hover {
right: 0; // 激活连接线 右边距
}
.butterflies-arrow {
padding-right: 10px !important; // 箭头右边距
transition: all 0.5s ease-in-out; // 线条缓慢流动
fill: #04671f; // 箭头颜色
stroke: #04671f; // 箭头颜色
stroke-width: 4px; // 箭头宽度
}
.butterflies-arrow:hover {
right: 0;
background: #0366d6;
}
// ==================== lineage style end ====================
dinky-web/src/locales/en-US/pages.ts
View file @
16835aa3
...
@@ -1003,5 +1003,16 @@ export default {
...
@@ -1003,5 +1003,16 @@ export default {
'user.type'
:
'User Type'
,
'user.type'
:
'User Type'
,
'user.update'
:
'Modify User'
,
'user.update'
:
'Modify User'
,
'user.username'
:
'User Name'
,
'user.username'
:
'User Name'
,
'user.usernamePlaceholder'
:
'Please enter user name'
'user.usernamePlaceholder'
:
'Please enter user name'
,
'lineage.getError'
:
'Cannot Get Lineage'
,
'lineage.expandField'
:
'Expand Field'
,
'lineage.collapseField'
:
'Collapse Field'
,
'lineage.expandDownstream'
:
'Expand Downstream'
,
'lineage.collapseDownstream'
:
'Collapse Downstream'
,
'lineage.expandUpstream'
:
'Expand Upstream'
,
'lineage.collapseUpstream'
:
'Collapse Upstream'
,
'lineage.showMap'
:
'Show Map'
,
'lineage.hideMap'
:
'Hide Map'
,
'lineage.refresh'
:
'Refresh'
};
};
dinky-web/src/locales/zh-CN/pages.ts
View file @
16835aa3
...
@@ -965,5 +965,16 @@ export default {
...
@@ -965,5 +965,16 @@ export default {
'user.type'
:
'注册类型'
,
'user.type'
:
'注册类型'
,
'user.update'
:
'修改用户'
,
'user.update'
:
'修改用户'
,
'user.username'
:
'用户名'
,
'user.username'
:
'用户名'
,
'user.usernamePlaceholder'
:
'请输入用户名'
'user.usernamePlaceholder'
:
'请输入用户名'
,
'lineage.getError'
:
'无法获取血缘'
,
'lineage.expandField'
:
'展开字段'
,
'lineage.collapseField'
:
'收缩字段'
,
'lineage.expandDownstream'
:
'展开下游'
,
'lineage.collapseDownstream'
:
'收起下游'
,
'lineage.expandUpstream'
:
'展开上游'
,
'lineage.collapseUpstream'
:
'收起上游'
,
'lineage.showMap'
:
'显示小地图'
,
'lineage.hideMap'
:
'隐藏小地图'
,
'lineage.refresh'
:
'刷新血缘'
};
};
dinky-web/src/pages/DataStudio/BottomContainer/Lineage/index.tsx
0 → 100644
View file @
16835aa3
import
LineageGraph
from
'@/components/LineageGraph'
;
import
{
getCurrentData
,
mapDispatchToProps
}
from
'@/pages/DataStudio/function'
;
import
{
StateType
}
from
'@/pages/DataStudio/model'
;
import
{
getDataByParams
}
from
'@/services/BusinessCrud'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
LineageDetailInfo
}
from
'@/types/DevOps/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@umijs/max'
;
import
{
Card
,
Result
}
from
'antd'
;
import
React
,
{
useEffect
}
from
'react'
;
interface
StudioLineageParams
{
type
:
number
;
statementSet
:
boolean
;
dialect
:
string
;
databaseId
:
number
;
statement
:
string
;
envId
:
number
;
fragment
:
boolean
;
variables
:
any
;
}
const
Lineage
:
React
.
FC
<
connect
>
=
(
props
)
=>
{
const
{
tabs
:
{
panes
,
activeKey
},
bottomHeight
}
=
props
;
const
[
lineageData
,
setLineageData
]
=
React
.
useState
<
LineageDetailInfo
>
({
tables
:
[],
relations
:
[]
});
const
queryLineageData
=
()
=>
{
// 组装参数 statementSet type dialect databaseId
const
currentData
=
getCurrentData
(
panes
,
activeKey
);
if
(
!
currentData
)
return
;
const
{
type
,
statementSet
,
dialect
,
databaseId
,
statement
,
envId
,
fragment
}
=
currentData
;
const
params
:
StudioLineageParams
=
{
type
:
1
,
// todo: 暂时写死 ,后续优化
dialect
:
dialect
,
envId
:
envId
,
fragment
:
fragment
,
statement
:
statement
,
statementSet
:
statementSet
,
databaseId
:
databaseId
,
variables
:
{}
};
getDataByParams
(
API_CONSTANTS
.
STUDIO_GET_LINEAGE
,
params
).
then
((
res
)
=>
setLineageData
(
res
as
LineageDetailInfo
)
);
};
useEffect
(()
=>
{
queryLineageData
();
},
[
activeKey
]);
return
(
<>
<
Card
hoverable
bodyStyle=
{
{
height
:
bottomHeight
-
50
}
}
style=
{
{
height
:
bottomHeight
}
}
>
{
lineageData
&&
(
lineageData
.
tables
.
length
!==
0
||
lineageData
.
relations
.
length
!==
0
)
?
(
<
LineageGraph
lineageData=
{
lineageData
}
refreshCallBack=
{
queryLineageData
}
/>
)
:
(
<
Result
style=
{
{
height
:
bottomHeight
-
120
}
}
status=
'warning'
title=
{
l
(
'lineage.getError'
)
}
/>
)
}
</
Card
>
</>
);
};
export
default
connect
(
({
Studio
}:
{
Studio
:
StateType
})
=>
({
tabs
:
Studio
.
tabs
,
bottomHeight
:
Studio
.
bottomContainer
.
height
}),
mapDispatchToProps
)(
Lineage
);
dinky-web/src/pages/DataStudio/HeaderContainer/index.tsx
View file @
16835aa3
...
@@ -44,13 +44,14 @@ import { SettingConfigKeyEnum } from '@/pages/SettingCenter/GlobalSetting/Settin
...
@@ -44,13 +44,14 @@ import { SettingConfigKeyEnum } from '@/pages/SettingCenter/GlobalSetting/Settin
import
{
handlePutDataJson
}
from
'@/services/BusinessCrud'
;
import
{
handlePutDataJson
}
from
'@/services/BusinessCrud'
;
import
{
BaseConfigProperties
}
from
'@/types/SettingCenter/data'
;
import
{
BaseConfigProperties
}
from
'@/types/SettingCenter/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
,
history
}
from
'@@/exports'
;
import
{
connect
,
history
}
from
'@@/exports'
;
import
{
import
{
EnvironmentOutlined
,
EnvironmentOutlined
,
FlagTwoTone
,
FlagTwoTone
,
MoreOutlined
,
MoreOutlined
,
PauseCircleTwoTone
,
PauseCircleTwoTone
,
PlayCircleTwoTone
,
RotateRightOutlined
,
PlayCircleTwoTone
,
RotateRightOutlined
,
SafetyCertificateTwoTone
,
SafetyCertificateTwoTone
,
SaveTwoTone
,
SaveTwoTone
,
SendOutlined
,
SendOutlined
,
...
@@ -260,9 +261,9 @@ const HeaderContainer = (props: any) => {
...
@@ -260,9 +261,9 @@ const HeaderContainer = (props: any) => {
// flink jobdetail跳转
// flink jobdetail跳转
icon
:
<
RotateRightOutlined
/>,
icon
:
<
RotateRightOutlined
/>,
title
:
l
(
'pages.datastudio.to.jobDetail'
),
title
:
l
(
'pages.datastudio.to.jobDetail'
),
click
:
()
=>
history
.
push
(
`/devops/job-detail?id=
${
getCurrentData
(
panes
,
activeKey
)?.
id
}
`),
click
:
()
=>
history
.
push
(
`/devops/job-detail?id=
${
getCurrentData
(
panes
,
activeKey
)?.
id
}
`),
isShow: (type?: TabsPageType, subType?: string, data?: any) =>
isShow: (type?: TabsPageType, subType?: string, data?: any) =>
type === TabsPageType.project && data?.jobInstanceId && subType
==="flinksql"
type === TabsPageType.project && data?.jobInstanceId && subType
=== 'flinksql'
},
},
// {
// {
// // 异步提交按钮
// // 异步提交按钮
...
@@ -329,13 +330,13 @@ const HeaderContainer = (props: any) => {
...
@@ -329,13 +330,13 @@ const HeaderContainer = (props: any) => {
};
};
const renderHotkey = () => {
const renderHotkey = () => {
document.onkeydown = (e) => {
document.onkeydown = (e) => {
if (getCurrentTab(panes, activeKey)){
if (getCurrentTab(panes, activeKey))
{
routes
routes
.filter((r) => r.hotKey?.(e))
.filter((r) => r.hotKey?.(e))
.forEach((r) => {
.forEach((r) => {
r.click();
r.click();
e.preventDefault();
e.preventDefault();
});
});
}
}
};
};
};
};
...
...
dinky-web/src/pages/DataStudio/LeftContainer/Project/JobTree/index.tsx
View file @
16835aa3
...
@@ -17,13 +17,14 @@
...
@@ -17,13 +17,14 @@
*
*
*/
*/
import
{
getCurrentTab
}
from
'@/pages/DataStudio/function'
;
import
{
import
{
buildProjectTree
,
buildProjectTree
,
generateList
,
generateList
,
getLeafKeyList
,
getLeafKeyList
,
getParentKey
getParentKey
}
from
'@/pages/DataStudio/LeftContainer/Project/function'
;
}
from
'@/pages/DataStudio/LeftContainer/Project/function'
;
import
{
StateType
,
TabsItemType
}
from
'@/pages/DataStudio/model'
;
import
{
StateType
,
TabsItemType
}
from
'@/pages/DataStudio/model'
;
import
{
BtnRoute
}
from
'@/pages/DataStudio/route'
;
import
{
BtnRoute
}
from
'@/pages/DataStudio/route'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@@/exports'
;
import
{
connect
}
from
'@@/exports'
;
...
@@ -31,7 +32,6 @@ import { Key } from '@ant-design/pro-components';
...
@@ -31,7 +32,6 @@ import { Key } from '@ant-design/pro-components';
import
{
Empty
,
Tree
}
from
'antd'
;
import
{
Empty
,
Tree
}
from
'antd'
;
import
Search
from
'antd/es/input/Search'
;
import
Search
from
'antd/es/input/Search'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
getCurrentData
,
getCurrentTab
}
from
"@/pages/DataStudio/function"
;
const
{
DirectoryTree
}
=
Tree
;
const
{
DirectoryTree
}
=
Tree
;
...
@@ -46,8 +46,7 @@ type TreeProps = {
...
@@ -46,8 +46,7 @@ type TreeProps = {
};
};
const
JobTree
:
React
.
FC
<
TreeProps
&
connect
>
=
(
props
)
=>
{
const
JobTree
:
React
.
FC
<
TreeProps
&
connect
>
=
(
props
)
=>
{
const
{
projectData
,
onNodeClick
,
style
,
height
,
onRightClick
}
=
props
;
const
{
projectData
,
onNodeClick
,
style
,
height
,
onRightClick
}
=
props
;
const
[
searchValue
,
setSearchValueValue
]
=
useState
(
''
);
const
[
searchValue
,
setSearchValueValue
]
=
useState
(
''
);
const
[
data
,
setData
]
=
useState
<
any
[]
>
(
buildProjectTree
(
projectData
,
searchValue
));
const
[
data
,
setData
]
=
useState
<
any
[]
>
(
buildProjectTree
(
projectData
,
searchValue
));
...
@@ -89,25 +88,24 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
...
@@ -89,25 +88,24 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
setExpandedKeys
(
getLeafKeyList
(
projectData
));
setExpandedKeys
(
getLeafKeyList
(
projectData
));
};
};
const
btn
=
BtnRoute
[
'menu.datastudio.project'
];
const
btn
=
BtnRoute
[
'menu.datastudio.project'
];
const
positionKey
=
(
panes
:
TabsItemType
[],
activeKey
:
string
)
=>
{
const
positionKey
=
(
panes
:
TabsItemType
[],
activeKey
:
string
)
=>
{
const
treeKey
=
getCurrentTab
(
panes
,
activeKey
)?.
treeKey
;
const
treeKey
=
getCurrentTab
(
panes
,
activeKey
)?.
treeKey
;
if
(
treeKey
){
if
(
treeKey
)
{
const
expandList
:
any
[]
=
generateList
(
data
,
[]);
const
expandList
:
any
[]
=
generateList
(
data
,
[]);
let
expandedKeys
:
any
=
expandList
let
expandedKeys
:
any
=
expandList
.
map
((
item
:
any
)
=>
{
.
map
((
item
:
any
)
=>
{
if
(
item
?.
key
==
treeKey
)
{
if
(
item
?.
key
==
treeKey
)
{
return
getParentKey
(
item
.
key
,
data
);
return
getParentKey
(
item
.
key
,
data
);
}
}
return
null
;
return
null
;
})
})
.
filter
((
item
:
any
,
i
:
number
,
self
:
any
)
=>
item
&&
self
.
indexOf
(
item
)
===
i
);
.
filter
((
item
:
any
,
i
:
number
,
self
:
any
)
=>
item
&&
self
.
indexOf
(
item
)
===
i
);
setExpandedKeys
(
expandedKeys
);
setExpandedKeys
(
expandedKeys
);
setAutoExpandParent
(
true
);
setAutoExpandParent
(
true
);
setSelectedKeys
([
treeKey
])
setSelectedKeys
([
treeKey
])
;
}
}
}
}
;
btn
[
1
].
onClick
=
expandAll
;
btn
[
1
].
onClick
=
expandAll
;
...
@@ -147,5 +145,5 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
...
@@ -147,5 +145,5 @@ const JobTree: React.FC<TreeProps & connect> = (props) => {
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
height
:
Studio
.
toolContentHeight
,
height
:
Studio
.
toolContentHeight
,
projectData
:
Studio
.
project
.
data
,
projectData
:
Studio
.
project
.
data
}))(
JobTree
);
}))(
JobTree
);
dinky-web/src/pages/DataStudio/LeftContainer/Project/index.tsx
View file @
16835aa3
...
@@ -42,7 +42,6 @@ import { Modal, Typography } from 'antd';
...
@@ -42,7 +42,6 @@ import { Modal, Typography } from 'antd';
import
{
MenuInfo
}
from
'rc-menu/es/interface'
;
import
{
MenuInfo
}
from
'rc-menu/es/interface'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
connect
}
from
'umi'
;
import
{
connect
}
from
'umi'
;
import
{
BtnRoute
}
from
"@/pages/DataStudio/route"
;
const
{
Text
}
=
Typography
;
const
{
Text
}
=
Typography
;
...
...
dinky-web/src/pages/DataStudio/LeftContainer/index.tsx
View file @
16835aa3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
import
{
CircleBtn
,
CircleButtonProps
,
CircleDataStudioButtonProps
}
from
'@/components/CallBackButton/CircleBtn'
;
import
{
CircleBtn
,
CircleDataStudioButtonProps
}
from
'@/components/CallBackButton/CircleBtn'
;
import
MovableSidebar
,
{
MovableSidebarProps
}
from
'@/components/Sidebar/MovableSidebar'
;
import
MovableSidebar
,
{
MovableSidebarProps
}
from
'@/components/Sidebar/MovableSidebar'
;
import
useThemeValue
from
'@/hooks/useThemeValue'
;
import
useThemeValue
from
'@/hooks/useThemeValue'
;
import
ProjectTitle
from
'@/pages/DataStudio/LeftContainer/Project/ProjectTitle'
;
import
ProjectTitle
from
'@/pages/DataStudio/LeftContainer/Project/ProjectTitle'
;
...
@@ -31,7 +31,14 @@ export type LeftContainerProps = {
...
@@ -31,7 +31,14 @@ export type LeftContainerProps = {
size
:
number
;
size
:
number
;
};
};
const
LeftContainer
:
React
.
FC
<
LeftContainerProps
>
=
(
props
:
any
)
=>
{
const
LeftContainer
:
React
.
FC
<
LeftContainerProps
>
=
(
props
:
any
)
=>
{
const
{
dispatch
,
size
,
toolContentHeight
,
leftContainer
,
rightContainer
,
tabs
:
{
panes
,
activeKey
}}
=
props
;
const
{
dispatch
,
size
,
toolContentHeight
,
leftContainer
,
rightContainer
,
tabs
:
{
panes
,
activeKey
}
}
=
props
;
const
themeValue
=
useThemeValue
();
const
themeValue
=
useThemeValue
();
const
MAX_WIDTH
=
size
.
width
-
2
*
VIEW
.
leftToolWidth
-
rightContainer
.
width
-
700
;
const
MAX_WIDTH
=
size
.
width
-
2
*
VIEW
.
leftToolWidth
-
rightContainer
.
width
-
700
;
...
@@ -81,7 +88,12 @@ const LeftContainer: React.FC<LeftContainerProps> = (props: any) => {
...
@@ -81,7 +88,12 @@ const LeftContainer: React.FC<LeftContainerProps> = (props: any) => {
enable
:
{
right
:
true
},
enable
:
{
right
:
true
},
btnGroup
:
BtnRoute
[
leftContainer
.
selectKey
]
btnGroup
:
BtnRoute
[
leftContainer
.
selectKey
]
?
BtnRoute
[
leftContainer
.
selectKey
].
map
((
item
:
CircleDataStudioButtonProps
)
=>
(
?
BtnRoute
[
leftContainer
.
selectKey
].
map
((
item
:
CircleDataStudioButtonProps
)
=>
(
<
CircleBtn
title=
{
item
.
title
}
icon=
{
item
.
icon
}
onClick=
{
()
=>
item
.
onClick
?.(
panes
,
activeKey
)
}
key=
{
item
.
title
}
/>
<
CircleBtn
title=
{
item
.
title
}
icon=
{
item
.
icon
}
onClick=
{
()
=>
item
.
onClick
?.(
panes
,
activeKey
)
}
key=
{
item
.
title
}
/>
))
))
:
[],
:
[],
style
:
{
borderInlineEnd
:
`1px solid
${
themeValue
.
borderColor
}
`
}
style
:
{
borderInlineEnd
:
`1px solid
${
themeValue
.
borderColor
}
`
}
...
...
dinky-web/src/pages/DataStudio/route.tsx
View file @
16835aa3
...
@@ -17,8 +17,9 @@
...
@@ -17,8 +17,9 @@
*
*
*/
*/
import
{
CircleButtonProps
,
CircleDataStudioButtonProps
}
from
'@/components/CallBackButton/CircleBtn'
;
import
{
CircleDataStudioButtonProps
}
from
'@/components/CallBackButton/CircleBtn'
;
import
Console
from
'@/pages/DataStudio/BottomContainer/Console'
;
import
Console
from
'@/pages/DataStudio/BottomContainer/Console'
;
import
Lineage
from
'@/pages/DataStudio/BottomContainer/Lineage'
;
import
Result
from
'@/pages/DataStudio/BottomContainer/Result'
;
import
Result
from
'@/pages/DataStudio/BottomContainer/Result'
;
import
TableData
from
'@/pages/DataStudio/BottomContainer/TableData'
;
import
TableData
from
'@/pages/DataStudio/BottomContainer/TableData'
;
import
MetaData
from
'@/pages/DataStudio/LeftContainer/MetaData'
;
import
MetaData
from
'@/pages/DataStudio/LeftContainer/MetaData'
;
...
@@ -37,9 +38,10 @@ import {
...
@@ -37,9 +38,10 @@ import {
CalendarOutlined
,
CalendarOutlined
,
ConsoleSqlOutlined
,
ConsoleSqlOutlined
,
DatabaseOutlined
,
DatabaseOutlined
,
DesktopOutlined
,
EnvironmentOutlined
,
DesktopOutlined
,
EnvironmentOutlined
,
FolderOutlined
,
FolderOutlined
,
HistoryOutlined
,
HolderOutlined
,
HistoryOutlined
,
InfoCircleOutlined
,
InfoCircleOutlined
,
MonitorOutlined
,
MonitorOutlined
,
PlayCircleOutlined
,
PlayCircleOutlined
,
...
@@ -146,7 +148,8 @@ export const LeftBottomSide = [
...
@@ -146,7 +148,8 @@ export const LeftBottomSide = [
auth
:
'/datastudio/bottom/lineage'
,
auth
:
'/datastudio/bottom/lineage'
,
key
:
'menu.datastudio.lineage'
,
key
:
'menu.datastudio.lineage'
,
icon
:
<
ApartmentOutlined
/>,
icon
:
<
ApartmentOutlined
/>,
label
:
l
(
'menu.datastudio.lineage'
)
label
:
l
(
'menu.datastudio.lineage'
),
children
:
<
Lineage
/>
},
},
{
{
auth
:
'/datastudio/bottom/process'
,
auth
:
'/datastudio/bottom/process'
,
...
@@ -270,7 +273,7 @@ export const BtnRoute: { [c: string]: CircleDataStudioButtonProps[] } = {
...
@@ -270,7 +273,7 @@ export const BtnRoute: { [c: string]: CircleDataStudioButtonProps[] } = {
},
},
{
{
icon
:
<
EnvironmentOutlined
/>,
icon
:
<
EnvironmentOutlined
/>,
title
:
l
(
'button.position'
),
title
:
l
(
'button.position'
),
key
:
'button.position'
,
key
:
'button.position'
,
onClick
:
()
=>
{}
onClick
:
()
=>
{}
}
}
...
...
dinky-web/src/pages/DevOps/JobDetail/CheckPointsTab/components/CkDesc.tsx
View file @
16835aa3
...
@@ -30,92 +30,83 @@ import { Descriptions, Space, Tag } from 'antd';
...
@@ -30,92 +30,83 @@ import { Descriptions, Space, Tag } from 'antd';
const
CkDesc
=
(
props
:
JobProps
)
=>
{
const
CkDesc
=
(
props
:
JobProps
)
=>
{
const
{
jobDetail
}
=
props
;
const
{
jobDetail
}
=
props
;
let
counts
=
jobDetail
?.
jobDataDto
?.
checkpoints
.
counts
;
const
{
counts
,
latest
}
=
jobDetail
?.
jobDataDto
?.
checkpoints
;
let
latest
=
jobDetail
?.
jobDataDto
?.
checkpoints
.
latest
;
const
{
checkpointsConfigInfo
}
=
jobDetail
?.
jobDataDto
?.
checkpointsConfig
;
let
checkpointsConfigInfo
=
jobDetail
?.
jobDataDto
?.
checkpointsConfig
;
return
(
return
(
<>
<>
<
Descriptions
bordered
size=
'small'
column=
{
4
}
>
<
Descriptions
bordered
size=
'small'
column=
{
4
}
>
<
Descriptions
.
Item
label=
'Checkpoint Mode'
>
<
Descriptions
.
Item
label=
'Checkpoint Mode'
>
<
Tag
color=
'blue'
title=
{
'Checkpoint Mode'
}
>
<
Tag
color=
'blue'
title=
{
'Checkpoint Mode'
}
>
{
checkpointsConfigInfo
.
mode
.
toUpperCase
()
}
{
checkpointsConfigInfo
?.
mode
?.
toUpperCase
()
??
'None'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Interval'
>
<
Descriptions
.
Item
label=
'Interval'
>
<
Tag
color=
'blue'
title=
{
'Interval'
}
>
<
Tag
color=
'blue'
title=
{
'Interval'
}
>
{
checkpointsConfigInfo
.
interval
}
{
checkpointsConfigInfo
?.
interval
??
'None'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Timeout'
>
<
Descriptions
.
Item
label=
'Timeout'
>
<
Tag
color=
'blue'
title=
{
'Timeout'
}
>
<
Tag
color=
'blue'
title=
{
'Timeout'
}
>
{
checkpointsConfigInfo
.
timeout
}
{
checkpointsConfigInfo
?.
timeout
??
'None'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Unaligned Checkpoints '
>
<
Descriptions
.
Item
label=
'Unaligned Checkpoints '
>
<
Tag
color=
'blue'
title=
{
'Unaligned Checkpoints'
}
>
<
Tag
color=
'blue'
title=
{
'Unaligned Checkpoints'
}
>
{
checkpointsConfigInfo
.
unaligned_checkpoints
?
'Enabled'
:
'Disabled'
}
{
checkpointsConfigInfo
?
.
unaligned_checkpoints
?
'Enabled'
:
'Disabled'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Latest Restored'
>
<
Descriptions
.
Item
label=
'Latest Restored'
>
<
Tag
color=
'cyan'
title=
{
'Latest Restored'
}
>
<
Tag
color=
'cyan'
title=
{
'Latest Restored'
}
>
{
latest
.
restored
===
null
?
'None'
:
latest
.
restored
.
external_path
}
{
latest
?.
restored
?.
external_path
??
'None'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Latest Failed CheckPoint'
>
<
Descriptions
.
Item
label=
'Latest Failed CheckPoint'
>
{
latest
.
failed
===
null
?
(
<
Tag
color=
'red'
title=
{
'Latest Failed CheckPoint'
}
>
<
Tag
color=
'red'
title=
{
'Latest Failed CheckPoint'
}
>
id:
{
latest
?.
failed
.
id
??
'None'
}
{
'None'
}
</
Tag
>
</
Tag
>
{
/*<Tag color='red' title={'Latest Failed CheckPoint'}>*/
}
)
:
(
{
/* {'Cause: ' + latest?.failed?.failure_message ?? 'None'}*/
}
<>
{
/*</Tag>*/
}
<
Tag
color=
'red'
title=
{
'Latest Failed CheckPoint'
}
>
{
'id: '
+
latest
.
failed
.
id
}
</
Tag
>
<
Tag
color=
'red'
title=
{
'Latest Failed CheckPoint'
}
>
{
'Cause: '
+
latest
.
failed
.
failure_message
}
</
Tag
>
</>
)
}
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Latest Completed CheckPoint'
>
<
Descriptions
.
Item
label=
'Latest Completed CheckPoint'
>
<
Tag
color=
'green'
title=
{
'Latest Completed CheckPoint'
}
>
<
Tag
color=
'green'
title=
{
'Latest Completed CheckPoint'
}
>
{
latest
.
completed
===
null
?
'None'
:
latest
.
completed
.
external_path
}
{
latest
?.
completed
?.
external_path
??
'None'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Persist Checkpoints Externally Enabled'
>
<
Descriptions
.
Item
label=
'Persist Checkpoints Externally Enabled'
>
<
Tag
color=
'blue'
title=
{
'Persist Checkpoints Externally Enabled'
}
>
<
Tag
color=
'blue'
title=
{
'Persist Checkpoints Externally Enabled'
}
>
{
checkpointsConfigInfo
.
externalization
.
enabled
?
'Enabled'
:
'Disabled'
}
{
checkpointsConfigInfo
?
.
externalization
.
enabled
?
'Enabled'
:
'Disabled'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'Latest Savepoint'
>
<
Descriptions
.
Item
label=
'Latest Savepoint'
>
<
Tag
color=
'purple'
title=
{
'Latest Savepoint'
}
>
<
Tag
color=
'purple'
title=
{
'Latest Savepoint'
}
>
{
latest
.
savepoint
===
null
?
'None'
:
latest
.
savepoint
.
external_path
}
{
latest
?.
savepoint
?.
external_path
??
'None'
}
</
Tag
>
</
Tag
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'CheckPoint Counts'
>
<
Descriptions
.
Item
label=
'CheckPoint Counts'
>
<
Space
direction=
{
'horizontal'
}
>
<
Space
direction=
{
'horizontal'
}
>
<
Tag
color=
'blue'
title=
{
'Total'
}
>
<
Tag
color=
'blue'
title=
{
'Total'
}
>
<
RocketOutlined
/>
Total:
{
counts
.
total
}
<
RocketOutlined
/>
Total:
{
counts
?.
total
??
0
}
</
Tag
>
</
Tag
>
<
Tag
color=
'red'
title=
{
'Failed'
}
>
<
Tag
color=
'red'
title=
{
'Failed'
}
>
<
CloseCircleOutlined
/>
Failed:
{
counts
.
failed
}
<
CloseCircleOutlined
/>
Failed:
{
counts
?.
failed
??
0
}
</
Tag
>
</
Tag
>
<
Tag
color=
'cyan'
title=
{
'Restored'
}
>
<
Tag
color=
'cyan'
title=
{
'Restored'
}
>
<
ExclamationCircleOutlined
/>
Restored:
{
counts
.
restored
}
<
ExclamationCircleOutlined
/>
Restored:
{
counts
?.
restored
??
0
}
</
Tag
>
</
Tag
>
<
Tag
color=
'green'
title=
{
'Completed'
}
>
<
Tag
color=
'green'
title=
{
'Completed'
}
>
<
CheckCircleOutlined
/>
Completed:
{
counts
.
completed
}
<
CheckCircleOutlined
/>
Completed:
{
counts
?.
completed
??
0
}
</
Tag
>
</
Tag
>
<
Tag
color=
'orange'
title=
{
'In Progress'
}
>
<
Tag
color=
'orange'
title=
{
'In Progress'
}
>
<
SyncOutlined
spin
/>
In Progress:
{
counts
.
in_progress
}
<
SyncOutlined
spin
/>
In Progress:
{
counts
?.
in_progress
??
0
}
</
Tag
>
</
Tag
>
</
Space
>
</
Space
>
</
Descriptions
.
Item
>
</
Descriptions
.
Item
>
...
...
dinky-web/src/pages/DevOps/JobDetail/JobLineage/index.tsx
0 → 100644
View file @
16835aa3
import
LineageGraph
from
'@/components/LineageGraph'
;
import
{
DevopsType
}
from
'@/pages/DevOps/JobDetail/model'
;
import
{
queryDataByParams
}
from
'@/services/BusinessCrud'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
LineageDetailInfo
}
from
'@/types/DevOps/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@umijs/max'
;
import
{
Card
,
Result
}
from
'antd'
;
import
React
,
{
useEffect
}
from
'react'
;
import
'react-lineage-dag/dist/index.css'
;
const
JobLineage
:
React
.
FC
<
connect
>
=
(
props
)
=>
{
const
{
jobDetail
:
{
id
:
jobInstanceId
}
}
=
props
;
const
[
lineageData
,
setLineageData
]
=
React
.
useState
<
LineageDetailInfo
>
({
tables
:
[],
relations
:
[]
});
const
queryLineageData
=
()
=>
{
queryDataByParams
(
API_CONSTANTS
.
JOB_INSTANCE_GET_LINEAGE
,
{
id
:
jobInstanceId
}).
then
((
res
)
=>
setLineageData
(
res
as
LineageDetailInfo
)
);
};
useEffect
(()
=>
{
queryLineageData
();
},
[
jobInstanceId
]);
return
(
<>
<
Card
hoverable
bodyStyle=
{
{
height
:
'100%'
}
}
style=
{
{
height
:
parent
.
innerHeight
-
180
}
}
>
{
lineageData
&&
(
lineageData
.
tables
.
length
!==
0
||
lineageData
.
relations
.
length
!==
0
)
?
(
<
LineageGraph
lineageData=
{
lineageData
}
refreshCallBack=
{
queryLineageData
}
/>
)
:
(
<
Result
style=
{
{
height
:
'100%'
}
}
status=
'warning'
title=
{
l
(
'lineage.getError'
)
}
/>
)
}
</
Card
>
</>
);
};
export
default
connect
(({
Devops
}:
{
Devops
:
DevopsType
})
=>
({
jobDetail
:
Devops
.
jobInfoDetail
}))(
JobLineage
);
dinky-web/src/pages/DevOps/JobDetail/JobOverview/JobOverview.tsx
View file @
16835aa3
...
@@ -36,7 +36,11 @@ const JobConfigTab = (props: JobProps) => {
...
@@ -36,7 +36,11 @@ const JobConfigTab = (props: JobProps) => {
height
:
'40vh'
height
:
'40vh'
}
}
}
}
>
>
{
job
?
<
FlinkDag
job=
{
job
}
checkPoints=
{
jobDetail
.
jobDataDto
.
checkpoints
}
/>
:
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
{
job
?
(
<
FlinkDag
job=
{
job
}
checkPoints=
{
jobDetail
.
jobDataDto
.
checkpoints
}
/>
)
:
(
<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
)
}
</
ProCard
>
</
ProCard
>
<
FlinkTable
jobDetail=
{
jobDetail
}
/>
<
FlinkTable
jobDetail=
{
jobDetail
}
/>
...
...
dinky-web/src/pages/DevOps/JobDetail/index.tsx
View file @
16835aa3
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
import
JobLifeCycleTag
from
'@/components/JobTags/JobLifeCycleTag'
;
import
JobLifeCycleTag
from
'@/components/JobTags/JobLifeCycleTag'
;
import
AlertHistory
from
'@/pages/DevOps/JobDetail/AlertHistory'
;
import
AlertHistory
from
'@/pages/DevOps/JobDetail/AlertHistory'
;
import
CheckPoints
from
'@/pages/DevOps/JobDetail/CheckPointsTab'
;
import
CheckPoints
from
'@/pages/DevOps/JobDetail/CheckPointsTab'
;
import
JobLineage
from
'@/pages/DevOps/JobDetail/JobLineage'
;
import
JobLogsTab
from
'@/pages/DevOps/JobDetail/JobLogs/JobLogsTab'
;
import
JobLogsTab
from
'@/pages/DevOps/JobDetail/JobLogs/JobLogsTab'
;
import
JobMetrics
from
'@/pages/DevOps/JobDetail/JobMetrics'
;
import
JobMetrics
from
'@/pages/DevOps/JobDetail/JobMetrics'
;
import
JobOperator
from
'@/pages/DevOps/JobDetail/JobOperator/JobOperator'
;
import
JobOperator
from
'@/pages/DevOps/JobDetail/JobOperator/JobOperator'
;
...
@@ -70,7 +71,7 @@ const JobDetail = (props: any) => {
...
@@ -70,7 +71,7 @@ const JobDetail = (props: any) => {
[
OperatorEnum
.
JOB_VERSION
]:
<
JobVersionTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_VERSION
]:
<
JobVersionTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_CHECKPOINTS
]:
<
CheckPoints
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_CHECKPOINTS
]:
<
CheckPoints
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_METRICS
]:
<
JobMetrics
/>
,
[
OperatorEnum
.
JOB_METRICS
]:
<
JobMetrics
/>
,
// [OperatorEnum.JOB_LINEAGE]: <Lineage jobDetail={jobInfoDetail}
/>,
[
OperatorEnum
.
JOB_LINEAGE
]:
<
JobLineage
/>
,
[
OperatorEnum
.
JOB_ALERT
]:
<
AlertHistory
jobDetail
=
{
jobInfoDetail
}
/
>
[
OperatorEnum
.
JOB_ALERT
]:
<
AlertHistory
jobDetail
=
{
jobInfoDetail
}
/
>
};
};
...
...
dinky-web/src/pages/Metrics/Job/index.tsx
View file @
16835aa3
This diff is collapsed.
Click to expand it.
dinky-web/src/services/endpoints.tsx
View file @
16835aa3
...
@@ -226,6 +226,10 @@ export enum API_CONSTANTS {
...
@@ -226,6 +226,10 @@ export enum API_CONSTANTS {
GET_TASKMANAGER_LOG
=
'api/jobInstance/getTaskManagerLog'
,
GET_TASKMANAGER_LOG
=
'api/jobInstance/getTaskManagerLog'
,
GET_JOB_MERTICE_ITEMS
=
'api/jobInstance/getJobMetricsItems'
,
GET_JOB_MERTICE_ITEMS
=
'api/jobInstance/getJobMetricsItems'
,
CANCEL_JOB
=
'/api/studio/cancel'
,
CANCEL_JOB
=
'/api/studio/cancel'
,
// /api/studio/getLineage
STUDIO_GET_LINEAGE
=
'/api/studio/getLineage'
,
// /api/jobInstance/getLineage
JOB_INSTANCE_GET_LINEAGE
=
'/api/jobInstance/getLineage'
,
OFFLINE_TASK
=
'/api/task/offLineTask'
,
OFFLINE_TASK
=
'/api/task/offLineTask'
,
RESTART_TASK
=
'/api/task/restartTask'
,
RESTART_TASK
=
'/api/task/restartTask'
,
RESTART_TASK_FROM_CHECKPOINT
=
'/api/task/selectSavePointRestartTask'
,
RESTART_TASK_FROM_CHECKPOINT
=
'/api/task/selectSavePointRestartTask'
,
...
...
dinky-web/src/types/DevOps/data.d.ts
View file @
16835aa3
...
@@ -216,3 +216,28 @@ export interface AlertHistory {
...
@@ -216,3 +216,28 @@ export interface AlertHistory {
createTime
:
Date
;
createTime
:
Date
;
updateTime
:
Date
;
updateTime
:
Date
;
}
}
export
interface
LineageTableColumn
{
name
:
string
;
title
:
string
;
}
export
interface
LineageTable
{
id
:
string
;
name
:
string
;
isCollapse
:
boolean
;
columns
:
LineageTableColumn
[];
}
export
interface
LineageRelations
{
id
:
string
;
srcTableId
:
string
;
tgtTableId
:
string
;
srcTableColName
:
string
;
tgtTableColName
:
string
;
}
export
interface
LineageDetailInfo
{
tables
:
LineageTable
[];
relations
:
LineageRelations
[];
}
script/sql/dinky-mysql.sql
View file @
16835aa3
...
@@ -668,7 +668,7 @@ CREATE TABLE `dinky_task` (
...
@@ -668,7 +668,7 @@ CREATE TABLE `dinky_task` (
`alert_group_id`
bigint
(
20
)
NULL
DEFAULT
NULL
COMMENT
'alert group id'
,
`alert_group_id`
bigint
(
20
)
NULL
DEFAULT
NULL
COMMENT
'alert group id'
,
`config_json`
text
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
COMMENT
'configuration json'
,
`config_json`
text
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
COMMENT
'configuration json'
,
`note`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
DEFAULT
NULL
COMMENT
'Job Note'
,
`note`
varchar
(
255
)
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_general_ci
NULL
DEFAULT
NULL
COMMENT
'Job Note'
,
`step`
int
(
11
)
NULL
DEFAULT
NULL
COMMENT
'Job lifecycle
'
,
`step`
int
(
11
)
NULL
DEFAULT
1
COMMENT
'Job lifecycle,
'
,
`job_instance_id`
bigint
(
20
)
NULL
DEFAULT
NULL
COMMENT
'job instance id'
,
`job_instance_id`
bigint
(
20
)
NULL
DEFAULT
NULL
COMMENT
'job instance id'
,
`enabled`
tinyint
(
1
)
NOT
NULL
DEFAULT
1
COMMENT
'is enable'
,
`enabled`
tinyint
(
1
)
NOT
NULL
DEFAULT
1
COMMENT
'is enable'
,
`create_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'create time'
,
`create_time`
datetime
(
0
)
NULL
DEFAULT
NULL
COMMENT
'create time'
,
...
...
script/sql/dinky-pg.sql
View file @
16835aa3
...
@@ -1132,7 +1132,7 @@ CREATE TABLE "public"."dinky_task" (
...
@@ -1132,7 +1132,7 @@ CREATE TABLE "public"."dinky_task" (
"alert_group_id"
int8
,
"alert_group_id"
int8
,
"config_json"
text
COLLATE
"pg_catalog"
.
"default"
,
"config_json"
text
COLLATE
"pg_catalog"
.
"default"
,
"note"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"note"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"step"
int4
,
"step"
int4
default
1
,
"job_instance_id"
int8
,
"job_instance_id"
int8
,
"enabled"
int2
NOT
null
,
"enabled"
int2
NOT
null
,
"create_time"
timestamp
(
6
),
"create_time"
timestamp
(
6
),
...
...
script/sql/upgrade/1.0.0-SNAPSHOT_schema/mysql/dinky_dml.sql
View file @
16835aa3
...
@@ -235,3 +235,5 @@ COMMIT;
...
@@ -235,3 +235,5 @@ COMMIT;
update
dinky_user
set
super_admin_flag
=
1
where
id
=
1
;
update
dinky_user
set
super_admin_flag
=
1
where
id
=
1
;
alter
table
dinky_task
alter
column
`step`
set
default
1
;
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