This is an automated email from the ASF dual-hosted git repository.
songjian pushed a commit to branch 2.0.4-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/2.0.4-prepare by this push:
new b9e3b85 [cherry-pick][Fix-8163] Add a tooltip on the task node to
rectify this issue. #8280
b9e3b85 is described below
commit b9e3b857c44c128134fe5705e599b35d881591fa
Author: calvin <[email protected]>
AuthorDate: Sat Feb 19 13:52:47 2022 +0800
[cherry-pick][Fix-8163] Add a tooltip on the task node to rectify this
issue. #8280
---
.../conf/home/pages/dag/_source/canvas/canvas.vue | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git
a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/canvas.vue
b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/canvas.vue
index fa156b0..74387be 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/canvas.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/canvas.vue
@@ -270,6 +270,35 @@
edge.setSource(sourceNode)
}
})
+
+ // Add a node tool when the mouse entering
+ this.graph.on('node:mouseenter', ({ e, x, y, node, view }) => {
+ const nodeName = node.getData().taskName
+ node.addTools({
+ name: 'button',
+ args: {
+ markup: [
+ {
+ tagName: 'text',
+ textContent: nodeName,
+ attrs: {
+ fill: '#868686',
+ 'font-size': 16,
+ 'text-anchor': 'center'
+ }
+ }
+ ],
+ x: 0,
+ y: 0,
+ offset: { x: 0, y: -10 }
+ }
+ })
+ })
+
+ // Remove all tools when the mouse leaving
+ this.graph.on('node:mouseleave', ({ node }) => {
+ node.removeTools()
+ })
},
/**
* @param {Edge|string} edge