This is an automated email from the ASF dual-hosted git repository.
songjian 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 38fba60 [Feature][UI Next][V1.0.0-Alpha]Unified processing of
back-end error messages (#8779)
38fba60 is described below
commit 38fba609cbc046c11678bbfc17253cc3f70aa8e9
Author: labbomb <[email protected]>
AuthorDate: Thu Mar 10 12:57:08 2022 +0800
[Feature][UI Next][V1.0.0-Alpha]Unified processing of back-end error
messages (#8779)
* Unified processing of back-end error messages
* Fixed the problem of English and Chinese being unified on the front and
back ends
* Fix the $message mount problem
* Delete messages that are processed separately
* Delete all try catch related operations
---
dolphinscheduler-ui-next/src/service/service.ts | 17 ++-
dolphinscheduler-ui-next/src/utils/index.ts | 4 +-
dolphinscheduler-ui-next/src/utils/log.ts | 64 +++++++++
.../src/views/datasource/list/use-detail.ts | 55 +++-----
.../src/views/datasource/list/use-form.ts | 6 +-
.../src/views/datasource/list/use-table.ts | 30 ++--
dolphinscheduler-ui-next/src/views/login/index.tsx | 7 +-
.../src/views/login/use-translate.ts | 2 +
.../task/components/node/fields/use-child-node.ts | 22 ++-
.../components/node/fields/use-datasource-type.ts | 28 ++--
.../task/components/node/fields/use-datasource.ts | 8 +-
.../task/components/node/fields/use-datax.ts | 12 +-
.../task/components/node/fields/use-dependent.ts | 62 ++++-----
.../components/node/fields/use-environment-name.ts | 28 ++--
.../task/components/node/fields/use-flink.ts | 16 +--
.../projects/task/components/node/fields/use-mr.ts | 16 +--
.../components/node/fields/use-process-name.ts | 22 ++-
.../task/components/node/fields/use-rules.ts | 152 ++++++++++-----------
.../task/components/node/fields/use-sea-tunnel.ts | 14 +-
.../task/components/node/fields/use-shell.ts | 12 +-
.../task/components/node/fields/use-spark.ts | 16 +--
.../task/components/node/fields/use-sql-type.ts | 14 +-
.../task/components/node/fields/use-sql.ts | 12 +-
.../components/node/fields/use-sqoop-datasource.ts | 20 ++-
.../task/components/node/fields/use-switch.ts | 24 ++--
.../task/components/node/fields/use-task-group.ts | 24 ++--
.../components/node/fields/use-worker-group.ts | 10 +-
.../src/views/projects/task/definition/use-task.ts | 52 +++----
.../workflow/components/dag/dag-save-modal.tsx | 3 -
.../components/dag/use-custom-cell-builder.ts | 4 +-
.../workflow/definition/components/use-modal.ts | 54 +++-----
.../workflow/definition/components/use-table.ts | 6 -
.../projects/workflow/definition/create/index.tsx | 3 -
.../projects/workflow/definition/detail/index.tsx | 3 -
.../workflow/definition/timing/use-table.ts | 3 -
.../projects/workflow/definition/use-table.ts | 12 --
.../workflow/instance/components/log-modal.tsx | 10 +-
.../views/projects/workflow/instance/use-table.ts | 16 ---
.../src/views/resource/file/create/use-create.ts | 18 +--
.../src/views/resource/file/edit/use-edit.ts | 20 ++-
.../src/views/resource/file/folder/use-folder.ts | 16 +--
.../src/views/resource/file/rename/use-rename.ts | 20 ++-
.../src/views/resource/file/upload/use-upload.ts | 10 +-
.../resource/udf/function/components/use-modal.ts | 28 ++--
.../resource/udf/resource/components/use-modal.ts | 26 ++--
.../src/views/resource/udf/resource/use-table.ts | 3 -
.../security/alarm-instance-manage/use-detail.ts | 44 +++---
.../security/alarm-instance-manage/use-form.ts | 30 ++--
.../security/alarm-instance-manage/use-table.ts | 49 +++----
49 files changed, 474 insertions(+), 653 deletions(-)
diff --git a/dolphinscheduler-ui-next/src/service/service.ts
b/dolphinscheduler-ui-next/src/service/service.ts
index 3d9ac1e..58d3a5b 100644
--- a/dolphinscheduler-ui-next/src/service/service.ts
+++ b/dolphinscheduler-ui-next/src/service/service.ts
@@ -21,9 +21,23 @@ import qs from 'qs'
import _ from 'lodash'
import cookies from 'js-cookie'
import router from '@/router'
+import utils from '@/utils'
const userStore = useUserStore()
+/**
+ * @description Log and display errors
+ * @param {Error} error Error object
+ */
+ const handleError = (res: AxiosResponse<any, any>) => {
+ // Print to console
+ if (import.meta.env.MODE === 'development') {
+ utils.log.capsule('DolphinScheduler', 'UI-NEXT')
+ utils.log.error(res)
+ }
+ window.$message.error(res.data.msg)
+}
+
const baseRequestConfig: AxiosRequestConfig = {
baseURL:
import.meta.env.MODE === 'development'
@@ -76,7 +90,8 @@ service.interceptors.response.use((res: AxiosResponse) => {
case 0:
return res.data.data
default:
- throw new Error(`${res.data.msg}: ${res.config.url}`)
+ handleError(res)
+ throw new Error()
}
}, err)
diff --git a/dolphinscheduler-ui-next/src/utils/index.ts
b/dolphinscheduler-ui-next/src/utils/index.ts
index c6a02b2..2805529 100644
--- a/dolphinscheduler-ui-next/src/utils/index.ts
+++ b/dolphinscheduler-ui-next/src/utils/index.ts
@@ -18,11 +18,13 @@
import mapping from './mapping'
import regex from './regex'
import truncateText from './truncate-text'
+import log from './log'
const utils = {
mapping,
regex,
- truncateText
+ truncateText,
+ log
}
export default utils
diff --git a/dolphinscheduler-ui-next/src/utils/log.ts
b/dolphinscheduler-ui-next/src/utils/log.ts
new file mode 100644
index 0000000..cb7cc95
--- /dev/null
+++ b/dolphinscheduler-ui-next/src/utils/log.ts
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const log = {
+ capsule: (title: string, text: string, type?: string) => {},
+ error: (info: any) => {}
+}
+
+/**
+ * @description Returns the color value of the style
+ * @param {String} type The style name [ primary | success | warning | error ]
+ */
+const typeColor = (type = 'primary') => {
+ let color = ''
+ switch (type) {
+ case 'primary': color = '#1890ff'; break
+ case 'success': color = '#52c41a'; break
+ case 'warning': color = '#faad14'; break
+ case 'error': color = '#ff4d4f'; break
+ default:; break
+ }
+ return color
+}
+
+/**
+ * @description capsule
+ * @param {String} title title text
+ * @param {String} text info text
+ * @param {String} type style
+ */
+ log.capsule = (title: string, text: string, type: string = 'primary') => {
+ console.log(
+ `%c ${title} %c ${text} %c`,
+ 'background:#35495E; padding: 2px ; border-radius: 3px 0 0 3px; color:
#fff;',
+ `background:${typeColor(type)}; padding: 2px; border-radius: 0 3px 3px 0;
color: #fff;`,
+ 'background:transparent'
+ )
+}
+
+/**
+ * @description Prints text in error style
+ */
+log.error = function (info) {
+ console.group('error info')
+ console.log('responseURL: ', `${info.config.baseURL}${info.config.url}`)
+ console.log('msg: ', info.data.msg)
+ console.groupEnd()
+}
+
+export default log
\ No newline at end of file
diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts
b/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts
index a8d0f33..d58fdd5 100644
--- a/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts
+++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts
@@ -47,33 +47,22 @@ export function useDetail(getFieldsValue: Function) {
const queryById = async (id: number) => {
if (status.loading) return {}
status.loading = true
- try {
- const dataSourceRes = await queryDataSource(id)
- status.loading = false
- PREV_NAME = dataSourceRes.name
- return dataSourceRes
- } catch (e) {
- window.$message.error((e as Error).message)
- status.loading = false
- return {}
- }
+ const dataSourceRes = await queryDataSource(id)
+ status.loading = false
+ PREV_NAME = dataSourceRes.name
+ return dataSourceRes
}
const testConnect = async () => {
if (status.testing) return
status.testing = true
- try {
- const res = await connectDataSource(formatParams())
- window.$message.success(
- res
- ? res.msg
- : `${t('datasource.test_connect')} ${t('datasource.success')}`
- )
- status.testing = false
- } catch (e) {
- window.$message.error((e as Error).message)
- status.testing = false
- }
+ const res = await connectDataSource(formatParams())
+ window.$message.success(
+ res
+ ? res.msg
+ : `${t('datasource.test_connect')} ${t('datasource.success')}`
+ )
+ status.testing = false
}
const createOrUpdate = async (id?: number) => {
@@ -81,22 +70,16 @@ export function useDetail(getFieldsValue: Function) {
if (status.saving || !values.name) return false
status.saving = true
- try {
- if (PREV_NAME !== values.name) {
- await verifyDataSourceName({ name: values.name })
- }
+ if (PREV_NAME !== values.name) {
+ await verifyDataSourceName({ name: values.name })
+ }
- id
- ? await updateDataSource(formatParams(), id)
- : await createDataSource(formatParams())
+ id
+ ? await updateDataSource(formatParams(), id)
+ : await createDataSource(formatParams())
- status.saving = false
- return true
- } catch (e) {
- window.$message.error((e as Error).message)
- status.saving = false
- return false
- }
+ status.saving = false
+ return true
}
return { status, queryById, testConnect, createOrUpdate }
diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts
b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts
index 9ea39ad..575a05a 100644
--- a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts
+++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts
@@ -123,11 +123,7 @@ export function useForm(id?: number) {
state.showConnectType = type === 'ORACLE'
if (type === 'HIVE' || type === 'SPARK') {
- try {
- state.showPrincipal = await getKerberosStartupState()
- } catch (e) {
- window.$message.error((e as Error).message)
- }
+ state.showPrincipal = await getKerberosStartupState()
} else {
state.showPrincipal = false
}
diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts
b/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts
index cc64ddb..e8f5846 100644
--- a/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts
+++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts
@@ -35,20 +35,14 @@ export function useTable() {
if (data.loading) return
data.loading = true
- try {
- const listRes = await queryDataSourceListPaging({
- pageNo: data.page,
- pageSize: data.pageSize,
- searchVal: data.searchVal
- })
- data.loading = false
- data.list = listRes.totalList
- data.itemCount = listRes.total
- } catch (e) {
- window.$message.error((e as Error).message)
- data.loading = false
- data.list = []
- }
+ const listRes = await queryDataSourceListPaging({
+ pageNo: data.page,
+ pageSize: data.pageSize,
+ searchVal: data.searchVal
+ })
+ data.loading = false
+ data.list = listRes.totalList
+ data.itemCount = listRes.total
}
const updateList = () => {
@@ -59,12 +53,8 @@ export function useTable() {
}
const deleteRecord = async (id: number) => {
- try {
- const ignored = await deleteDataSource(id)
- updateList()
- } catch (e) {
- window.$message.error((e as Error).message)
- }
+ const ignored = await deleteDataSource(id)
+ updateList()
}
const changePage = (page: number) => {
diff --git a/dolphinscheduler-ui-next/src/views/login/index.tsx
b/dolphinscheduler-ui-next/src/views/login/index.tsx
index 85c0cae..30e84bb 100644
--- a/dolphinscheduler-ui-next/src/views/login/index.tsx
+++ b/dolphinscheduler-ui-next/src/views/login/index.tsx
@@ -17,16 +17,19 @@
import { defineComponent, toRefs, withKeys } from 'vue'
import styles from './index.module.scss'
-import { NInput, NButton, NSwitch, NForm, NFormItem } from 'naive-ui'
+import { NInput, NButton, NSwitch, NForm, NFormItem, useMessage } from
'naive-ui'
import { useForm } from './use-form'
import { useTranslate } from './use-translate'
import { useLogin } from './use-login'
import { useLocalesStore } from '@/store/locales/locales'
import { useThemeStore } from '@/store/theme/theme'
+import cookies from 'js-cookie'
const login = defineComponent({
name: 'login',
setup() {
+ window.$message = useMessage()
+
const { state, t, locale } = useForm()
const { handleChange } = useTranslate(locale)
const { handleLogin } = useLogin(state)
@@ -37,6 +40,8 @@ const login = defineComponent({
themeStore.setDarkTheme()
}
+ cookies.set('language', localesStore.getLocales, { path: '/' })
+
return { t, handleChange, handleLogin, ...toRefs(state), localesStore }
},
render() {
diff --git a/dolphinscheduler-ui-next/src/views/login/use-translate.ts
b/dolphinscheduler-ui-next/src/views/login/use-translate.ts
index 868e700..a88ba62 100644
--- a/dolphinscheduler-ui-next/src/views/login/use-translate.ts
+++ b/dolphinscheduler-ui-next/src/views/login/use-translate.ts
@@ -18,6 +18,7 @@
import { WritableComputedRef } from 'vue'
import { useLocalesStore } from '@/store/locales/locales'
import type { Locales } from '@/store/locales/types'
+import cookies from 'js-cookie'
export function useTranslate(locale: WritableComputedRef<string>) {
const localesStore = useLocalesStore()
@@ -25,6 +26,7 @@ export function useTranslate(locale:
WritableComputedRef<string>) {
const handleChange = (value: Locales) => {
locale.value = value
localesStore.setLocales(value)
+ cookies.set('language', locale.value, { path: '/' })
}
return {
handleChange
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts
index 130b476..97dbbae 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts
@@ -45,23 +45,17 @@ export function useChildNode({
const getProcessList = async () => {
if (loading.value) return
loading.value = true
- try {
- const res = await querySimpleList(projectCode)
- options.value = res.map((option: { name: string; code: number }) => ({
- label: option.name,
- value: option.code
- }))
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const res = await querySimpleList(projectCode)
+ options.value = res.map((option: { name: string; code: number }) => ({
+ label: option.name,
+ value: option.code
+ }))
+ loading.value = false
}
const getProcessListByCode = async (processCode: number) => {
if (!processCode) return
- try {
- const res = await queryProcessDefinitionByCode(processCode, projectCode)
- getTaskOptions(res)
- } catch (err) {}
+ const res = await queryProcessDefinitionByCode(processCode, projectCode)
+ getTaskOptions(res)
}
const getTaskOptions = (processDefinition: {
processTaskRelationList: []
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts
index 1336802..8f276b4 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts
@@ -86,22 +86,18 @@ export function useDatasourceType(
const getDatasourceTypes = async () => {
if (loading.value) return
loading.value = true
- try {
- options.value = datasourceTypes
- .filter((item) => {
- if (item.disabled) {
- return false
- }
- if (supportedDatasourceType) {
- return indexOf(supportedDatasourceType, item.code) !== -1
- }
- return true
- })
- .map((item) => ({ label: item.code, value: item.code }))
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ options.value = datasourceTypes
+ .filter((item) => {
+ if (item.disabled) {
+ return false
+ }
+ if (supportedDatasourceType) {
+ return indexOf(supportedDatasourceType, item.code) !== -1
+ }
+ return true
+ })
+ .map((item) => ({ label: item.code, value: item.code }))
+ loading.value = false
}
const onChange = (type: string) => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts
index 6ed8ab6..0c9dfed 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts
@@ -35,12 +35,8 @@ export function useDatasource(
const getDatasources = async () => {
if (loading.value) return
loading.value = true
- try {
- await refreshOptions()
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ await refreshOptions()
+ loading.value = false
}
const refreshOptions = async () => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts
index cd18514..9821ad9 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts
@@ -153,14 +153,10 @@ export function useDataX(model: { [field: string]: any
}): IJsonItem[] {
const getDatasourceTypes = async () => {
if (loading.value) return
loading.value = true
- try {
- datasourceTypeOptions.value = datasourceTypes
- .filter((item) => !item.disabled)
- .map((item) => ({ label: item.code, value: item.code }))
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ datasourceTypeOptions.value = datasourceTypes
+ .filter((item) => !item.disabled)
+ .map((item) => ({ label: item.code, value: item.code }))
+ loading.value = false
}
const getDatasourceInstances = async () => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts
index 66f71da..1ff22cb 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts
@@ -157,52 +157,46 @@ export function useDependent(model: { [field: string]:
any }): IJsonItem[] {
}
const getProjectList = async () => {
- try {
- const result = await queryProjectCreatedAndAuthorizedByUser()
- projectList.value = result.map(
- (item: { code: number; name: string }) => ({
- value: item.code,
- label: item.name
- })
- )
- return projectList
- } catch (err) {}
+ const result = await queryProjectCreatedAndAuthorizedByUser()
+ projectList.value = result.map(
+ (item: { code: number; name: string }) => ({
+ value: item.code,
+ label: item.name
+ })
+ )
+ return projectList
}
const getProcessList = async (code: number) => {
if (processCache[code]) {
return processCache[code]
}
- try {
- const result = await queryAllByProjectCode(code)
- const processList = result.map(
- (item: { processDefinition: { code: number; name: string } }) => ({
- value: item.processDefinition.code,
- label: item.processDefinition.name
- })
- )
- processCache[code] = processList
+ const result = await queryAllByProjectCode(code)
+ const processList = result.map(
+ (item: { processDefinition: { code: number; name: string } }) => ({
+ value: item.processDefinition.code,
+ label: item.processDefinition.name
+ })
+ )
+ processCache[code] = processList
- return processList
- } catch (err) {}
+ return processList
}
const getTaskList = async (code: number, processCode: number) => {
if (taskCache[processCode]) {
return taskCache[processCode]
}
- try {
- const result = await getTasksByDefinitionCode(code, processCode)
- const taskList = result.map((item: { code: number; name: string }) => ({
- value: item.code,
- label: item.name
- }))
- taskList.unshift({
- value: 0,
- label: 'ALL'
- })
- taskCache[processCode] = taskList
- return taskList
- } catch (err) {}
+ const result = await getTasksByDefinitionCode(code, processCode)
+ const taskList = result.map((item: { code: number; name: string }) => ({
+ value: item.code,
+ label: item.name
+ }))
+ taskList.unshift({
+ value: 0,
+ label: 'ALL'
+ })
+ taskCache[processCode] = taskList
+ return taskList
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts
index 3cb6523..772079d 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts
@@ -34,22 +34,18 @@ export function useEnvironmentName(
const getEnvironmentList = async () => {
if (loading.value) return
loading.value = true
- try {
- const res = await queryAllEnvironmentList()
- environmentList = res.map(
- (item: { code: string; name: string; workerGroups: string[] }) => ({
- label: item.name,
- value: item.code,
- workerGroups: item.workerGroups
- })
- )
- options.value = environmentList.filter((option: IEnvironmentNameOption)
=>
- filterByWorkerGroup(option)
- )
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const res = await queryAllEnvironmentList()
+ environmentList = res.map(
+ (item: { code: string; name: string; workerGroups: string[] }) => ({
+ label: item.name,
+ value: item.code,
+ workerGroups: item.workerGroups
+ })
+ )
+ options.value = environmentList.filter((option: IEnvironmentNameOption) =>
+ filterByWorkerGroup(option)
+ )
+ loading.value = false
}
const filterByWorkerGroup = (option: IEnvironmentNameOption) => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts
index 1f80b24..bbe160b 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts
@@ -44,15 +44,13 @@ export function useFlink(model: { [field: string]: any }):
IJsonItem[] {
mainJarOptions.value = resources[programType]
return
}
- try {
- const res = await queryResourceByProgramType({
- type: 'FILE',
- programType
- })
- removeUselessChildren(res)
- mainJarOptions.value = res || []
- resources[programType] = res
- } catch (err) {}
+ const res = await queryResourceByProgramType({
+ type: 'FILE',
+ programType
+ })
+ removeUselessChildren(res)
+ mainJarOptions.value = res || []
+ resources[programType] = res
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts
index a13f32e..6831344 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts
@@ -37,15 +37,13 @@ export function useMr(model: { [field: string]: any }):
IJsonItem[] {
mainJarOptions.value = resources[programType]
return
}
- try {
- const res = await queryResourceByProgramType({
- type: 'FILE',
- programType
- })
- removeUselessChildren(res)
- mainJarOptions.value = res || []
- resources[programType] = res
- } catch (err) {}
+ const res = await queryResourceByProgramType({
+ type: 'FILE',
+ programType
+ })
+ removeUselessChildren(res)
+ mainJarOptions.value = res || []
+ resources[programType] = res
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts
index b07e055..8997e5c 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts
@@ -47,23 +47,17 @@ export function useProcessName({
const getProcessList = async () => {
if (loading.value) return
loading.value = true
- try {
- const res = await querySimpleList(projectCode)
- options.value = res.map((option: { name: string; code: number }) => ({
- label: option.name,
- value: option.code
- }))
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const res = await querySimpleList(projectCode)
+ options.value = res.map((option: { name: string; code: number }) => ({
+ label: option.name,
+ value: option.code
+ }))
+ loading.value = false
}
const getProcessListByCode = async (processCode: number) => {
if (!processCode) return
- try {
- const res = await queryProcessDefinitionByCode(processCode, projectCode)
- getTaskOptions(res)
- } catch (err) {}
+ const res = await queryProcessDefinitionByCode(processCode, projectCode)
+ getTaskOptions(res)
}
const getTaskOptions = (processDefinition: {
processTaskRelationList: []
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts
index 51653eb..b7bb88f 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts
@@ -47,38 +47,30 @@ export function useRules(
const getRuleList = async () => {
if (ruleLoading.value) return
ruleLoading.value = true
- try {
- const result = await queryRuleList()
- rules.value = result.map((item: { id: number; name: string }) => {
- let name = ''
- if (item.name) {
- name = item.name.replace('$t(', '').replace(')', '')
- }
- return {
- value: item.id,
- label: name ? t(`project.node.${name}`) : ''
- }
- })
- ruleLoading.value = false
- } catch (err) {
- ruleLoading.value = false
- }
+ const result = await queryRuleList()
+ rules.value = result.map((item: { id: number; name: string }) => {
+ let name = ''
+ if (item.name) {
+ name = item.name.replace('$t(', '').replace(')', '')
+ }
+ return {
+ value: item.id,
+ label: name ? t(`project.node.${name}`) : ''
+ }
+ })
+ ruleLoading.value = false
}
const getRuleById = async (ruleId: number) => {
if (ruleLoading.value) return
ruleLoading.value = true
- try {
- const result = await getRuleFormCreateJson(ruleId)
- const items = JSON.parse(result).map((item: IResponseJsonItem) =>
- formatResponseJson(item)
- )
- updateRules(items, preItemLen)
- preItemLen = items.length
- ruleLoading.value = false
- } catch (err) {
- ruleLoading.value = false
- }
+ const result = await getRuleFormCreateJson(ruleId)
+ const items = JSON.parse(result).map((item: IResponseJsonItem) =>
+ formatResponseJson(item)
+ )
+ updateRules(items, preItemLen)
+ preItemLen = items.length
+ ruleLoading.value = false
}
const formatResponseJson = (
@@ -138,60 +130,58 @@ export function useRules(
}
const onFieldChange = async (value: string | number, field: string) => {
- try {
- if (field === 'src_connector_type' && typeof value === 'number') {
- const result = await getDatasourceOptionsById(value)
- srcDatasourceOptions.value = result || []
- srcTableOptions.value = []
- model.src_datasource_id = null
- model.src_table = null
- model.src_field = null
- return
- }
- if (field === 'target_connector_type' && typeof value === 'number') {
- const result = await getDatasourceOptionsById(value)
- targetDatasourceOptions.value = result || []
- targetTableOptions.value = []
- model.target_datasource_id = null
- model.target_table = null
- model.target_field = null
- return
- }
- if (field === 'writer_connector_type' && typeof value === 'number') {
- const result = await getDatasourceOptionsById(value)
- writerDatasourceOptions.value = result || []
- model.writer_datasource_id = null
- return
- }
- if (field === 'src_datasource_id' && typeof value === 'number') {
- const result = await getDatasourceTablesById(value)
- srcTableOptions.value = result || []
- model.src_table = null
- model.src_field = null
- }
- if (field === 'target_datasource_id' && typeof value === 'number') {
- const result = await getDatasourceTablesById(value)
- targetTableOptions.value = result || []
- model.target_table = null
- model.target_field = null
- }
- if (field === 'src_table' && typeof value === 'string') {
- const result = await getDatasourceTableColumnsById(
- model.src_datasource_id,
- value
- )
- srcTableColumnOptions.value = result || []
- model.src_field = null
- }
- if (field === 'target_table' && typeof value === 'string') {
- const result = await getDatasourceTableColumnsById(
- model.target_datasource_id,
- value
- )
- targetTableColumnOptions.value = result || []
- model.target_field = null
- }
- } catch (err) {}
+ if (field === 'src_connector_type' && typeof value === 'number') {
+ const result = await getDatasourceOptionsById(value)
+ srcDatasourceOptions.value = result || []
+ srcTableOptions.value = []
+ model.src_datasource_id = null
+ model.src_table = null
+ model.src_field = null
+ return
+ }
+ if (field === 'target_connector_type' && typeof value === 'number') {
+ const result = await getDatasourceOptionsById(value)
+ targetDatasourceOptions.value = result || []
+ targetTableOptions.value = []
+ model.target_datasource_id = null
+ model.target_table = null
+ model.target_field = null
+ return
+ }
+ if (field === 'writer_connector_type' && typeof value === 'number') {
+ const result = await getDatasourceOptionsById(value)
+ writerDatasourceOptions.value = result || []
+ model.writer_datasource_id = null
+ return
+ }
+ if (field === 'src_datasource_id' && typeof value === 'number') {
+ const result = await getDatasourceTablesById(value)
+ srcTableOptions.value = result || []
+ model.src_table = null
+ model.src_field = null
+ }
+ if (field === 'target_datasource_id' && typeof value === 'number') {
+ const result = await getDatasourceTablesById(value)
+ targetTableOptions.value = result || []
+ model.target_table = null
+ model.target_field = null
+ }
+ if (field === 'src_table' && typeof value === 'string') {
+ const result = await getDatasourceTableColumnsById(
+ model.src_datasource_id,
+ value
+ )
+ srcTableColumnOptions.value = result || []
+ model.src_field = null
+ }
+ if (field === 'target_table' && typeof value === 'string') {
+ const result = await getDatasourceTableColumnsById(
+ model.target_datasource_id,
+ value
+ )
+ targetTableColumnOptions.value = result || []
+ model.target_field = null
+ }
}
onMounted(async () => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts
index c8dfdb6..b67112c 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts
@@ -55,15 +55,11 @@ export function useSeaTunnel(model: { [field: string]: any
}): IJsonItem[] {
const getResourceList = async () => {
if (loading.value) return
loading.value = true
- try {
- model.resourceFiles = []
- const res = await queryResourceList({ type: 'FILE' })
- removeUselessChildren(res)
- options.value = res || []
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ model.resourceFiles = []
+ const res = await queryResourceList({ type: 'FILE' })
+ removeUselessChildren(res)
+ options.value = res || []
+ loading.value = false
}
function removeUselessChildren(
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts
index c36933b..3b54567 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts
@@ -29,14 +29,10 @@ export function useShell(model: { [field: string]: any }):
IJsonItem[] {
const getResourceList = async () => {
if (loading.value) return
loading.value = true
- try {
- const res = await queryResourceList({ type: 'FILE' })
- removeUselessChildren(res)
- options.value = res || []
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const res = await queryResourceList({ type: 'FILE' })
+ removeUselessChildren(res)
+ options.value = res || []
+ loading.value = false
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts
index c6f87ee..4eddb71 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts
@@ -44,15 +44,13 @@ export function useSpark(model: { [field: string]: any }):
IJsonItem[] {
mainJarOptions.value = resources[programType]
return
}
- try {
- const res = await queryResourceByProgramType({
- type: 'FILE',
- programType
- })
- removeUselessChildren(res)
- mainJarOptions.value = res || []
- resources[programType] = res
- } catch (err) {}
+ const res = await queryResourceByProgramType({
+ type: 'FILE',
+ programType
+ })
+ removeUselessChildren(res)
+ mainJarOptions.value = res || []
+ resources[programType] = res
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts
index c005f9e..e574048 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts
@@ -39,15 +39,11 @@ export function useSqlType(unusedModel: { [field: string]:
any }): IJsonItem {
const getSqlTypes = async () => {
if (loading.value) return
loading.value = true
- try {
- options.value = sqlTypes.map((item) => ({
- label: item.code,
- value: item.id
- }))
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ options.value = sqlTypes.map((item) => ({
+ label: item.code,
+ value: item.id
+ }))
+ loading.value = false
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts
index 21e67af..fc10d08 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts
@@ -28,14 +28,10 @@ export function useSql(model: { [field: string]: any }):
IJsonItem[] {
const getResourceList = async () => {
if (loading.value) return
loading.value = true
- try {
- const res = await queryResourceList({ type: 'FILE' })
- removeUselessChildren(res)
- options.value = res || []
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const res = await queryResourceList({ type: 'FILE' })
+ removeUselessChildren(res)
+ options.value = res || []
+ loading.value = false
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts
index 5904fe3..613a6b6 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts
@@ -33,18 +33,14 @@ export function useDatasource(
const getDataSource = async (type: IDataBase) => {
if (loading.value) return
loading.value = true
- try {
- const result = await queryDataSourceList({ type })
- dataSourceList.value = result.map(
- (item: { name: string; id: number }) => ({
- label: item.name,
- value: item.id
- })
- )
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const result = await queryDataSourceList({ type })
+ dataSourceList.value = result.map(
+ (item: { name: string; id: number }) => ({
+ label: item.name,
+ value: item.id
+ })
+ )
+ loading.value = false
}
onMounted(() => {
getDataSource('MYSQL')
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts
index a58b8bc..d65d77a 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts
@@ -32,20 +32,16 @@ export function useSwitch(
if (loading.value) return
loading.value = true
branchFlowOptions.value = []
- try {
- const res = await queryProcessDefinitionByCode(
- model.processName,
- projectCode
- )
- res?.taskDefinitionList.forEach((item: any) => {
- if (item.code != model.code) {
- branchFlowOptions.value.push({ label: item.name, value: item.code })
- }
- })
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const res = await queryProcessDefinitionByCode(
+ model.processName,
+ projectCode
+ )
+ res?.taskDefinitionList.forEach((item: any) => {
+ if (item.code != model.code) {
+ branchFlowOptions.value.push({ label: item.name, value: item.code })
+ }
+ })
+ loading.value = false
}
watch(
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts
index 7f607bf..f22dba5 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts
@@ -33,20 +33,16 @@ export function useTaskGroup(
const getTaskGroupList = async () => {
if (loading.value) return
loading.value = true
- try {
- const { totalList = [] } = await queryTaskGroupListPagingByProjectCode({
- pageNo: 1,
- pageSize: 2147483647,
- projectCode
- })
- options.value = totalList.map((item: { id: string; name: string }) => ({
- label: item.name,
- value: item.id
- }))
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const { totalList = [] } = await queryTaskGroupListPagingByProjectCode({
+ pageNo: 1,
+ pageSize: 2147483647,
+ projectCode
+ })
+ options.value = totalList.map((item: { id: string; name: string }) => ({
+ label: item.name,
+ value: item.id
+ }))
+ loading.value = false
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts
index b37152a..d06e8b7 100644
---
a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts
@@ -29,13 +29,9 @@ export function useWorkerGroup(): IJsonItem {
const getWorkerGroups = async () => {
if (loading.value) return
loading.value = true
- try {
- const res = await queryAllWorkerGroups()
- options.value = res.map((item: string) => ({ label: item, value: item }))
- loading.value = false
- } catch (err) {
- loading.value = false
- }
+ const res = await queryAllWorkerGroups()
+ options.value = res.map((item: string) => ({ label: item, value: item }))
+ loading.value = false
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts
b/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts
index 69e64ca..9b8e537 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts
@@ -60,42 +60,32 @@ export function useTask(projectCode: number) {
task.taskShow = show
}
const onTaskSave = async (data: INodeData) => {
- try {
- if (task.taskSaving) return
- task.taskSaving = true
- if (data.id) {
- data.code &&
- (await updateWithUpstream(
- projectCode,
- data.code,
- formatParams({ ...data, code: data.code }, false)
- ))
- } else {
- const taskCode = await getTaskCode()
- await saveSingle(
+ if (task.taskSaving) return
+ task.taskSaving = true
+ if (data.id) {
+ data.code &&
+ (await updateWithUpstream(
projectCode,
- formatParams({ ...data, code: taskCode }, true)
- )
- }
-
- task.taskSaving = false
- return true
- } catch (e) {
- window.$message.error((e as Error).message)
- task.taskSaving = false
- return false
+ data.code,
+ formatParams({ ...data, code: data.code }, false)
+ ))
+ } else {
+ const taskCode = await getTaskCode()
+ await saveSingle(
+ projectCode,
+ formatParams({ ...data, code: taskCode }, true)
+ )
}
+
+ task.taskSaving = false
+ return true
}
const onEditTask = async (row: IRecord, readonly: boolean) => {
- try {
- const result = await queryTaskDefinitionByCode(row.taskCode, projectCode)
- task.taskData = { ...result, processName: row.processDefinitionCode }
- task.taskShow = true
- task.taskReadonly = readonly
- } catch (e) {
- window.$message.error((e as Error).message)
- }
+ const result = await queryTaskDefinitionByCode(row.taskCode, projectCode)
+ task.taskData = { ...result, processName: row.processDefinitionCode }
+ task.taskShow = true
+ task.taskReadonly = readonly
}
const onInitTask = () => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
index 8c83650..b25ad7f 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
@@ -133,9 +133,6 @@ export default defineComponent({
) {
verifyName(params, projectCode)
.then(() => context.emit('save', formValue.value))
- .catch((error: any) => {
- window.$message.error(error.message)
- })
} else {
context.emit('save', formValue.value)
}
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts
index d040993..db5c1bc 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts
@@ -29,9 +29,7 @@ export function useCustomCellBuilder() {
function parseLocationStr(locationStr: string) {
let locations = null
if (!locationStr) return locations
- try {
- locations = JSON.parse(locationStr)
- } catch (error) {}
+ locations = JSON.parse(locationStr)
return Array.isArray(locations) ? locations : null
}
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts
index 750319d..8238a3a 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts
@@ -61,18 +61,14 @@ export function useModal(
const handleImportDefinition = () => {
state.importFormRef.validate(async (valid: any) => {
if (!valid) {
- try {
- const formData = new FormData()
- formData.append('file', state.importForm.file)
- const code = Number(router.currentRoute.value.params.projectCode)
- await importProcessDefinition(formData, code)
- window.$message.success(t('project.workflow.success'))
- ctx.emit('updateList')
- ctx.emit('update:show')
- resetImportForm()
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ const formData = new FormData()
+ formData.append('file', state.importForm.file)
+ const code = Number(router.currentRoute.value.params.projectCode)
+ await importProcessDefinition(formData, code)
+ window.$message.success(t('project.workflow.success'))
+ ctx.emit('updateList')
+ ctx.emit('update:show')
+ resetImportForm()
}
})
}
@@ -103,14 +99,10 @@ export function useModal(
? JSON.stringify(startParams)
: ''
- try {
await startProcessInstance(state.startForm, variables.projectCode)
window.$message.success(t('project.workflow.success'))
ctx.emit('updateList')
ctx.emit('update:show')
- } catch (error: any) {
- window.$message.error(error.message)
- }
}
})
}
@@ -121,14 +113,10 @@ export function useModal(
const data: any = getTimingData()
data.processDefinitionCode = code
- try {
- await createSchedule(data, variables.projectCode)
- window.$message.success(t('project.workflow.success'))
- ctx.emit('updateList')
- ctx.emit('update:show')
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ await createSchedule(data, variables.projectCode)
+ window.$message.success(t('project.workflow.success'))
+ ctx.emit('updateList')
+ ctx.emit('update:show')
}
})
}
@@ -139,14 +127,10 @@ export function useModal(
const data: any = getTimingData()
data.id = id
- try {
- await updateSchedule(data, variables.projectCode, id)
- window.$message.success(t('project.workflow.success'))
- ctx.emit('updateList')
- ctx.emit('update:show')
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ await updateSchedule(data, variables.projectCode, id)
+ window.$message.success(t('project.workflow.success'))
+ ctx.emit('updateList')
+ ctx.emit('update:show')
}
})
}
@@ -214,9 +198,6 @@ export function useModal(
.then((res: any) => {
variables.startParamsList = res.processDefinition.globalParamList
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
const getPreviewSchedule = () => {
@@ -242,9 +223,6 @@ export function useModal(
.then((res: any) => {
variables.schedulePreviewList = res
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
})
}
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts
index 2f1b0d9..027c911 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts
@@ -178,9 +178,6 @@ export function useTable(
ctx.emit('updateList')
getTableData(variables.row)
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
const handleDeleteVersion = (version: number) => {
@@ -190,9 +187,6 @@ export function useTable(
ctx.emit('updateList')
getTableData(variables.row)
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
return {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
index 90974a9..4384606 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
@@ -80,9 +80,6 @@ export default defineComponent({
message.success(t('project.dag.success'))
router.push({ path: `/projects/${projectCode}/workflow-definition` })
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
return () => (
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
index d80a26a..2e19ead 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
@@ -99,9 +99,6 @@ export default defineComponent({
message.success(t('project.dag.success'))
router.push({ path: `/projects/${projectCode}/workflow-definition` })
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
onMounted(() => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
index 6761547..4c4b2d0 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
@@ -262,9 +262,6 @@ export function useTable() {
searchVal: variables.searchVal
})
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
return {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts
index 956687d..547381b 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts
@@ -200,9 +200,6 @@ export function useTable() {
searchVal: variables.searchVal
})
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
const releaseWorkflow = (row: any) => {
@@ -221,9 +218,6 @@ export function useTable() {
searchVal: variables.searchVal
})
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
const copyWorkflow = (row: any) => {
@@ -240,9 +234,6 @@ export function useTable() {
searchVal: variables.searchVal
})
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
const downloadBlob = (data: any, fileNameS = 'json') => {
@@ -280,9 +271,6 @@ export function useTable() {
.then((res: any) => {
downloadBlob(res, fileName)
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
const gotoTimingManage = (row: any) => {
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx
b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx
index 68119ed..1b328ac 100644
---
a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx
+++
b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx
@@ -96,10 +96,6 @@ export default defineComponent({
}, 1500)
textareaLog.value.innerHTML = res || t('project.workflow.no_log')
})
- .catch((error: any) => {
- window.$message.error(error.message || '')
- loadingRef.value = false
- })
}
const showLog = () => {
@@ -126,9 +122,6 @@ export default defineComponent({
}, 800)
}
})
- .catch((error: any) => {
- window.$message.error(error.message || '')
- })
}
const initLog = () => {
@@ -259,7 +252,7 @@ export default defineComponent({
render() {
return (
<div>
- <span class={styles['log-model']}>
+ <span>
{this.taskInstanceId && this.taskInstanceType !== 'SUB_PROCESS' && (
<span>
{renderSlot(this.$slots, 'history')}
@@ -349,7 +342,6 @@ export default defineComponent({
<div class={styles['content']} ref='logContent'>
<div class={styles['content-log-box']} ref='logContentBox'>
<textarea
- class={styles['textarea-ft']}
style={`width: 100%; height: ${this.textareaHeight}px`}
spellcheck='false'
ref='textareaLog'
diff --git
a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/use-table.ts
b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/use-table.ts
index 98c7213..cd6616a 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/use-table.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/use-table.ts
@@ -285,10 +285,6 @@ export function useTable() {
getTableData()
})
- .catch((error: any) => {
- window.$message.error(error.message || '')
- getTableData()
- })
}
const batchDeleteInstance = () => {
@@ -310,10 +306,6 @@ export function useTable() {
variables.checkedRowKeys = []
getTableData()
})
- .catch((error: any) => {
- window.$message.error(error.message || '')
- getTableData()
- })
}
/**
@@ -326,10 +318,6 @@ export function useTable() {
getTableData()
})
- .catch((error: any) => {
- window.$message.error(error.message || '')
- getTableData()
- })
}
/**
@@ -368,10 +356,6 @@ export function useTable() {
getTableData()
}, index)
})
- .catch((error: any) => {
- window.$message.error(error.message)
- getTableData()
- })
}
return {
diff --git
a/dolphinscheduler-ui-next/src/views/resource/file/create/use-create.ts
b/dolphinscheduler-ui-next/src/views/resource/file/create/use-create.ts
index c05d2c0..c080f94 100644
--- a/dolphinscheduler-ui-next/src/views/resource/file/create/use-create.ts
+++ b/dolphinscheduler-ui-next/src/views/resource/file/create/use-create.ts
@@ -31,18 +31,14 @@ export function useCreate(state: any) {
const currentDir = fileStore.getCurrentDir || '/'
state.fileFormRef.validate(async (valid: any) => {
if (!valid) {
- try {
- await onlineCreateResource({
- ...state.fileForm,
- ...{ pid, currentDir }
- })
+ await onlineCreateResource({
+ ...state.fileForm,
+ ...{ pid, currentDir }
+ })
- window.$message.success(t('resource.file.success'))
- const name = pid ? 'resource-file-subdirectory' : 'file'
- router.push({ name, params: { id: pid } })
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ window.$message.success(t('resource.file.success'))
+ const name = pid ? 'resource-file-subdirectory' : 'file'
+ router.push({ name, params: { id: pid } })
}
})
}
diff --git a/dolphinscheduler-ui-next/src/views/resource/file/edit/use-edit.ts
b/dolphinscheduler-ui-next/src/views/resource/file/edit/use-edit.ts
index 1a2e2ed..7dac246 100644
--- a/dolphinscheduler-ui-next/src/views/resource/file/edit/use-edit.ts
+++ b/dolphinscheduler-ui-next/src/views/resource/file/edit/use-edit.ts
@@ -43,19 +43,15 @@ export function useEdit(state: any) {
const handleUpdateContent = (id: number) => {
state.fileFormRef.validate(async (valid: any) => {
if (!valid) {
- try {
- await updateResourceContent(
- {
- ...state.fileForm
- },
- id
- )
+ await updateResourceContent(
+ {
+ ...state.fileForm
+ },
+ id
+ )
- window.$message.success(t('resource.file.success'))
- router.go(-1)
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ window.$message.success(t('resource.file.success'))
+ router.go(-1)
}
})
}
diff --git
a/dolphinscheduler-ui-next/src/views/resource/file/folder/use-folder.ts
b/dolphinscheduler-ui-next/src/views/resource/file/folder/use-folder.ts
index 919e839..39d7402 100644
--- a/dolphinscheduler-ui-next/src/views/resource/file/folder/use-folder.ts
+++ b/dolphinscheduler-ui-next/src/views/resource/file/folder/use-folder.ts
@@ -36,17 +36,13 @@ export function useFolder(state: any) {
const currentDir = fileStore.getCurrentDir || '/'
state.folderFormRef.validate(async (valid: any) => {
if (!valid) {
- try {
- await createDirectory({
- ...state.folderForm,
- ...{ pid, currentDir }
- })
+ await createDirectory({
+ ...state.folderForm,
+ ...{ pid, currentDir }
+ })
- window.$message.success(t('resource.file.success'))
- emit('updateList')
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ window.$message.success(t('resource.file.success'))
+ emit('updateList')
hideModal()
resetForm()
}
diff --git
a/dolphinscheduler-ui-next/src/views/resource/file/rename/use-rename.ts
b/dolphinscheduler-ui-next/src/views/resource/file/rename/use-rename.ts
index f004b66..9251a7d 100644
--- a/dolphinscheduler-ui-next/src/views/resource/file/rename/use-rename.ts
+++ b/dolphinscheduler-ui-next/src/views/resource/file/rename/use-rename.ts
@@ -29,18 +29,14 @@ export function useRename(state: any) {
) => {
state.renameFormRef.validate(async (valid: any) => {
if (!valid) {
- try {
- await updateResource(
- {
- ...state.renameForm
- },
- state.renameForm.id
- )
- window.$message.success(t('resource.file.success'))
- emit('updateList')
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ await updateResource(
+ {
+ ...state.renameForm
+ },
+ state.renameForm.id
+ )
+ window.$message.success(t('resource.file.success'))
+ emit('updateList')
}
hideModal()
diff --git
a/dolphinscheduler-ui-next/src/views/resource/file/upload/use-upload.ts
b/dolphinscheduler-ui-next/src/views/resource/file/upload/use-upload.ts
index 110df69..dd67ca6 100644
--- a/dolphinscheduler-ui-next/src/views/resource/file/upload/use-upload.ts
+++ b/dolphinscheduler-ui-next/src/views/resource/file/upload/use-upload.ts
@@ -44,13 +44,9 @@ export function useUpload(state: any) {
formData.append('currentDir', currentDir)
formData.append('description', state.uploadForm.description)
- try {
- await createResource(formData as any)
- window.$message.success(t('resource.file.success'))
- emit('updateList')
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ await createResource(formData as any)
+ window.$message.success(t('resource.file.success'))
+ emit('updateList')
hideModal()
resetForm()
diff --git
a/dolphinscheduler-ui-next/src/views/resource/udf/function/components/use-modal.ts
b/dolphinscheduler-ui-next/src/views/resource/udf/function/components/use-modal.ts
index b7609d4..0c8ff8f 100644
---
a/dolphinscheduler-ui-next/src/views/resource/udf/function/components/use-modal.ts
+++
b/dolphinscheduler-ui-next/src/views/resource/udf/function/components/use-modal.ts
@@ -61,14 +61,10 @@ export function useModal(
const submitRequest = (serviceHandle: any) => {
state.functionFormRef.validate(async (valid: any) => {
if (!valid) {
- try {
- await serviceHandle()
- window.$message.success(t('resource.udf.success'))
- ctx.emit('updateList')
- ctx.emit('update:show')
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ await serviceHandle()
+ window.$message.success(t('resource.udf.success'))
+ ctx.emit('updateList')
+ ctx.emit('update:show')
}
})
}
@@ -160,16 +156,12 @@ export function useModal(
formData.append('currentDir', uploadState.uploadForm.currentDir)
formData.append('description', uploadState.uploadForm.description)
- try {
- const res = await createResource(formData as any)
- window.$message.success(t('resource.function.success'))
- variables.uploadShow = false
- resetUploadForm()
- getUdfList()
- state.functionForm.resourceId = res.id
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ const res = await createResource(formData as any)
+ window.$message.success(t('resource.function.success'))
+ variables.uploadShow = false
+ resetUploadForm()
+ getUdfList()
+ state.functionForm.resourceId = res.id
}
})
}
diff --git
a/dolphinscheduler-ui-next/src/views/resource/udf/resource/components/use-modal.ts
b/dolphinscheduler-ui-next/src/views/resource/udf/resource/components/use-modal.ts
index c9210bd..cd72101 100644
---
a/dolphinscheduler-ui-next/src/views/resource/udf/resource/components/use-modal.ts
+++
b/dolphinscheduler-ui-next/src/views/resource/udf/resource/components/use-modal.ts
@@ -62,14 +62,10 @@ export function useModal(
const submitRequest = (serviceHandle: any) => {
state.folderFormRef.validate(async (valid: any) => {
if (!valid) {
- try {
- await serviceHandle()
- window.$message.success(t('resource.udf.success'))
- ctx.emit('updateList')
- ctx.emit('update:show')
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ await serviceHandle()
+ window.$message.success(t('resource.udf.success'))
+ ctx.emit('updateList')
+ ctx.emit('update:show')
}
})
}
@@ -93,15 +89,11 @@ export function useModal(
formData.append('currentDir', currentDir)
formData.append('description', state.uploadForm.description)
- try {
- await createResource(formData as any)
- window.$message.success(t('resource.udf.success'))
- ctx.emit('updateList')
- ctx.emit('update:show')
- resetUploadForm()
- } catch (error: any) {
- window.$message.error(error.message)
- }
+ await createResource(formData as any)
+ window.$message.success(t('resource.udf.success'))
+ ctx.emit('updateList')
+ ctx.emit('update:show')
+ resetUploadForm()
}
})
}
diff --git
a/dolphinscheduler-ui-next/src/views/resource/udf/resource/use-table.ts
b/dolphinscheduler-ui-next/src/views/resource/udf/resource/use-table.ts
index fa1e6b6..164694e 100644
--- a/dolphinscheduler-ui-next/src/views/resource/udf/resource/use-table.ts
+++ b/dolphinscheduler-ui-next/src/views/resource/udf/resource/use-table.ts
@@ -270,9 +270,6 @@ export function useTable() {
fileStore.setCurrentDir(res.fullName)
router.push({ name: 'resource-sub-manage', params: { id: res.id } })
})
- .catch((error: any) => {
- window.$message.error(error.message)
- })
}
return {
diff --git
a/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-detail.ts
b/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-detail.ts
index a42ca95..01a5e5f 100644
---
a/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-detail.ts
+++
b/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-detail.ts
@@ -45,35 +45,29 @@ export function useDetail(getFormValues: Function) {
const values = getFormValues()
if (status.saving) return false
status.saving = true
- try {
- if (currentRecord?.instanceName !== values.instanceName) {
- await verifyAlertInstanceName({
- alertInstanceName: values.instanceName
- })
- }
+ if (currentRecord?.instanceName !== values.instanceName) {
+ await verifyAlertInstanceName({
+ alertInstanceName: values.instanceName
+ })
+ }
- currentRecord?.id
- ? await updateAlertPluginInstance(
- {
- alertPluginInstanceId: values.pluginDefineId,
- instanceName: values.instanceName,
- pluginInstanceParams: formatParams(json, values)
- },
- currentRecord.id
- )
- : await createAlertPluginInstance({
+ currentRecord?.id
+ ? await updateAlertPluginInstance(
+ {
+ alertPluginInstanceId: values.pluginDefineId,
instanceName: values.instanceName,
- pluginDefineId: values.pluginDefineId,
pluginInstanceParams: formatParams(json, values)
- })
+ },
+ currentRecord.id
+ )
+ : await createAlertPluginInstance({
+ instanceName: values.instanceName,
+ pluginDefineId: values.pluginDefineId,
+ pluginInstanceParams: formatParams(json, values)
+ })
- status.saving = false
- return true
- } catch (e) {
- window.$message.error((e as Error).message)
- status.saving = false
- return false
- }
+ status.saving = false
+ return true
}
return { status, createOrUpdate }
diff --git
a/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-form.ts
b/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-form.ts
index 956f302..e8a75bf 100644
---
a/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-form.ts
+++
b/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-form.ts
@@ -72,33 +72,23 @@ export function useForm() {
const getUiPluginsByType = async () => {
if (state.pluginsLoading) return
state.pluginsLoading = true
- try {
- const plugins = await queryUiPluginsByType({ pluginType: 'ALERT' })
- state.uiPlugins = plugins.map((plugin: IPlugin) => ({
- label: plugin.pluginName,
- value: plugin.id
- }))
- state.pluginsLoading = false
- } catch (err) {
- state.uiPlugins = []
- state.pluginsLoading = false
- }
+ const plugins = await queryUiPluginsByType({ pluginType: 'ALERT' })
+ state.uiPlugins = plugins.map((plugin: IPlugin) => ({
+ label: plugin.pluginName,
+ value: plugin.id
+ }))
+ state.pluginsLoading = false
}
const changePlugin = async (pluginId: IPluginId) => {
if (state.pluginsLoading) return
state.pluginsLoading = true
state.detailForm.pluginDefineId = pluginId
- try {
- const { pluginParams } = await queryUiPluginDetailById(pluginId)
- if (pluginParams) {
- state.json = JSON.parse(pluginParams)
- }
- state.pluginsLoading = false
- } catch (e) {
- window.$message.error((e as Error).message)
- state.pluginsLoading = false
+ const { pluginParams } = await queryUiPluginDetailById(pluginId)
+ if (pluginParams) {
+ state.json = JSON.parse(pluginParams)
}
+ state.pluginsLoading = false
}
const initForm = () => {
diff --git
a/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts
b/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts
index d088460..70a6ea8 100644
---
a/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts
+++
b/dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts
@@ -38,31 +38,24 @@ export function useTable() {
if (data.loading) return
data.loading = true
- try {
- const { totalList, total } = await queryAlertPluginInstanceListPaging({
- pageNo: data.page,
- pageSize: data.pageSize,
- searchVal: data.searchVal
- })
- data.loading = false
- if (!totalList) throw Error()
- data.list = totalList.map((record: IRecord) => {
- record.createTime = record.createTime
- ? format(parseTime(record.createTime), 'yyyy-MM-dd HH:mm:ss')
- : ''
- record.updateTime = record.updateTime
- ? format(parseTime(record.updateTime), 'yyyy-MM-dd HH:mm:ss')
- : ''
- return record
- })
+ const { totalList, total } = await queryAlertPluginInstanceListPaging({
+ pageNo: data.page,
+ pageSize: data.pageSize,
+ searchVal: data.searchVal
+ })
+ data.loading = false
+ if (!totalList) throw Error()
+ data.list = totalList.map((record: IRecord) => {
+ record.createTime = record.createTime
+ ? format(parseTime(record.createTime), 'yyyy-MM-dd HH:mm:ss')
+ : ''
+ record.updateTime = record.updateTime
+ ? format(parseTime(record.updateTime), 'yyyy-MM-dd HH:mm:ss')
+ : ''
+ return record
+ })
- data.itemCount = total
- } catch (e) {
- if ((e as Error).message) window.$message.error((e as Error).message)
- data.loading = false
- data.list = []
- data.itemCount = 0
- }
+ data.itemCount = total
}
const updateList = () => {
@@ -73,12 +66,8 @@ export function useTable() {
}
const deleteRecord = async (id: number) => {
- try {
- const ignored = await deleteAlertPluginInstance(id)
- updateList()
- } catch (e) {
- window.$message.error((e as Error).message)
- }
+ const ignored = await deleteAlertPluginInstance(id)
+ updateList()
}
const changePage = (page: number) => {