This is an automated email from the ASF dual-hosted git repository.
arshad pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/seatunnel-web.git
The following commit(s) were added to refs/heads/main by this push:
new f07fe97c [Feature] After run a task, jump to the task details page
(#258)
f07fe97c is described below
commit f07fe97ce054e0b848d77725258598691e0126dd
Author: Jast <[email protected]>
AuthorDate: Sat Jan 11 10:30:19 2025 +0800
[Feature] After run a task, jump to the task details page (#258)
---
seatunnel-ui/src/locales/en_US/project.ts | 4 ++-
seatunnel-ui/src/locales/zh_CN/project.ts | 4 ++-
.../task/synchronization-definition/use-table.ts | 33 ++++++++++++++++------
3 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/seatunnel-ui/src/locales/en_US/project.ts
b/seatunnel-ui/src/locales/en_US/project.ts
index 77a1ec80..b6bc46a6 100644
--- a/seatunnel-ui/src/locales/en_US/project.ts
+++ b/seatunnel-ui/src/locales/en_US/project.ts
@@ -1098,7 +1098,9 @@ export default {
sql_content_label: 'SQL',
sql_content_label_placeholder: 'please input the SQL statement',
query_validate: 'please input the SQL statement',
- target_name_tips: 'Please enter or select table name'
+ target_name_tips: 'Please enter or select table name',
+ start_success: 'Start success',
+ start_failed: 'Start failed'
},
synchronization_instance: {
pipeline_id: 'Pipeline Id',
diff --git a/seatunnel-ui/src/locales/zh_CN/project.ts
b/seatunnel-ui/src/locales/zh_CN/project.ts
index 774b6187..3e059f18 100644
--- a/seatunnel-ui/src/locales/zh_CN/project.ts
+++ b/seatunnel-ui/src/locales/zh_CN/project.ts
@@ -1066,7 +1066,9 @@ export default {
sql_content_label: 'SQL',
sql_content_label_placeholder: '请输入SQL语句',
query_validate: '请输入SQL语句',
- target_name_tips: '请输入或选择表名(必填)'
+ target_name_tips: '请输入或选择表名(必填)',
+ start_success: '启动成功',
+ start_failed: '启动失败'
},
synchronization_instance: {
pipeline_id: 'Pipeline ID',
diff --git
a/seatunnel-ui/src/views/task/synchronization-definition/use-table.ts
b/seatunnel-ui/src/views/task/synchronization-definition/use-table.ts
index 0d5da95f..2c17209d 100644
--- a/seatunnel-ui/src/views/task/synchronization-definition/use-table.ts
+++ b/seatunnel-ui/src/views/task/synchronization-definition/use-table.ts
@@ -29,6 +29,7 @@ import type { Router } from 'vue-router'
import type { JobType } from './dag/types'
import { COLUMN_WIDTH_CONFIG } from '@/common/column-width-config'
import { useTableLink } from '@/hooks'
+import { useMessage } from 'naive-ui'
export function useTable() {
const { t } = useI18n()
@@ -52,6 +53,10 @@ export function useTable() {
DATA_INTEGRATION: 'data_integration'
} as { [key in JobType]: string }
+ const message = useMessage()
+
+ const loadingStates = ref(new Map())
+
const createColumns = (variables: any) => {
variables.columns = [
{
@@ -100,10 +105,12 @@ export function useTable() {
},
icon: h(EditOutlined)
},
-
{
text: t('project.synchronization_definition.start'),
- onClick: (row: any) => void handleRun(row),
+ onClick: (row: any) => {
+ if (loadingStates.value.get(row.id)) return
+ handleRun(row)
+ },
icon: h(PlayCircleOutlined)
},
{
@@ -113,8 +120,7 @@ export function useTable() {
popTips: t('security.token.delete_confirm')
}
]
- },
-
+ }
)
]
}
@@ -135,12 +141,21 @@ export function useTable() {
}
const handleRun = (row: any) => {
- executeJob(row.id).then(() => {
- getTableData({
- pageSize: variables.pageSize,
- pageNo: variables.page,
- searchName: variables.searchName
+ // Prevent duplicate task submissions
+ loadingStates.value.set(row.id, true)
+
+ executeJob(row.id).then((res: any) => {
+ message.success(t('project.synchronization_definition.start_success'))
+ router.push({
+ path: `/task/synchronization-instance/${row.id}`,
+ query: {
+ jobInstanceId: res,
+ taskName: row.name
+ }
})
+ }).catch((error) => {
+ message.error(t('project.synchronization_definition.start_failed'))
+ loadingStates.value.set(row.id, false)
})
}