You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by ty...@apache.org on 2023/03/06 02:56:48 UTC
[incubator-seatunnel-web] branch main updated: Hotfix][UI] Fix warnings in the project. (#41)
This is an automated email from the ASF dual-hosted git repository.
tyrantlucifer pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel-web.git
The following commit(s) were added to refs/heads/main by this push:
new 9cb3169b Hotfix][UI] Fix warnings in the project. (#41)
9cb3169b is described below
commit 9cb3169be9428c72c62bb3e1bbba799e8edb8b55
Author: songjianet <17...@qq.com>
AuthorDate: Mon Mar 6 10:56:42 2023 +0800
Hotfix][UI] Fix warnings in the project. (#41)
---
seatunnel-ui/src/service/script/index.ts | 21 -------------
.../src/views/data-pipes/list/use-table.ts | 28 ++++++++++++-----
seatunnel-ui/src/views/jobs/list/use-table.ts | 4 +--
seatunnel-ui/src/views/tasks/list/use-table.ts | 36 +++++++++++++++++-----
.../src/views/user-manage/list/use-table.ts | 13 +++++---
seatunnel-ui/vite.config.ts | 5 +--
6 files changed, 62 insertions(+), 45 deletions(-)
diff --git a/seatunnel-ui/src/service/script/index.ts b/seatunnel-ui/src/service/script/index.ts
index e5b39c29..808f9148 100644
--- a/seatunnel-ui/src/service/script/index.ts
+++ b/seatunnel-ui/src/service/script/index.ts
@@ -48,13 +48,6 @@ export function scriptDelete(scriptId: number): any {
})
}
-export function scriptContent(scriptId: number): any {
- return axios({
- url: `/script/${scriptId}/content`,
- method: 'get'
- })
-}
-
export function scriptUpdate(scriptId: number, content: string): any {
return axios({
url: `/script/${scriptId}/content`,
@@ -65,20 +58,6 @@ export function scriptUpdate(scriptId: number, content: string): any {
})
}
-export function scriptParam(scriptId: number): any {
- return axios({
- url: `/script/${scriptId}/param`,
- method: 'get'
- })
-}
-
-export function scriptParamUpdate(scriptId: number): any {
- return axios({
- url: `/script/${scriptId}/param`,
- method: 'put'
- })
-}
-
export function scriptPublish(scriptId: number): any {
return axios({
url: `/script/${scriptId}/publish`,
diff --git a/seatunnel-ui/src/views/data-pipes/list/use-table.ts b/seatunnel-ui/src/views/data-pipes/list/use-table.ts
index 32a3299f..529c7682 100644
--- a/seatunnel-ui/src/views/data-pipes/list/use-table.ts
+++ b/seatunnel-ui/src/views/data-pipes/list/use-table.ts
@@ -59,7 +59,9 @@ export function useTable() {
})
}
},
- row.name
+ {
+ default: () => row.name
+ }
)
}
},
@@ -68,9 +70,17 @@ export function useTable() {
key: 'status',
render: (row: ScriptDetail) => {
if (row.status === 'published') {
- return h(NTag, { type: 'info' }, t('tasks.published'))
+ return h(
+ NTag,
+ { type: 'info' },
+ { default: () => t('tasks.published') }
+ )
} else {
- return h(NTag, { type: 'default' }, t('tasks.unpublished'))
+ return h(
+ NTag,
+ { type: 'default' },
+ { default: () => t('tasks.unpublished') }
+ )
}
}
},
@@ -95,7 +105,9 @@ export function useTable() {
disabled: row.status !== 'published',
onClick: () => handleExecute(row)
},
- t('data_pipes.execute')
+ {
+ default: () => t('data_pipes.execute')
+ }
),
h(
NButton,
@@ -108,7 +120,9 @@ export function useTable() {
})
}
},
- t('data_pipes.edit')
+ {
+ default: () => t('data_pipes.edit')
+ }
),
h(
NButton,
@@ -117,7 +131,7 @@ export function useTable() {
disabled: row.status === 'published',
onClick: () => handlePublish(row)
},
- t('data_pipes.publish')
+ { default: () => t('data_pipes.publish') }
),
h(
NButton,
@@ -126,7 +140,7 @@ export function useTable() {
disabled: row.status === 'published',
onClick: () => handleDelete(row)
},
- t('data_pipes.delete')
+ { default: () => t('data_pipes.delete') }
)
]
})
diff --git a/seatunnel-ui/src/views/jobs/list/use-table.ts b/seatunnel-ui/src/views/jobs/list/use-table.ts
index 72bfd456..1b910d5b 100644
--- a/seatunnel-ui/src/views/jobs/list/use-table.ts
+++ b/seatunnel-ui/src/views/jobs/list/use-table.ts
@@ -67,7 +67,7 @@ export function useTable() {
disabled: row.jobStatus === 'OFFLINE',
onClick: () => handleExecute(row.jobId)
},
- t('jobs.execute')
+ { default: () => t('jobs.execute') }
),
h(
NButton,
@@ -76,7 +76,7 @@ export function useTable() {
disabled: row.jobStatus === 'OFFLINE',
onClick: () => handleRecycle(row.jobId)
},
- t('jobs.recycle')
+ { default: () => t('jobs.recycle') }
)
]
})
diff --git a/seatunnel-ui/src/views/tasks/list/use-table.ts b/seatunnel-ui/src/views/tasks/list/use-table.ts
index 2f4decf4..020312cf 100644
--- a/seatunnel-ui/src/views/tasks/list/use-table.ts
+++ b/seatunnel-ui/src/views/tasks/list/use-table.ts
@@ -53,15 +53,35 @@ export function useTable() {
key: 'status',
render: (row: JobDetail) => {
if (row.status === 'SUCCESS') {
- return h(NTag, { type: 'success' }, t('tasks.success'))
+ return h(
+ NTag,
+ { type: 'success' },
+ { default: () => t('tasks.success') }
+ )
} else if (row.status === 'FAILED') {
- return h(NTag, { type: 'error' }, t('tasks.fail'))
+ return h(
+ NTag,
+ { type: 'error' },
+ { default: () => t('tasks.fail') }
+ )
} else if (row.status === 'STOPPED') {
- return h(NTag, { type: 'warning' }, t('tasks.stop'))
+ return h(
+ NTag,
+ { type: 'warning' },
+ { default: () => t('tasks.stop') }
+ )
} else if (row.status === 'RUNNING') {
- return h(NTag, { type: 'info' }, t('tasks.running'))
+ return h(
+ NTag,
+ { type: 'info' },
+ { default: () => t('tasks.running') }
+ )
} else {
- return h(NTag, { type: 'default' }, t('tasks.unknown'))
+ return h(
+ NTag,
+ { type: 'default' },
+ { default: () => t('tasks.unknown') }
+ )
}
}
},
@@ -90,7 +110,7 @@ export function useTable() {
disabled: row.status === 'RUNNING',
onClick: () => handleRerun(row)
},
- t('tasks.rerun')
+ { default: () => t('tasks.rerun') }
),
h(
NButton,
@@ -99,12 +119,12 @@ export function useTable() {
disabled: row.status !== 'RUNNING',
onClick: () => handleKill(row)
},
- t('tasks.kill')
+ { default: () => t('tasks.kill') }
),
h(
NButton,
{ text: true, onClick: () => handleViewLog(row) },
- t('tasks.view_log')
+ { default: () => t('tasks.view_log') }
)
]
})
diff --git a/seatunnel-ui/src/views/user-manage/list/use-table.ts b/seatunnel-ui/src/views/user-manage/list/use-table.ts
index a1211c3e..bff9f974 100644
--- a/seatunnel-ui/src/views/user-manage/list/use-table.ts
+++ b/seatunnel-ui/src/views/user-manage/list/use-table.ts
@@ -62,19 +62,22 @@ export function useTable() {
h(
NButton,
{ text: true, onClick: () => handleStatus(row) },
- row.status === 1
- ? t('user_manage.enable')
- : t('user_manage.disable')
+ {
+ default: () =>
+ row.status === 1
+ ? t('user_manage.enable')
+ : t('user_manage.disable')
+ }
),
h(
NButton,
{ text: true, onClick: () => handleEdit(row) },
- t('user_manage.edit')
+ { default: () => t('user_manage.edit') }
),
h(
NButton,
{ text: true, onClick: () => handleDelete(row) },
- t('user_manage.delete')
+ { default: () => t('user_manage.delete') }
)
]
})
diff --git a/seatunnel-ui/vite.config.ts b/seatunnel-ui/vite.config.ts
index 48538c9c..237ef0aa 100644
--- a/seatunnel-ui/vite.config.ts
+++ b/seatunnel-ui/vite.config.ts
@@ -36,7 +36,8 @@ export default defineConfig({
],
resolve: {
alias: {
- '@': path.resolve(__dirname, 'src')
+ '@': path.resolve(__dirname, 'src'),
+ 'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
}
},
server: {
@@ -47,4 +48,4 @@ export default defineConfig({
}
}
}
-})
\ No newline at end of file
+})