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
e5b1ddc6
Commit
e5b1ddc6
authored
Aug 22, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flink执行图改进
parent
e2e7c5a3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
47 deletions
+33
-47
index.tsx
...eb/src/components/Studio/StudioMenu/StudioGraph/index.tsx
+31
-44
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+2
-3
No files found.
dlink-web/src/components/Studio/StudioMenu/StudioGraph/index.tsx
View file @
e5b1ddc6
...
@@ -6,16 +6,25 @@ import styles from "./index.less";
...
@@ -6,16 +6,25 @@ import styles from "./index.less";
import
React
,
{
useState
}
from
"react"
;
import
React
,
{
useState
}
from
"react"
;
const
StudioGraph
=
(
props
:
any
)
=>
{
const
StudioGraph
=
(
props
:
any
)
=>
{
const
{
graphD
ata
,
current
,
currentSession
}
=
props
;
const
{
d
ata
,
current
,
currentSession
}
=
props
;
const
config
=
{
const
config
=
{
data
:
graphData
,
data
,
nodeCfg
:
{
nodeCfg
:
{
size
:
[
140
,
25
],
size
:
[
140
,
65
],
/*anchorPoints: [
[0.5, 1],
[0.5, 0],
],*/
items
:
{
items
:
{
padding
:
6
,
padding
:
[
6
,
0
,
0
]
,
containerStyle
:
{
containerStyle
:
{
fill
:
'#fff'
,
fill
:
'#fff'
,
width
:
'100px'
,
display
:
'inline-block'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
whiteSpace
:
'nowrap'
,
},
},
style
:
(
cfg
,
group
,
type
)
=>
{
style
:
(
cfg
,
group
,
type
)
=>
{
const
styles
=
{
const
styles
=
{
...
@@ -28,33 +37,29 @@ const StudioGraph = (props:any) => {
...
@@ -28,33 +37,29 @@ const StudioGraph = (props:any) => {
},
},
text
:
{
text
:
{
fill
:
'#aaa'
,
fill
:
'#aaa'
,
width
:
'100px'
,
display
:
'inline-block'
,
overflow
:
'hidden'
,
textOverflow
:
'ellipsis'
,
whiteSpace
:
'nowrap'
,
},
},
};
};
return
styles
[
type
];
return
styles
[
type
];
},
},
},
},
nodeStateStyles
:
{
nodeStateStyles
:
{
hover
:
{
hover
:
{
stroke
:
'#1890ff'
,
stroke
:
'#1890ff'
,
lineWidth
:
2
,
lineWidth
:
2
,
},
},
},
},
title
:
{
containerStyle
:
{
fill
:
'transparent'
,
},
style
:
{
fill
:
'#000'
,
fontSize
:
12
,
},
},
style
:
{
style
:
{
fill
:
'#E6EAF1'
,
stroke
:
'#B2BED5'
,
radius
:
[
2
,
2
,
2
,
2
],
radius
:
[
2
,
2
,
2
,
2
],
},
},
},
},
edgeCfg
:
{
edgeCfg
:
{
type
:
'polyline'
,
label
:
{
label
:
{
style
:
{
style
:
{
fill
:
'#aaa'
,
fill
:
'#aaa'
,
...
@@ -62,51 +67,33 @@ const StudioGraph = (props:any) => {
...
@@ -62,51 +67,33 @@ const StudioGraph = (props:any) => {
fillOpacity
:
1
,
fillOpacity
:
1
,
},
},
},
},
style
:
(
edge
)
=>
{
endArrow
:
{
const
stroke
=
edge
.
target
===
'0'
?
'#c86bdd'
:
'#5ae859'
;
fill
:
'#ddd'
,
return
{
stroke
,
lineWidth
:
1
,
strokeOpacity
:
0.5
,
};
},
},
edgeStateStyles
:
{
edgeStateStyles
:
{
hover
:
{
hover
:
{
stroke
:
'#1890ff'
,
lineWidth
:
2
,
lineWidth
:
2
,
strokeOpacity
:
1
,
},
},
},
},
},
},
markerCfg
:
(
cfg
)
=>
{
markerCfg
:
(
cfg
)
=>
{
const
{
edges
}
=
graphD
ata
;
const
{
edges
}
=
d
ata
;
return
{
return
{
position
:
'right'
,
position
:
'right'
,
show
:
edges
.
find
((
item
)
=>
item
.
source
==
cfg
.
id
),
show
:
edges
.
find
((
item
)
=>
item
.
source
==
=
cfg
.
id
),
collapsed
:
!
edges
.
find
((
item
)
=>
item
.
source
==
cfg
.
id
),
collapsed
:
!
edges
.
find
((
item
)
=>
item
.
source
==
=
cfg
.
id
),
};
};
},
},
behaviors
:
[
'drag-canvas'
,
'zoom-canvas'
,
'drag-node'
],
behaviors
:
[
'drag-canvas'
,
'zoom-canvas'
,
'drag-node'
],
/*layout: {
rankdir: 'TB',
ranksepFunc: () => 20,
},*/
};
};
/*const buildGraphEdges=(nodes)=>{
let edges = [];
for(let i in nodes){
if(nodes[i].predecessors){
for(let j in nodes[i].predecessors){
edges.push({source: nodes[i].predecessors[j].id.toString(),
target: nodes[i].id.toString(),
value: nodes[i].predecessors[j].ship_strategy})
}
}
}
return edges;
};*/
return
(
return
(
<>
{
graphD
ata
?
<
FlowAnalysisGraph
{
...
config
}
/>
:<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
<>
{
d
ata
?
<
FlowAnalysisGraph
{
...
config
}
/>
:<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
</>
</>
);
);
};
};
...
...
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
e5b1ddc6
...
@@ -218,6 +218,7 @@ const StudioMenu = (props: any) => {
...
@@ -218,6 +218,7 @@ const StudioMenu = (props: any) => {
items
:
[
items
:
[
{
{
text
:
data
.
nodes
[
i
].
contents
,
text
:
data
.
nodes
[
i
].
contents
,
value
:
data
.
nodes
[
i
].
parallelism
,
},
},
],
],
};
};
...
@@ -384,12 +385,10 @@ const StudioMenu = (props: any) => {
...
@@ -384,12 +385,10 @@ const StudioMenu = (props: any) => {
cancelText=
"取消"
cancelText=
"取消"
>
>
<
Tooltip
title=
"停止所有的 FlinkSql 任务,暂不可用"
>
<
Tooltip
title=
"停止所有的 FlinkSql 任务,暂不可用"
>
{
/*<Badge size="small" count={1} offset={[-5, 5]}>*/
}
<
Button
<
Button
type=
"text"
type=
"text"
icon=
{
<
PauseCircleTwoTone
twoToneColor=
"#ddd"
/>
}
icon=
{
<
PauseCircleTwoTone
twoToneColor=
"#ddd"
/>
}
/>
/>
{
/*</Badge>*/
}
</
Tooltip
>
</
Tooltip
>
</
Popconfirm
>
</
Popconfirm
>
<
Divider
type=
"vertical"
/>
<
Divider
type=
"vertical"
/>
...
@@ -431,7 +430,7 @@ const StudioMenu = (props: any) => {
...
@@ -431,7 +430,7 @@ const StudioMenu = (props: any) => {
visible=
{
graphModalVisible
}
visible=
{
graphModalVisible
}
onCancel=
{
()
=>
handleGraphModalVisible
(
false
)
}
onCancel=
{
()
=>
handleGraphModalVisible
(
false
)
}
>
>
<
StudioGraph
graphD
ata=
{
graphData
}
/>
<
StudioGraph
d
ata=
{
graphData
}
/>
</
Modal
>
</
Modal
>
</
Row
>
</
Row
>
);
);
...
...
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