This is an automated email from the ASF dual-hosted git repository.
kerwin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 4203304 [Fix-7493] Support searching for task node in the DAG. (#7766)
4203304 is described below
commit 4203304b08847d57218f9e9cb4edf7447f6eab8b
Author: calvin <[email protected]>
AuthorDate: Sat Jan 1 12:46:40 2022 +0800
[Fix-7493] Support searching for task node in the DAG. (#7766)
* add a select to support fuzzy search
---
.../conf/home/pages/dag/_source/canvas/toolbar.vue | 28 ++++++++++------------
.../src/js/module/i18n/locale/en_US.js | 3 ++-
.../src/js/module/i18n/locale/zh_CN.js | 3 ++-
3 files changed, 16 insertions(+), 18 deletions(-)
diff --git
a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/toolbar.vue
b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/toolbar.vue
index cb701d6..95f83bb 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/toolbar.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/canvas/toolbar.vue
@@ -74,16 +74,14 @@
'visible': searchInputVisible
}"
>
- <el-input
- v-model="searchText"
- placeholder=""
- prefix-icon="el-icon-search"
- size="mini"
- @keyup.enter.native="onSearch"
- clearable
- @blur="searchInputBlur"
- ref="searchInput"
- ></el-input>
+ <el-select v-if="searchInputVisible" ref="searchInput"
v-model="searchText" size="mini" clearable prefix-icon="el-icon-search"
@change="onSearch" @keyup.enter.native="onSearch" filterable
:placeholder="$t('Please select task name')">
+ <el-option
+ v-for="item in getTaskNodeOptions()"
+ :key="item.id"
+ :label="item.data.taskName"
+ :value="item.data.taskName">
+ </el-option>
+ </el-select>
</div>
<el-tooltip
class="toolbar-operation"
@@ -191,14 +189,12 @@
const canvas = this.getDagCanvasRef()
canvas.navigateTo(this.searchText)
},
+ getTaskNodeOptions () {
+ const canvas = this.getDagCanvasRef()
+ return canvas.getNodes()
+ },
showSearchInput () {
this.searchInputVisible = true
- this.$refs.searchInput.focus()
- },
- searchInputBlur () {
- if (!this.searchText) {
- this.searchInputVisible = false
- }
},
getDagCanvasRef () {
if (this.canvasRef) {
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
index dc76585..e8a14bd 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
@@ -795,5 +795,6 @@ export default {
'Task group queue the status of releasing': 'Released',
'Modify task group queue priority': 'Edit the priority of the task group
queue',
'Priority not empty': 'The value of priority can not be empty',
- 'Priority must be number': 'The value of priority should be number'
+ 'Priority must be number': 'The value of priority should be number',
+ 'Please select task name': 'Please select a task name'
}
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
index c6d2548..78742fc 100644
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
@@ -797,5 +797,6 @@ export default {
'Modify task group queue priority': '修改优先级',
'Force to start task': '强制启动',
'Priority not empty': '优先级不能为空',
- 'Priority must be number': '优先级必须是数值'
+ 'Priority must be number': '优先级必须是数值',
+ 'Please select task name': '请选择节点名称'
}