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
496e1182
Unverified
Commit
496e1182
authored
Oct 07, 2023
by
zhu-mingye
Committed by
GitHub
Oct 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix devops's bug (#2353)
* fix devops's graph's bug * Spotless Apply --------- Co-authored-by:
zhu-mingye
<
zhu-mingye@users.noreply.github.com
>
parent
f4183616
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
40 deletions
+49
-40
DagDataNode.tsx
dinky-web/src/components/FlinkDag/component/DagDataNode.tsx
+16
-11
DagPlanNode.tsx
dinky-web/src/components/FlinkDag/component/DagPlanNode.tsx
+1
-1
index.tsx
dinky-web/src/components/FlinkDag/index.tsx
+23
-25
pages.ts
dinky-web/src/locales/en-US/pages.ts
+3
-0
pages.ts
dinky-web/src/locales/zh-CN/pages.ts
+3
-0
index.tsx
dinky-web/src/pages/Home/DevOverView/ResourceView/index.tsx
+3
-3
No files found.
dinky-web/src/components/FlinkDag/component/DagDataNode.tsx
View file @
496e1182
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
*/
*/
import
StatusTag
from
'@/components/JobTags/StatusTag'
;
import
StatusTag
from
'@/components/JobTags/StatusTag'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
Card
,
Col
,
Row
,
Tag
,
Typography
}
from
'antd'
;
import
{
Card
,
Col
,
Row
,
Tag
,
Typography
}
from
'antd'
;
const
{
Text
,
Paragraph
}
=
Typography
;
const
{
Text
,
Paragraph
}
=
Typography
;
...
@@ -28,7 +29,7 @@ const DagDataNode = (props: any) => {
...
@@ -28,7 +29,7 @@ const DagDataNode = (props: any) => {
return
(
return
(
<
Card
<
Card
style=
{
{
width
:
'250px'
,
padding
:
0
}
}
style=
{
{
width
:
'250px'
,
padding
:
0
,
margin
:
0
,
height
:
140
}
}
bordered=
{
false
}
bordered=
{
false
}
size=
{
'small'
}
size=
{
'small'
}
type=
{
'inner'
}
type=
{
'inner'
}
...
@@ -43,23 +44,27 @@ const DagDataNode = (props: any) => {
...
@@ -43,23 +44,27 @@ const DagDataNode = (props: any) => {
</
Paragraph
>
</
Paragraph
>
<
Row
>
<
Row
>
<
Col
span=
{
15
}
>
<
Col
span=
{
16
}
>
<
Text
type=
'secondary'
>
BackPressure:
</
Text
>
<
Text
type=
'secondary'
>
<
Tag
bordered=
{
false
}
color=
'success'
>
{
l
(
'devops.baseinfo.backpressure'
)
}
:
OK
<
Tag
bordered=
{
false
}
color=
'success'
>
</
Tag
>
OK
</
Tag
>
</
Text
>
</
Col
>
</
Col
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
<
Text
type=
'secondary'
>
Busy:
97%
</
Text
>
<
Text
type=
'secondary'
>
{
l
(
'devops.baseinfo.busy'
)
}
:
97%
</
Text
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
<
Row
>
<
Row
>
<
Col
span=
{
15
}
>
<
Col
span=
{
16
}
>
<
Text
type=
'secondary'
>
Status:
</
Text
>
<
Text
type=
'secondary'
>
<
StatusTag
status=
{
data
.
status
}
bordered=
{
false
}
animation=
{
false
}
/>
{
l
(
'devops.baseinfo.status'
)
}
:
<
StatusTag
status=
{
data
.
status
}
bordered=
{
false
}
animation=
{
false
}
/>
</
Text
>
</
Col
>
</
Col
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
<
Text
type=
'secondary'
>
Idle:
50%
</
Text
>
<
Text
type=
'secondary'
>
{
l
(
'devops.baseinfo.idle'
)
}
:
50%
</
Text
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
</
Card
>
</
Card
>
...
...
dinky-web/src/components/FlinkDag/component/DagPlanNode.tsx
View file @
496e1182
...
@@ -27,7 +27,7 @@ const DagPlanNode = (props: any) => {
...
@@ -27,7 +27,7 @@ const DagPlanNode = (props: any) => {
return
(
return
(
<
Card
<
Card
style=
{
{
width
:
'250px'
,
padding
:
0
}
}
style=
{
{
width
:
'250px'
,
padding
:
0
,
margin
:
0
,
height
:
140
}
}
bordered=
{
false
}
bordered=
{
false
}
size=
{
'small'
}
size=
{
'small'
}
type=
{
'inner'
}
type=
{
'inner'
}
...
...
dinky-web/src/components/FlinkDag/index.tsx
View file @
496e1182
...
@@ -47,23 +47,25 @@ const FlinkDag = (props: DagProps) => {
...
@@ -47,23 +47,25 @@ const FlinkDag = (props: DagProps) => {
const
{
job
,
onlyPlan
=
false
}
=
props
;
const
{
job
,
onlyPlan
=
false
}
=
props
;
const
[
graph
,
setGraph
]
=
useState
<
Graph
>
();
const
[
graph
,
setGraph
]
=
useState
<
Graph
>
();
const
[
cur
entJob
,
setCu
rentJob
]
=
useState
<
string
>
();
const
[
cur
rentJob
,
setCur
rentJob
]
=
useState
<
string
>
();
const
[
cur
entSelect
,
setCu
rentSelect
]
=
useState
<
any
>
();
const
[
cur
rentSelect
,
setCur
rentSelect
]
=
useState
<
any
>
();
const
[
open
,
setOpen
]
=
useState
(
false
);
const
[
open
,
setOpen
]
=
useState
(
false
);
const
handleClose
=
()
=>
{
setOpen
(
false
);
setCurrentSelect
(
undefined
);
graph
?.
zoomToFit
(
zoomOptions
);
graph
?.
centerContent
();
};
const
initListen
=
(
graph
:
Graph
)
=>
{
const
initListen
=
(
graph
:
Graph
)
=>
{
graph
.
on
(
'node:selected'
,
({
cell
})
=>
{
graph
.
on
(
'node:selected'
,
({
cell
})
=>
{
setOpen
(
true
);
setOpen
(
true
);
setCurentSelect
(
cell
);
setCur
r
entSelect
(
cell
);
graph
.
positionCell
(
cell
,
'center'
);
graph
.
positionCell
(
cell
,
'center'
);
});
});
graph
.
on
(
'node:unselected'
,
({
cell
})
=>
{
graph
.
on
(
'node:unselected'
,
({
cell
})
=>
handleClose
());
setOpen
(
false
);
setCurentSelect
(
undefined
);
graph
.
zoomToFit
(
zoomOptions
);
graph
.
centerContent
();
});
};
};
const
initGraph
=
(
flinkData
:
any
)
=>
{
const
initGraph
=
(
flinkData
:
any
)
=>
{
...
@@ -101,44 +103,40 @@ const FlinkDag = (props: DagProps) => {
...
@@ -101,44 +103,40 @@ const FlinkDag = (props: DagProps) => {
// Automatically zoom to fit
// Automatically zoom to fit
graph
.
zoomToFit
(
zoomOptions
);
graph
.
zoomToFit
(
zoomOptions
);
graph
.
centerContent
();
graph
.
centerContent
();
updateDag
(
job
.
vertices
,
graph
);
updateDag
(
job
?
.
vertices
,
graph
);
initListen
(
graph
);
initListen
(
graph
);
return
graph
;
return
graph
;
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
const
flinkData
=
buildDag
(
job
.
plan
);
const
flinkData
=
buildDag
(
job
?
.
plan
);
// Clean up old data
// Clean up old data
if
(
graph
)
{
if
(
graph
)
{
graph
.
clearCells
();
graph
.
clearCells
();
}
}
setGraph
(
initGraph
(
flinkData
));
setGraph
(
initGraph
(
flinkData
));
},
[
curentJob
]);
},
[
cur
r
entJob
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
updateDag
(
job
.
vertices
,
graph
);
updateDag
(
job
?
.
vertices
,
graph
);
if
(
cur
entJob
!=
job
.
jid
)
{
if
(
cur
rentJob
!=
job
?
.
jid
)
{
setCur
entJob
(
job
.
jid
);
setCur
rentJob
(
job
?
.
jid
);
}
}
},
[
job
]);
},
[
job
]);
return
(
return
(
<>
<>
<
div
<
div
style=
{
{
height
:
'100%'
,
width
:
'100%'
}
}
ref=
{
container
}
/>
style=
{
{
height
:
'100%'
,
width
:
'100%'
}
}
ref=
{
container
}
/>
<
Drawer
<
Drawer
title=
{
cur
entSelect
?.
name
}
title=
{
cur
rentSelect
?.
data
?.
id
}
open=
{
open
}
open=
{
open
}
getContainer=
{
false
}
getContainer=
{
false
}
size=
{
'large
'
}
width=
{
'35%
'
}
mask=
{
false
}
mask=
{
false
}
onClose=
{
()
=>
handleClose
()
}
destroyOnClose=
{
true
}
>
>
<
p
>
{
curentSelect
?.
getData
().
description
}
</
p
>
<
p
>
{
cur
r
entSelect
?.
getData
().
description
}
</
p
>
</
Drawer
>
</
Drawer
>
</>
</>
);
);
...
...
dinky-web/src/locales/en-US/pages.ts
View file @
496e1182
...
@@ -106,6 +106,9 @@ export default {
...
@@ -106,6 +106,9 @@ export default {
'devops.baseinfo.tasks'
:
'Operator'
,
'devops.baseinfo.tasks'
:
'Operator'
,
'devops.baseinfo.writebytes'
:
'Send Bytes'
,
'devops.baseinfo.writebytes'
:
'Send Bytes'
,
'devops.baseinfo.writerecords'
:
'Send Records'
,
'devops.baseinfo.writerecords'
:
'Send Records'
,
'devops.baseinfo.backpressure'
:
'BackPressure'
,
'devops.baseinfo.busy'
:
'Busy'
,
'devops.baseinfo.idle'
:
'Idle'
,
'devops.jobinfo.ck.checkpoint_type'
:
'Type'
,
'devops.jobinfo.ck.checkpoint_type'
:
'Type'
,
'devops.jobinfo.ck.duration'
:
'Duration'
,
'devops.jobinfo.ck.duration'
:
'Duration'
,
'devops.jobinfo.ck.external_path'
:
'Storage Location'
,
'devops.jobinfo.ck.external_path'
:
'Storage Location'
,
...
...
dinky-web/src/locales/zh-CN/pages.ts
View file @
496e1182
...
@@ -100,6 +100,9 @@ export default {
...
@@ -100,6 +100,9 @@ export default {
'devops.baseinfo.tasks'
:
'算子'
,
'devops.baseinfo.tasks'
:
'算子'
,
'devops.baseinfo.writebytes'
:
'发送字节'
,
'devops.baseinfo.writebytes'
:
'发送字节'
,
'devops.baseinfo.writerecords'
:
'发送记录'
,
'devops.baseinfo.writerecords'
:
'发送记录'
,
'devops.baseinfo.backpressure'
:
'反压'
,
'devops.baseinfo.busy'
:
'繁忙'
,
'devops.baseinfo.idle'
:
'空闲'
,
'devops.jobinfo.ck.checkpoint_type'
:
'类型'
,
'devops.jobinfo.ck.checkpoint_type'
:
'类型'
,
'devops.jobinfo.ck.duration'
:
'耗时'
,
'devops.jobinfo.ck.duration'
:
'耗时'
,
'devops.jobinfo.ck.external_path'
:
'存储位置'
,
'devops.jobinfo.ck.external_path'
:
'存储位置'
,
...
...
dinky-web/src/pages/Home/DevOverView/ResourceView/index.tsx
View file @
496e1182
...
@@ -42,9 +42,9 @@ const ResourceView = () => {
...
@@ -42,9 +42,9 @@ const ResourceView = () => {
const
[
data
,
setData
]
=
useState
<
ResourceOverView
>
();
const
[
data
,
setData
]
=
useState
<
ResourceOverView
>
();
useEffect
(()
=>
{
useEffect
(()
=>
{
queryDataByParams
(
API_CONSTANTS
.
GET_RESOURCE_OVERVIEW
).
then
((
res
)
=>
{
queryDataByParams
(
API_CONSTANTS
.
GET_RESOURCE_OVERVIEW
).
then
((
res
)
=>
setData
(
res
);
setData
(
res
as
ResourceOverView
)
}
);
);
},
[]);
},
[]);
return
(
return
(
...
...
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