Browse Source

[CI][UI Next][V1.0.0-Alpha] Add frontend UI to CI checks and fix the linting problems found (#8666)

3.0.0/version-upgrade
kezhenxu94 3 years ago committed by GitHub
parent
commit
60a00490c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .github/workflows/frontend.yml
  2. 11
      dolphinscheduler-ui-next/.eslintrc.js
  3. 2
      dolphinscheduler-ui-next/src/components/form/fields/custom-parameters.ts
  4. 4
      dolphinscheduler-ui-next/src/components/form/fields/multi-condition.ts
  5. 2
      dolphinscheduler-ui-next/src/components/form/fields/multi-input.ts
  6. 12
      dolphinscheduler-ui-next/src/components/form/get-elements-by-json.ts
  7. 2
      dolphinscheduler-ui-next/src/components/form/use-form.ts
  8. 2
      dolphinscheduler-ui-next/src/layouts/content/components/sidebar/use-menuClick.ts
  9. 2
      dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts
  10. 40
      dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
  11. 2
      dolphinscheduler-ui-next/src/service/modules/lineages/index.ts
  12. 2
      dolphinscheduler-ui-next/src/service/modules/process-definition/index.ts
  13. 6
      dolphinscheduler-ui-next/src/service/modules/resources/index.ts
  14. 2
      dolphinscheduler-ui-next/src/service/modules/schedules/index.ts
  15. 2
      dolphinscheduler-ui-next/src/service/modules/task-instances/index.ts
  16. 2
      dolphinscheduler-ui-next/src/service/modules/token/index.ts
  17. 4
      dolphinscheduler-ui-next/src/utils/truncate-text.ts
  18. 2
      dolphinscheduler-ui-next/src/views/data-quality/rule/components/rule-modal.tsx
  19. 2
      dolphinscheduler-ui-next/src/views/data-quality/rule/index.tsx
  20. 6
      dolphinscheduler-ui-next/src/views/data-quality/rule/use-table.ts
  21. 2
      dolphinscheduler-ui-next/src/views/data-quality/task-result/use-table.ts
  22. 2
      dolphinscheduler-ui-next/src/views/datasource/list/json-highlight.tsx
  23. 3
      dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts
  24. 2
      dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts
  25. 2
      dolphinscheduler-ui-next/src/views/home/use-table.ts
  26. 2
      dolphinscheduler-ui-next/src/views/home/use-task-state.ts
  27. 4
      dolphinscheduler-ui-next/src/views/monitor/servers/worker/index.tsx
  28. 2
      dolphinscheduler-ui-next/src/views/monitor/statistics/audit-log/use-table.ts
  29. 10
      dolphinscheduler-ui-next/src/views/projects/list/use-table.ts
  30. 2
      dolphinscheduler-ui-next/src/views/projects/overview/use-process-state.ts
  31. 2
      dolphinscheduler-ui-next/src/views/projects/overview/use-task-state.ts
  32. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts
  33. 6
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts
  34. 11
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts
  35. 6
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts
  36. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts
  37. 1
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts
  38. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts
  39. 4
      dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts
  40. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-conditions.ts
  41. 3
      dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-procedure.ts
  42. 2
      dolphinscheduler-ui-next/src/views/projects/task/definition/components/use-move.ts
  43. 2
      dolphinscheduler-ui-next/src/views/projects/task/definition/components/use-version.ts
  44. 2
      dolphinscheduler-ui-next/src/views/projects/task/definition/components/version-modal.tsx
  45. 18
      dolphinscheduler-ui-next/src/views/projects/task/definition/use-table.ts
  46. 2
      dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts
  47. 2
      dolphinscheduler-ui-next/src/views/projects/task/instance/components/log-modal.tsx
  48. 16
      dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts
  49. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-auto-layout-modal.tsx
  50. 1
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-cell-update.ts
  51. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts
  52. 1
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts
  53. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-text-copy.ts
  54. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
  55. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
  56. 2
      dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx
  57. 4
      dolphinscheduler-ui-next/src/views/projects/workflow/relation/components/Graph.tsx
  58. 1
      dolphinscheduler-ui-next/src/views/projects/workflow/relation/use-relation.ts
  59. 15
      dolphinscheduler-ui-next/src/views/resource/task-group/option/components/form-modal.tsx
  60. 4
      dolphinscheduler-ui-next/src/views/resource/task-group/option/index.tsx
  61. 22
      dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts
  62. 12
      dolphinscheduler-ui-next/src/views/resource/task-group/queue/components/form-modal.tsx
  63. 1
      dolphinscheduler-ui-next/src/views/resource/task-group/queue/components/table-action.tsx
  64. 13
      dolphinscheduler-ui-next/src/views/resource/task-group/queue/index.tsx
  65. 3
      dolphinscheduler-ui-next/src/views/resource/task-group/queue/use-form.ts
  66. 12
      dolphinscheduler-ui-next/src/views/resource/task-group/queue/use-table.ts
  67. 10
      dolphinscheduler-ui-next/src/views/security/alarm-group-manage/use-table.ts
  68. 2
      dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-columns.ts
  69. 2
      dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts
  70. 10
      dolphinscheduler-ui-next/src/views/security/environment-manage/use-table.ts
  71. 6
      dolphinscheduler-ui-next/src/views/security/k8s-namespace-manage/components/use-modal.ts
  72. 10
      dolphinscheduler-ui-next/src/views/security/k8s-namespace-manage/use-table.ts
  73. 2
      dolphinscheduler-ui-next/src/views/security/tenant-manage/components/tenant-modal.tsx
  74. 8
      dolphinscheduler-ui-next/src/views/security/tenant-manage/components/use-modalData.ts
  75. 10
      dolphinscheduler-ui-next/src/views/security/tenant-manage/use-table.ts
  76. 2
      dolphinscheduler-ui-next/src/views/security/token-manage/components/use-modal.ts
  77. 15
      dolphinscheduler-ui-next/src/views/security/token-manage/use-table.ts
  78. 4
      dolphinscheduler-ui-next/src/views/security/user-manage/use-table.tsx
  79. 10
      dolphinscheduler-ui-next/src/views/security/worker-group-manage/use-table.ts
  80. 2
      dolphinscheduler-ui-next/src/views/security/yarn-queue-manage/components/use-modal.ts
  81. 5
      dolphinscheduler-ui-next/src/views/security/yarn-queue-manage/use-table.ts

1
.github/workflows/frontend.yml

@ -57,7 +57,6 @@ jobs:
node-version: 8 node-version: 8
- name: Compile and Build - name: Compile and Build
run: | run: |
npm install node-sass --unsafe-perm
npm install npm install
npm run lint npm run lint
npm run build npm run build

11
dolphinscheduler-ui-next/.eslintrc.js

@ -48,15 +48,15 @@ module.exports = {
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': [
'error', 'error',
{ {
argsIgnorePattern: '^h$', argsIgnorePattern: '^(unused|ignored).*$',
varsIgnorePattern: '^h$' varsIgnorePattern: '^(unused|ignored).*$'
} }
], ],
'no-unused-vars': [ 'no-unused-vars': [
'error', 'error',
{ {
argsIgnorePattern: '^h$', argsIgnorePattern: '^(unused|ignored).*$',
varsIgnorePattern: '^h$' varsIgnorePattern: '^(unused|ignored).*$'
} }
], ],
'space-before-function-paren': 'off', 'space-before-function-paren': 'off',
@ -65,6 +65,7 @@ module.exports = {
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'vue/component-definition-name-casing': 'off', 'vue/component-definition-name-casing': 'off',
'vue/require-valid-default-prop': 'off', 'vue/require-valid-default-prop': 'off',
'no-console': 'error' 'no-console': 'error',
'vue/no-setup-props-destructure': 'off',
} }
} }

2
dolphinscheduler-ui-next/src/components/form/fields/custom-parameters.ts

@ -103,7 +103,7 @@ export function renderCustomParameters(
const { field, children = [] } = mergedItem const { field, children = [] } = mergedItem
const { defaultValue, ruleItem } = getDefaultValue(children) const { defaultValue, ruleItem } = getDefaultValue(children)
rules.push(ruleItem) rules.push(ruleItem)
const getChild = (item: object, i: number, disabled: boolean) => const getChild = (item: object, i: number, unused: boolean) =>
children.map((child: IJsonItem) => { children.map((child: IJsonItem) => {
const mergedChild = isFunction(child) ? child(i) : child const mergedChild = isFunction(child) ? child(i) : child
return h( return h(

4
dolphinscheduler-ui-next/src/components/form/fields/multi-condition.ts

@ -66,9 +66,9 @@ const MultiCondition = defineComponent({
export function renderMultiCondition( export function renderMultiCondition(
item: IJsonItem, item: IJsonItem,
fields: { [field: string]: any }, fields: { [field: string]: any },
rules: { [key: string]: FormItemRule }[] unused: { [key: string]: FormItemRule }[]
) { ) {
let ruleItem: { [key: string]: FormItemRule } = {} const ruleItem: { [key: string]: FormItemRule } = {}
// the fields is the data of the task definition. // the fields is the data of the task definition.
// the item is the options of this component in the form. // the item is the options of this component in the form.

2
dolphinscheduler-ui-next/src/components/form/fields/multi-input.ts

@ -71,7 +71,7 @@ const MultiInput = defineComponent({
export function renderMultiInput( export function renderMultiInput(
item: IJsonItem, item: IJsonItem,
fields: { [field: string]: any }, fields: { [field: string]: any },
rules: { [key: string]: FormItemRule }[] unused: { [key: string]: FormItemRule }[]
) { ) {
const { field } = isFunction(item) ? item() : item const { field } = isFunction(item) ? item() : item
// the fields is the data of the task definition. // the fields is the data of the task definition.

12
dolphinscheduler-ui-next/src/components/form/get-elements-by-json.ts

@ -29,17 +29,9 @@ export default function getElementByJson(
const rules: FormRules = {} const rules: FormRules = {}
const initialValues: { [field: string]: any } = {} const initialValues: { [field: string]: any } = {}
const elements: IFormItem[] = [] const elements: IFormItem[] = []
for (let item of json) { for (const item of json) {
const mergedItem = isFunction(item) ? item() : item const mergedItem = isFunction(item) ? item() : item
const { const { name, value, field, children, validate, ...rest } = mergedItem
name,
value,
field,
span = 24,
children,
validate,
...rest
} = mergedItem
if (value || value === 0) { if (value || value === 0) {
fields[field] = value fields[field] = value
initialValues[field] = value initialValues[field] = value

2
dolphinscheduler-ui-next/src/components/form/use-form.ts

@ -27,7 +27,7 @@ export function useForm() {
} }
const setValues = (initialValues: { [field: string]: any }) => { const setValues = (initialValues: { [field: string]: any }) => {
for (let [key, value] of Object.entries(initialValues)) { for (const [key, value] of Object.entries(initialValues)) {
state.formRef.model[key] = value state.formRef.model[key] = value
} }
} }

2
dolphinscheduler-ui-next/src/layouts/content/components/sidebar/use-menuClick.ts

@ -22,7 +22,7 @@ import { MenuOption } from 'naive-ui'
export function useMenuClick() { export function useMenuClick() {
const router: Router = useRouter() const router: Router = useRouter()
const handleMenuClick = (key: string, item: MenuOption) => { const handleMenuClick = (key: string, unused: MenuOption) => {
// console.log(key, item) // console.log(key, item)
router.push({ path: `${key}` }) router.push({ path: `${key}` })
} }

2
dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts

@ -27,7 +27,7 @@ export function useDropDown() {
const userStore = useUserStore() const userStore = useUserStore()
const menuStore = useMenuStore() const menuStore = useMenuStore()
const handleSelect = (key: string | number, option: DropdownOption) => { const handleSelect = (key: string | number, unused: DropdownOption) => {
menuStore.setMenuKey('') menuStore.setMenuKey('')
if (key === 'logout') { if (key === 'logout') {
useLogout() useLogout()

40
dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts

@ -141,7 +141,7 @@ export function useDataList() {
children: [ children: [
{ {
label: t('menu.file_manage'), label: t('menu.file_manage'),
key: `/resource/file-manage`, key: '/resource/file-manage',
icon: renderIcon(FileSearchOutlined) icon: renderIcon(FileSearchOutlined)
}, },
{ {
@ -151,11 +151,11 @@ export function useDataList() {
children: [ children: [
{ {
label: t('menu.resource_manage'), label: t('menu.resource_manage'),
key: `/resource/resource-manage` key: '/resource/resource-manage'
}, },
{ {
label: t('menu.function_manage'), label: t('menu.function_manage'),
key: `/resource/function-manage` key: '/resource/function-manage'
} }
] ]
}, },
@ -183,12 +183,12 @@ export function useDataList() {
children: [ children: [
{ {
label: t('menu.task_result'), label: t('menu.task_result'),
key: `/data-quality/task-result`, key: '/data-quality/task-result',
icon: renderIcon(ApartmentOutlined) icon: renderIcon(ApartmentOutlined)
}, },
{ {
label: t('menu.rule'), label: t('menu.rule'),
key: `/data-quality/rule`, key: '/data-quality/rule',
icon: renderIcon(BarsOutlined) icon: renderIcon(BarsOutlined)
} }
] ]
@ -211,15 +211,15 @@ export function useDataList() {
children: [ children: [
{ {
label: t('menu.master'), label: t('menu.master'),
key: `/monitor/master` key: '/monitor/master'
}, },
{ {
label: t('menu.worker'), label: t('menu.worker'),
key: `/monitor/worker` key: '/monitor/worker'
}, },
{ {
label: t('menu.db'), label: t('menu.db'),
key: `/monitor/db` key: '/monitor/db'
} }
] ]
}, },
@ -230,11 +230,11 @@ export function useDataList() {
children: [ children: [
{ {
label: t('menu.statistics'), label: t('menu.statistics'),
key: `/monitor/statistics` key: '/monitor/statistics'
}, },
{ {
label: t('menu.audit_log'), label: t('menu.audit_log'),
key: `/monitor/audit-log` key: '/monitor/audit-log'
} }
] ]
} }
@ -249,54 +249,54 @@ export function useDataList() {
? [ ? [
{ {
label: t('menu.tenant_manage'), label: t('menu.tenant_manage'),
key: `/security/tenant-manage`, key: '/security/tenant-manage',
icon: renderIcon(UsergroupAddOutlined) icon: renderIcon(UsergroupAddOutlined)
}, },
{ {
label: t('menu.user_manage'), label: t('menu.user_manage'),
key: `/security/user-manage`, key: '/security/user-manage',
icon: renderIcon(UserAddOutlined) icon: renderIcon(UserAddOutlined)
}, },
{ {
label: t('menu.alarm_group_manage'), label: t('menu.alarm_group_manage'),
key: `/security/alarm-group-manage`, key: '/security/alarm-group-manage',
icon: renderIcon(WarningOutlined) icon: renderIcon(WarningOutlined)
}, },
{ {
label: t('menu.alarm_instance_manage'), label: t('menu.alarm_instance_manage'),
key: `/security/alarm-instance-manage`, key: '/security/alarm-instance-manage',
icon: renderIcon(InfoCircleOutlined) icon: renderIcon(InfoCircleOutlined)
}, },
{ {
label: t('menu.worker_group_manage'), label: t('menu.worker_group_manage'),
key: `/security/worker-group-manage`, key: '/security/worker-group-manage',
icon: renderIcon(ControlOutlined) icon: renderIcon(ControlOutlined)
}, },
{ {
label: t('menu.yarn_queue_manage'), label: t('menu.yarn_queue_manage'),
key: `/security/yarn-queue-manage`, key: '/security/yarn-queue-manage',
icon: renderIcon(SlackOutlined) icon: renderIcon(SlackOutlined)
}, },
{ {
label: t('menu.environment_manage'), label: t('menu.environment_manage'),
key: `/security/environment-manage`, key: '/security/environment-manage',
icon: renderIcon(EnvironmentOutlined) icon: renderIcon(EnvironmentOutlined)
}, },
{ {
label: t('menu.k8s_namespace_manage'), label: t('menu.k8s_namespace_manage'),
key: `/security/k8s-namespace-manage`, key: '/security/k8s-namespace-manage',
icon: renderIcon(CloudServerOutlined) icon: renderIcon(CloudServerOutlined)
}, },
{ {
label: t('menu.token_manage'), label: t('menu.token_manage'),
key: `/security/token-manage`, key: '/security/token-manage',
icon: renderIcon(SafetyOutlined) icon: renderIcon(SafetyOutlined)
} }
] ]
: [ : [
{ {
label: t('menu.token_manage'), label: t('menu.token_manage'),
key: `/security/token-manage`, key: '/security/token-manage',
icon: renderIcon(SafetyOutlined) icon: renderIcon(SafetyOutlined)
} }
] ]

2
dolphinscheduler-ui-next/src/service/modules/lineages/index.ts

@ -16,7 +16,7 @@
*/ */
import { axios } from '@/service/service' import { axios } from '@/service/service'
import { ProjectCodeReq, WorkFlowNameReq, WorkflowCodeReq } from './types' import { ProjectCodeReq, WorkflowCodeReq } from './types'
export function queryWorkFlowList(projectCode: ProjectCodeReq): any { export function queryWorkFlowList(projectCode: ProjectCodeReq): any {
return axios({ return axios({

2
dolphinscheduler-ui-next/src/service/modules/process-definition/index.ts

@ -19,10 +19,8 @@ import { axios } from '@/service/service'
import { import {
CodeReq, CodeReq,
CodesReq, CodesReq,
FileReq,
NameReq, NameReq,
ReleaseStateReq, ReleaseStateReq,
VersionReq,
LimitReq, LimitReq,
PageReq, PageReq,
ListReq, ListReq,

6
dolphinscheduler-ui-next/src/service/modules/resources/index.ts

@ -18,7 +18,6 @@
import { axios, downloadFile } from '@/service/service' import { axios, downloadFile } from '@/service/service'
import { import {
ResourceTypeReq, ResourceTypeReq,
UdfTypeReq,
NameReq, NameReq,
FileNameReq, FileNameReq,
FullNameReq, FullNameReq,
@ -223,10 +222,7 @@ export function updateResourceContent(data: ContentReq, id: number): any {
}) })
} }
export function viewResource( export function viewResource(params: ViewResourceReq, id: number): any {
params: ViewResourceReq,
id: number
): any {
return axios({ return axios({
url: `/resources/${id}/view`, url: `/resources/${id}/view`,
method: 'get', method: 'get',

2
dolphinscheduler-ui-next/src/service/modules/schedules/index.ts

@ -18,13 +18,11 @@
import { axios } from '@/service/service' import { axios } from '@/service/service'
import { import {
ProjectCodeReq, ProjectCodeReq,
IdReq,
CodeReq, CodeReq,
ListReq, ListReq,
ScheduleReq, ScheduleReq,
WorkerGroupIdReq, WorkerGroupIdReq,
CreateScheduleReq, CreateScheduleReq,
DeleteScheduleReq,
ProcessDefinitionCodeReq ProcessDefinitionCodeReq
} from './types' } from './types'

2
dolphinscheduler-ui-next/src/service/modules/task-instances/index.ts

@ -37,5 +37,5 @@ export function forceSuccess(taskId: IdReq, projectCode: ProjectCodeReq): any {
} }
export function downloadLog(id: number): void { export function downloadLog(id: number): void {
downloadFile(`log/download-log`, { taskInstanceId: id }) downloadFile('log/download-log', { taskInstanceId: id })
} }

2
dolphinscheduler-ui-next/src/service/modules/token/index.ts

@ -60,7 +60,7 @@ export function deleteToken(id: number): any {
export function generateToken(data: TokenReq): any { export function generateToken(data: TokenReq): any {
return axios({ return axios({
url: `/access-tokens/generate`, url: '/access-tokens/generate',
method: 'post', method: 'post',
data data
}) })

4
dolphinscheduler-ui-next/src/utils/truncate-text.ts

@ -25,7 +25,7 @@ export default function truncateText(text: string, n: number) {
const exp = /[\u4E00-\u9FA5]/ const exp = /[\u4E00-\u9FA5]/
let res = '' let res = ''
let len = text.length let len = text.length
let chinese = text.match(new RegExp(exp, 'g')) const chinese = text.match(new RegExp(exp, 'g'))
if (chinese) { if (chinese) {
len += chinese.length len += chinese.length
} }
@ -33,7 +33,7 @@ export default function truncateText(text: string, n: number) {
let i = 0 let i = 0
let acc = 0 let acc = 0
while (true) { while (true) {
let char = text[i] const char = text[i]
if (exp.test(char)) { if (exp.test(char)) {
acc += 2 acc += 2
} else { } else {

2
dolphinscheduler-ui-next/src/views/data-quality/rule/components/rule-modal.tsx

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, h, PropType, reactive, ref, toRefs, watch } from 'vue' import { defineComponent, PropType } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { NDataTable } from 'naive-ui' import { NDataTable } from 'naive-ui'
import Modal from '@/components/modal' import Modal from '@/components/modal'

2
dolphinscheduler-ui-next/src/views/data-quality/rule/index.tsx

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, onMounted, ref, toRefs, watch } from 'vue' import { defineComponent, onMounted, ref, toRefs } from 'vue'
import { import {
NSpace, NSpace,
NInput, NInput,

6
dolphinscheduler-ui-next/src/views/data-quality/rule/use-table.ts

@ -19,13 +19,13 @@ import { useI18n } from 'vue-i18n'
import { h, reactive, ref } from 'vue' import { h, reactive, ref } from 'vue'
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { queryRuleListPaging } from '@/service/modules/data-quality' import { queryRuleListPaging } from '@/service/modules/data-quality'
import type { Rule, RuleRes } from '@/service/modules/data-quality/types' import type { RuleRes } from '@/service/modules/data-quality/types'
import TableAction from './components/table-action' import TableAction from './components/table-action'
import _ from 'lodash' import _ from 'lodash'
import { parseISO, format } from 'date-fns' import { parseISO, format } from 'date-fns'
import { TableColumns } from 'naive-ui/es/data-table/src/interface' import { TableColumns } from 'naive-ui/es/data-table/src/interface'
export function useTable(viewRuleEntry = (ruleJson: string): void => {}) { export function useTable(viewRuleEntry = (unusedRuleJson: string): void => {}) {
const { t } = useI18n() const { t } = useI18n()
const variables = reactive({ const variables = reactive({
@ -106,7 +106,7 @@ export function useTable(viewRuleEntry = (ruleJson: string): void => {}) {
const { state } = useAsyncState( const { state } = useAsyncState(
queryRuleListPaging(data).then((res: RuleRes) => { queryRuleListPaging(data).then((res: RuleRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
const ruleName = const ruleName =
'data_quality.rule.' + item.name.substring(3, item.name.length - 1) 'data_quality.rule.' + item.name.substring(3, item.name.length - 1)
const ruleNameLocale = t(ruleName) const ruleNameLocale = t(ruleName)

2
dolphinscheduler-ui-next/src/views/data-quality/task-result/use-table.ts

@ -180,7 +180,7 @@ export function useTable() {
const { state } = useAsyncState( const { state } = useAsyncState(
queryExecuteResultListPaging(data).then((res: ResultListRes) => { queryExecuteResultListPaging(data).then((res: ResultListRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
return { return {
...item ...item
} }

2
dolphinscheduler-ui-next/src/views/datasource/list/json-highlight.tsx

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, PropType, h } from 'vue' import { defineComponent, PropType } from 'vue'
import { NText } from 'naive-ui' import { NText } from 'naive-ui'
import { isBoolean, isNumber, isPlainObject } from 'lodash' import { isBoolean, isNumber, isPlainObject } from 'lodash'
import styles from './json-highlight.module.scss' import styles from './json-highlight.module.scss'

3
dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts

@ -20,7 +20,6 @@ import { useI18n } from 'vue-i18n'
import { NPopover, NButton, NIcon, NPopconfirm, NSpace } from 'naive-ui' import { NPopover, NButton, NIcon, NPopconfirm, NSpace } from 'naive-ui'
import { EditOutlined, DeleteOutlined } from '@vicons/antd' import { EditOutlined, DeleteOutlined } from '@vicons/antd'
import JsonHighlight from './json-highlight' import JsonHighlight from './json-highlight'
import styles from './index.module.scss'
import { TableColumns } from './types' import { TableColumns } from './types'
export function useColumns(onCallback: Function) { export function useColumns(onCallback: Function) {
@ -84,7 +83,7 @@ export function useColumns(onCallback: Function) {
title: t('datasource.operation'), title: t('datasource.operation'),
key: 'operation', key: 'operation',
width: 150, width: 150,
render: (rowData, rowIndex) => { render: (rowData, unused) => {
return h(NSpace, null, { return h(NSpace, null, {
default: () => [ default: () => [
h( h(

2
dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts

@ -60,7 +60,7 @@ export function useTable() {
const deleteRecord = async (id: number) => { const deleteRecord = async (id: number) => {
try { try {
const res = await deleteDataSource(id) const ignored = await deleteDataSource(id)
updateList() updateList()
} catch (e) { } catch (e) {
window.$message.error((e as Error).message) window.$message.error((e as Error).message)

2
dolphinscheduler-ui-next/src/views/home/use-table.ts

@ -22,7 +22,7 @@ export function useTable() {
const { t } = useI18n() const { t } = useI18n()
const columnsRef: TableColumns<any> = [ const columnsRef: TableColumns<any> = [
{ title: '#', key: 'index',render: (row, index) => index + 1}, { title: '#', key: 'index', render: (row, index) => index + 1 },
{ title: t('home.number'), key: 'number' }, { title: t('home.number'), key: 'number' },
{ title: t('home.state'), key: 'state' } { title: t('home.state'), key: 'state' }
] ]

2
dolphinscheduler-ui-next/src/views/home/use-task-state.ts

@ -29,7 +29,7 @@ export function useTaskState() {
endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'),
projectCode: 0 projectCode: 0
}).then((res: TaskStateRes): StateData => { }).then((res: TaskStateRes): StateData => {
const table = res.taskCountDtos.map((item, index) => { const table = res.taskCountDtos.map((item, unused) => {
return { return {
state: item.taskStateType, state: item.taskStateType,
number: item.count number: item.count

4
dolphinscheduler-ui-next/src/views/monitor/servers/worker/index.tsx

@ -35,7 +35,7 @@ const master = defineComponent({
const { getWorker } = useWorker() const { getWorker } = useWorker()
const workerRef: Ref<Array<WorkerRes>> = ref(getWorker()) const workerRef: Ref<Array<WorkerRes>> = ref(getWorker())
const columnsRef: TableColumns<any> = [ const columnsRef: TableColumns<any> = [
{ title: '#', key: 'index',render: (row, index) => index + 1 }, { title: '#', key: 'index', render: (row, index) => index + 1 },
{ title: t('monitor.worker.directory'), key: 'directory' } { title: t('monitor.worker.directory'), key: 'directory' }
] ]
@ -121,7 +121,7 @@ const master = defineComponent({
workerRef[0] && ( workerRef[0] && (
<NDataTable <NDataTable
columns={columnsRef} columns={columnsRef}
data={workerRef[0].zkDirectories.map((item, index) => { data={workerRef[0].zkDirectories.map((item, unused) => {
return { directory: item } return { directory: item }
})} })}
striped striped

2
dolphinscheduler-ui-next/src/views/monitor/statistics/audit-log/use-table.ts

@ -84,7 +84,7 @@ export function useTable() {
const { state } = useAsyncState( const { state } = useAsyncState(
queryAuditLogListPaging(data).then((res: AuditListRes) => { queryAuditLogListPaging(data).then((res: AuditListRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
return { return {
...item ...item
} }

10
dolphinscheduler-ui-next/src/views/projects/list/use-table.ts

@ -30,9 +30,9 @@ import { useMenuStore } from '@/store/menu/menu'
export function useTable( export function useTable(
updateProjectItem = ( updateProjectItem = (
code: number, unusedCode: number,
name: string, unusedName: string,
description: string unusedDescription: string
): void => {}, ): void => {},
resetTableData = () => {} resetTableData = () => {}
) { ) {
@ -41,7 +41,7 @@ export function useTable(
const menuStore = useMenuStore() const menuStore = useMenuStore()
const columns: TableColumns<any> = [ const columns: TableColumns<any> = [
{ title: '#', key: 'index',render: (row, index) => index + 1 }, { title: '#', key: 'index', render: (row, index) => index + 1 },
{ {
title: t('project.list.project_name'), title: t('project.list.project_name'),
key: 'name', key: 'name',
@ -101,7 +101,7 @@ export function useTable(
const { state } = useAsyncState( const { state } = useAsyncState(
queryProjectListPaging(params).then((res: ProjectRes) => { queryProjectListPaging(params).then((res: ProjectRes) => {
variables.totalPage = res.totalPage variables.totalPage = res.totalPage
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseISO(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'

2
dolphinscheduler-ui-next/src/views/projects/overview/use-process-state.ts

@ -32,7 +32,7 @@ export function useProcessState() {
endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'),
projectCode: Number(route.params.projectCode) projectCode: Number(route.params.projectCode)
}).then((res: TaskStateRes): StateData => { }).then((res: TaskStateRes): StateData => {
const table = res.taskCountDtos.map((item, index) => { const table = res.taskCountDtos.map((item, unused) => {
return { return {
state: item.taskStateType, state: item.taskStateType,
number: item.count number: item.count

2
dolphinscheduler-ui-next/src/views/projects/overview/use-task-state.ts

@ -32,7 +32,7 @@ export function useTaskState() {
endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'),
projectCode: Number(route.params.projectCode) projectCode: Number(route.params.projectCode)
}).then((res: TaskStateRes): StateData => { }).then((res: TaskStateRes): StateData => {
const table = res.taskCountDtos.map((item, index) => { const table = res.taskCountDtos.map((item, unused) => {
return { return {
state: item.taskStateType, state: item.taskStateType,
number: item.count number: item.count

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts

@ -53,7 +53,7 @@ export function useDatasource(
options.value.push({ label: item.name, value: String(item.id) }) options.value.push({ label: item.name, value: String(item.id) })
}) })
if (options.value && model.datasource) { if (options.value && model.datasource) {
let item = find(options.value, { value: String(model.datasource) }) const item = find(options.value, { value: String(model.datasource) })
if (!item) { if (!item) {
model.datasource = null model.datasource = null
} }

6
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts

@ -17,7 +17,7 @@
import { ref, onMounted, watch } from 'vue' import { ref, onMounted, watch } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import type { IJsonItem } from '../types' import type { IJsonItem } from '../types'
import { find, indexOf } from 'lodash' import { find } from 'lodash'
import { TypeReq } from '@/service/modules/data-source/types' import { TypeReq } from '@/service/modules/data-source/types'
import { queryDataSourceList } from '@/service/modules/data-source' import { queryDataSourceList } from '@/service/modules/data-source'
@ -171,7 +171,7 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
datasourceOptions.value.push({ label: item.name, value: String(item.id) }) datasourceOptions.value.push({ label: item.name, value: String(item.id) })
}) })
if (datasourceOptions.value && model.dataSource) { if (datasourceOptions.value && model.dataSource) {
let item = find(datasourceOptions.value, { const item = find(datasourceOptions.value, {
value: String(model.dataSource) value: String(model.dataSource)
}) })
if (!item) { if (!item) {
@ -191,7 +191,7 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] {
}) })
}) })
if (destinationDatasourceOptions.value && model.dataTarget) { if (destinationDatasourceOptions.value && model.dataTarget) {
let item = find(destinationDatasourceOptions.value, { const item = find(destinationDatasourceOptions.value, {
value: String(model.dataTarget) value: String(model.dataTarget)
}) })
if (!item) { if (!item) {

11
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts

@ -227,7 +227,6 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
dependItem.definitionCode dependItem.definitionCode
) )
} }
console.log(dependItem)
if (dependItem.cycle) { if (dependItem.cycle) {
dependItem.dateOptions = DATE_LSIT[dependItem.cycle] dependItem.dateOptions = DATE_LSIT[dependItem.cycle]
} }
@ -240,7 +239,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
...useDependentTimeout(model), ...useDependentTimeout(model),
...useRelationCustomParams({ ...useRelationCustomParams({
model, model,
children: (i: number = 0) => ({ children: (i = 0) => ({
type: 'custom-parameters', type: 'custom-parameters',
field: 'dependItemList', field: 'dependItemList',
span: 18, span: 18,
@ -260,7 +259,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
}, },
options: projectList options: projectList
}), }),
(j: number = 0) => ({ (j = 0) => ({
type: 'select', type: 'select',
field: 'definitionCode', field: 'definitionCode',
span: 12, span: 12,
@ -279,7 +278,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
model.dependTaskList[i]?.dependItemList[j] model.dependTaskList[i]?.dependItemList[j]
?.definitionCodeOptions || [] ?.definitionCodeOptions || []
}), }),
(j: number = 0) => ({ (j = 0) => ({
type: 'select', type: 'select',
field: 'depTaskCode', field: 'depTaskCode',
span: 12, span: 12,
@ -290,7 +289,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
model.dependTaskList[i]?.dependItemList[j]?.depTaskCodeOptions || model.dependTaskList[i]?.dependItemList[j]?.depTaskCodeOptions ||
[] []
}), }),
(j: number = 0) => ({ (j = 0) => ({
type: 'select', type: 'select',
field: 'cycle', field: 'cycle',
span: 12, span: 12,
@ -302,7 +301,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
}, },
options: CYCLE_LIST options: CYCLE_LIST
}), }),
(j: number = 0) => ({ (j = 0) => ({
type: 'select', type: 'select',
field: 'dateValue', field: 'dateValue',
span: 12, span: 12,

6
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts

@ -117,12 +117,12 @@ export function useSeaTunnel(model: { [field: string]: any }): IJsonItem[] {
const parseRawScript = () => { const parseRawScript = () => {
if (model.rawScript) { if (model.rawScript) {
model.rawScript.split('\n').forEach((script: string) => { model.rawScript.split('\n').forEach((script: string) => {
let params = script.replace(baseScript, '').split('--') const params = script.replace(baseScript, '').split('--')
params?.forEach((param: string) => { params?.forEach((param: string) => {
let pair = param.split(' ') const pair = param.split(' ')
if (pair && pair.length >= 2) { if (pair && pair.length >= 2) {
if (pair[0] === 'master') { if (pair[0] === 'master') {
let prefix = pair[1].substring(0, 8) const prefix = pair[1].substring(0, 8)
if (pair[1] && (prefix === 'mesos://' || prefix === 'spark://')) { if (pair[1] && (prefix === 'mesos://' || prefix === 'spark://')) {
model.master = prefix model.master = prefix
model.masterUrl = pair[1].substring(8, pair[1].length) model.masterUrl = pair[1].substring(8, pair[1].length)

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts

@ -19,7 +19,7 @@ import { ref, onMounted } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import type { IJsonItem } from '../types' import type { IJsonItem } from '../types'
export function useSqlType(model: { [field: string]: any }): IJsonItem { export function useSqlType(unusedModel: { [field: string]: any }): IJsonItem {
const { t } = useI18n() const { t } = useI18n()
const options = ref([] as { label: string; value: string }[]) const options = ref([] as { label: string; value: string }[])

1
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts

@ -92,7 +92,6 @@ export function useTargetType(model: { [field: string]: any }): IJsonItem[] {
watch( watch(
() => [model.sourceType, model.srcQueryType], () => [model.sourceType, model.srcQueryType],
([sourceType, srcQueryType]) => { ([sourceType, srcQueryType]) => {
console.log(sourceType, srcQueryType)
getTargetTypesBySourceType(sourceType, srcQueryType) getTargetTypesBySourceType(sourceType, srcQueryType)
} }
) )

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import { nextTick, onMounted, ref, watch } from 'vue' import { ref, watch } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import type { IJsonItem } from '../types' import type { IJsonItem } from '../types'
import { queryProcessDefinitionByCode } from '@/service/modules/process-definition' import { queryProcessDefinitionByCode } from '@/service/modules/process-definition'

4
dolphinscheduler-ui-next/src/views/projects/task/components/node/format-data.ts

@ -404,7 +404,7 @@ const buildRawScript = (model: INodeData) => {
let master = model.master let master = model.master
let masterUrl = model?.masterUrl ? model?.masterUrl : '' let masterUrl = model?.masterUrl ? model?.masterUrl : ''
let deployMode = model.deployMode let deployMode = model.deployMode
let queue = model.queue const queue = model.queue
if (model.deployMode === 'local') { if (model.deployMode === 'local') {
master = 'local' master = 'local'
@ -423,7 +423,7 @@ const buildRawScript = (model: INodeData) => {
let rawScript = '' let rawScript = ''
model.resourceList?.forEach((id: number) => { model.resourceList?.forEach((id: number) => {
let item = find(model.resourceFiles, { id: id }) const item = find(model.resourceFiles, { id: id })
rawScript = rawScript =
rawScript + rawScript +

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-conditions.ts

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { reactive, watch } from 'vue' import { reactive } from 'vue'
import * as Fields from '../fields/index' import * as Fields from '../fields/index'
import type { IJsonItem, INodeData, ITaskData } from '../types' import type { IJsonItem, INodeData, ITaskData } from '../types'

3
dolphinscheduler-ui-next/src/views/projects/task/components/node/tasks/use-procedure.ts

@ -19,7 +19,6 @@ import { reactive } from 'vue'
import * as Fields from '../fields/index' import * as Fields from '../fields/index'
import type { IJsonItem, INodeData } from '../types' import type { IJsonItem, INodeData } from '../types'
import { ITaskData } from '../types' import { ITaskData } from '../types'
import { useI18n } from 'vue-i18n'
export function useProcedure({ export function useProcedure({
projectCode, projectCode,
@ -32,8 +31,6 @@ export function useProcedure({
readonly?: boolean readonly?: boolean
data?: ITaskData data?: ITaskData
}) { }) {
const { t } = useI18n()
const model = reactive({ const model = reactive({
name: '', name: '',
taskType: 'PROCEDURE', taskType: 'PROCEDURE',

2
dolphinscheduler-ui-next/src/views/projects/task/definition/components/use-move.ts

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { reactive, ref, SetupContext } from 'vue' import { reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { querySimpleList } from '@/service/modules/process-definition' import { querySimpleList } from '@/service/modules/process-definition'

2
dolphinscheduler-ui-next/src/views/projects/task/definition/components/use-version.ts

@ -188,7 +188,7 @@ export function useVersion() {
{ code: variables.taskCode }, { code: variables.taskCode },
{ projectCode } { projectCode }
).then((res: TaskDefinitionVersionRes) => { ).then((res: TaskDefinitionVersionRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
return { return {
...item ...item
} }

2
dolphinscheduler-ui-next/src/views/projects/task/definition/components/version-modal.tsx

@ -17,7 +17,7 @@
import { defineComponent, onMounted, PropType, toRefs, watch } from 'vue' import { defineComponent, onMounted, PropType, toRefs, watch } from 'vue'
import Modal from '@/components/modal' import Modal from '@/components/modal'
import { NDataTable, NPagination, useThemeVars } from 'naive-ui' import { NDataTable, NPagination } from 'naive-ui'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useVersion } from './use-version' import { useVersion } from './use-version'
import styles from './version.module.scss' import styles from './version.module.scss'

18
dolphinscheduler-ui-next/src/views/projects/task/definition/use-table.ts

@ -143,7 +143,8 @@ export function useTable(onEdit: Function) {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('project.task.edit') default: () => t('project.task.edit')
@ -169,7 +170,8 @@ export function useTable(onEdit: Function) {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DragOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(DragOutlined) })
} }
), ),
default: () => t('project.task.move') default: () => t('project.task.move')
@ -192,7 +194,10 @@ export function useTable(onEdit: Function) {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(ExclamationCircleOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(ExclamationCircleOutlined)
})
} }
), ),
default: () => t('project.task.version') default: () => t('project.task.version')
@ -223,7 +228,10 @@ export function useTable(onEdit: Function) {
row.processReleaseState === 'ONLINE' row.processReleaseState === 'ONLINE'
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DeleteOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
} }
), ),
default: () => t('project.task.delete') default: () => t('project.task.delete')
@ -272,7 +280,7 @@ export function useTable(onEdit: Function) {
const { state } = useAsyncState( const { state } = useAsyncState(
queryTaskDefinitionListPaging({ ...params }, { projectCode }).then( queryTaskDefinitionListPaging({ ...params }, { projectCode }).then(
(res: TaskDefinitionRes) => { (res: TaskDefinitionRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
if (Object.keys(item.upstreamTaskMap).length > 0) { if (Object.keys(item.upstreamTaskMap).length > 0) {
item.upstreamTaskMap = Object.keys(item.upstreamTaskMap).map( item.upstreamTaskMap = Object.keys(item.upstreamTaskMap).map(
(code) => item.upstreamTaskMap[code] (code) => item.upstreamTaskMap[code]

2
dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { reactive, onMounted } from 'vue' import { reactive } from 'vue'
import { import {
genTaskCodeList, genTaskCodeList,
saveSingle, saveSingle,

2
dolphinscheduler-ui-next/src/views/projects/task/instance/components/log-modal.tsx

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, onMounted, PropType, toRefs, watch } from 'vue' import { defineComponent, PropType, toRefs, watch } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { NLog } from 'naive-ui' import { NLog } from 'naive-ui'
import { useModal } from './use-modal' import { useModal } from './use-modal'

16
dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts

@ -31,7 +31,6 @@ import {
} from '@vicons/antd' } from '@vicons/antd'
import { parseISO, format } from 'date-fns' import { parseISO, format } from 'date-fns'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { downloadFile } from '@/service/service'
import type { TaskInstancesRes } from '@/service/modules/task-instances/types' import type { TaskInstancesRes } from '@/service/modules/task-instances/types'
export function useTable() { export function useTable() {
@ -145,7 +144,10 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(CheckCircleOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(CheckCircleOutlined)
})
} }
), ),
default: () => t('project.task.serial_wait') default: () => t('project.task.serial_wait')
@ -165,7 +167,10 @@ export function useTable() {
onClick: () => handleLog(row) onClick: () => handleLog(row)
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(AlignLeftOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(AlignLeftOutlined)
})
} }
), ),
default: () => t('project.task.view_log') default: () => t('project.task.view_log')
@ -185,7 +190,8 @@ export function useTable() {
onClick: () => downloadLog(row.id) onClick: () => downloadLog(row.id)
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DownloadOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(DownloadOutlined) })
} }
), ),
default: () => t('project.task.download_log') default: () => t('project.task.download_log')
@ -243,7 +249,7 @@ export function useTable() {
const { state } = useAsyncState( const { state } = useAsyncState(
queryTaskListPaging(data, { projectCode }).then( queryTaskListPaging(data, { projectCode }).then(
(res: TaskInstancesRes) => { (res: TaskInstancesRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
item.submitTime = format( item.submitTime = format(
parseISO(item.submitTime), parseISO(item.submitTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'

2
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-auto-layout-modal.tsx

@ -55,7 +55,7 @@ const props = {
export default defineComponent({ export default defineComponent({
name: 'dag-format-modal', name: 'dag-format-modal',
props, props,
setup(props, context) { setup(props, unusedContext) {
const { t } = useI18n() const { t } = useI18n()
const { formValue, formRef, submit, cancel } = props const { formValue, formRef, submit, cancel } = props

1
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-cell-update.ts

@ -64,7 +64,6 @@ export function useCellUpdate(options: Options) {
coordinate: Coordinate = { x: 100, y: 100 } coordinate: Coordinate = { x: 100, y: 100 }
) { ) {
if (!TASK_TYPES_MAP[type as TaskType]) { if (!TASK_TYPES_MAP[type as TaskType]) {
console.warn(`taskType:${type} is invalid!`)
return return
} }
const node = buildNode(id, type, name, flag, coordinate) const node = buildNode(id, type, name, flag, coordinate)

2
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts

@ -44,7 +44,7 @@ export function useCustomCellBuilder() {
function buildEdge( function buildEdge(
sourceId: string, sourceId: string,
targetId: string, targetId: string,
label: string = '' label = ''
): Edge.Metadata { ): Edge.Metadata {
return { return {
shape: X6_EDGE_NAME, shape: X6_EDGE_NAME,

1
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-task-edit.ts

@ -15,7 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
import _ from 'lodash'
import { ref, onMounted, watch } from 'vue' import { ref, onMounted, watch } from 'vue'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import type { Graph } from '@antv/x6' import type { Graph } from '@antv/x6'

2
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-text-copy.ts

@ -27,7 +27,7 @@ export function useTextCopy() {
const { copy } = useClipboard() const { copy } = useClipboard()
const message = useMessage() const message = useMessage()
const copyText = (text: string) => { const copyText = (text: string) => {
copy(text).then((res) => { copy(text).then(() => {
message.success(t('project.dag.copy_success')) message.success(t('project.dag.copy_success'))
}) })
} }

2
dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx

@ -76,7 +76,7 @@ export default defineComponent({
}, },
projectCode projectCode
) )
.then((res: any) => { .then((ignored: any) => {
message.success(t('project.dag.success')) message.success(t('project.dag.success'))
router.push({ path: `/projects/${projectCode}/workflow-definition` }) router.push({ path: `/projects/${projectCode}/workflow-definition` })
}) })

2
dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx

@ -95,7 +95,7 @@ export default defineComponent({
code, code,
projectCode projectCode
) )
.then((res: any) => { .then((ignored: any) => {
message.success(t('project.dag.success')) message.success(t('project.dag.success'))
router.push({ path: `/projects/${projectCode}/workflow-definition` }) router.push({ path: `/projects/${projectCode}/workflow-definition` })
}) })

2
dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx

@ -28,7 +28,7 @@ import {
renderSlot renderSlot
} from 'vue' } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { dateEnGB, NButton, NIcon, NTooltip } from 'naive-ui' import { NButton, NIcon, NTooltip } from 'naive-ui'
import { queryLog } from '@/service/modules/log' import { queryLog } from '@/service/modules/log'
import { import {
DownloadOutlined, DownloadOutlined,

4
dolphinscheduler-ui-next/src/views/projects/workflow/relation/components/Graph.tsx

@ -47,8 +47,6 @@ const GraphChart = defineComponent({
const graphChartRef: Ref<HTMLDivElement | null> = ref(null) const graphChartRef: Ref<HTMLDivElement | null> = ref(null)
const { t } = useI18n() const { t } = useI18n()
console.log(props.seriesData)
const legendData = [ const legendData = [
{ name: t('project.workflow.online') }, { name: t('project.workflow.online') },
{ name: t('project.workflow.workflow_offline') }, { name: t('project.workflow.workflow_offline') },
@ -56,8 +54,6 @@ const GraphChart = defineComponent({
] ]
const getCategory = (schedulerStatus: number, workflowStatus: number) => { const getCategory = (schedulerStatus: number, workflowStatus: number) => {
console.log(schedulerStatus, workflowStatus)
switch (true) { switch (true) {
case workflowStatus === 0: case workflowStatus === 0:
return 1 return 1

1
dolphinscheduler-ui-next/src/views/projects/workflow/relation/use-relation.ts

@ -39,7 +39,6 @@ export function useRelation() {
variables.seriesData = [] variables.seriesData = []
variables.seriesData = obj.map((item) => { variables.seriesData = obj.map((item) => {
console.log(item)
return { return {
name: item.workFlowName, name: item.workFlowName,
id: item.workFlowCode, id: item.workFlowCode,

15
dolphinscheduler-ui-next/src/views/resource/task-group/option/components/form-modal.tsx

@ -15,15 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { import { defineComponent, PropType, toRefs, onMounted, ref, Ref } from 'vue'
defineComponent,
PropType,
toRefs,
onMounted,
ref,
toRaw,
Ref
} from 'vue'
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui' import { NForm, NFormItem, NInput, NSelect } from 'naive-ui'
import { useForm } from '../use-form' import { useForm } from '../use-form'
import Modal from '@/components/modal' import Modal from '@/components/modal'
@ -56,7 +48,10 @@ const FormModal = defineComponent({
onMounted(() => { onMounted(() => {
queryAllProjectList().then((res: any[]) => { queryAllProjectList().then((res: any[]) => {
res.map((item) => { res.map((item) => {
let option: SelectMixedOption = { label: item.name, value: item.code } const option: SelectMixedOption = {
label: item.name,
value: item.code
}
projectOptions.value.push(option) projectOptions.value.push(option)
}) })
}) })

4
dolphinscheduler-ui-next/src/views/resource/task-group/option/index.tsx

@ -22,9 +22,7 @@ import {
NInput, NInput,
NCard, NCard,
NDataTable, NDataTable,
NSwitch, NPagination
NPagination,
NTooltip
} from 'naive-ui' } from 'naive-ui'
import Card from '@/components/card' import Card from '@/components/card'
import { SearchOutlined } from '@vicons/antd' import { SearchOutlined } from '@vicons/antd'

22
dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts

@ -15,12 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { useAsyncState, useAsyncQueue } from '@vueuse/core'
import { h, reactive, ref } from 'vue' import { h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { parseISO, format } from 'date-fns' import { parseISO, format } from 'date-fns'
import { useRouter } from 'vue-router'
import type { Router } from 'vue-router'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface' import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { queryTaskGroupListPaging } from '@/service/modules/task-group' import { queryTaskGroupListPaging } from '@/service/modules/task-group'
import { queryAllProjectList } from '@/service/modules/projects' import { queryAllProjectList } from '@/service/modules/projects'
@ -29,20 +26,19 @@ import _ from 'lodash'
export function useTable( export function useTable(
updateItem = ( updateItem = (
id: number, unusedId: number,
name: string, unusedName: string,
projectCode: number, unusedProjectCode: number,
groupSize: number, unusedGroupSize: number,
description: string, unusedDescription: string,
status: number unusedStatus: number
): void => {}, ): void => {},
resetTableData = () => {} resetTableData = () => {}
) { ) {
const { t } = useI18n() const { t } = useI18n()
const router: Router = useRouter()
const columns: TableColumns<any> = [ const columns: TableColumns<any> = [
{ title: '#', key: 'index',render: (row, index) => index + 1 }, { title: '#', key: 'index', render: (row, index) => index + 1 },
{ title: t('resource.task_group_option.name'), key: 'name' }, { title: t('resource.task_group_option.name'), key: 'name' },
{ title: t('resource.task_group_option.project_name'), key: 'projectName' }, { title: t('resource.task_group_option.project_name'), key: 'projectName' },
{ {
@ -96,10 +92,10 @@ export function useTable(
(values: any[]) => { (values: any[]) => {
variables.totalPage = values[0].totalPage variables.totalPage = values[0].totalPage
variables.tableData = values[0].totalList.map( variables.tableData = values[0].totalList.map(
(item: any, index: number) => { (item: any, unused: number) => {
let projectName = '' let projectName = ''
if (values[1]) { if (values[1]) {
let project = _.find(values[1], { code: item.projectCode }) const project = _.find(values[1], { code: item.projectCode })
if (project) { if (project) {
projectName = project.name projectName = project.name
} }

12
dolphinscheduler-ui-next/src/views/resource/task-group/queue/components/form-modal.tsx

@ -15,15 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { import { defineComponent, PropType, toRefs, onMounted } from 'vue'
defineComponent,
PropType,
toRefs,
ref,
toRaw,
Ref,
onMounted
} from 'vue'
import { NForm, NFormItem, NInput } from 'naive-ui' import { NForm, NFormItem, NInput } from 'naive-ui'
import { useForm } from '../use-form' import { useForm } from '../use-form'
import Modal from '@/components/modal' import Modal from '@/components/modal'
@ -52,7 +44,7 @@ const FormModal = defineComponent({
}) })
const onConfirm = () => { const onConfirm = () => {
let value = state.formData.priority + '' const value = state.formData.priority + ''
if (value) { if (value) {
modifyTaskGroupQueuePriority(state.formData).then(() => { modifyTaskGroupQueuePriority(state.formData).then(() => {
emit('confirm') emit('confirm')

1
dolphinscheduler-ui-next/src/views/resource/task-group/queue/components/table-action.tsx

@ -21,7 +21,6 @@ import { NSpace, NTooltip, NButton, NIcon } from 'naive-ui'
import { EditOutlined, PlayCircleOutlined } from '@vicons/antd' import { EditOutlined, PlayCircleOutlined } from '@vicons/antd'
import type { import type {
TaskGroupQueueIdReq, TaskGroupQueueIdReq,
TaskGroupQueuePriorityUpdateReq,
TaskGroupQueue TaskGroupQueue
} from '@/service/modules/task-group/types' } from '@/service/modules/task-group/types'
import { forceStartTaskInQueue } from '@/service/modules/task-group' import { forceStartTaskInQueue } from '@/service/modules/task-group'

13
dolphinscheduler-ui-next/src/views/resource/task-group/queue/index.tsx

@ -60,14 +60,6 @@ const taskGroupQueue = defineComponent({
priority: 0 priority: 0
}) })
const requestData = () => {
getTableData({
pageSize: variables.pageSize,
pageNo: variables.page,
groupId: variables.groupId
})
}
const resetTableData = () => { const resetTableData = () => {
getTableData({ getTableData({
pageSize: variables.pageSize, pageSize: variables.pageSize,
@ -120,7 +112,10 @@ const taskGroupQueue = defineComponent({
if (!searchParamRef.groupId) { if (!searchParamRef.groupId) {
searchParamRef.groupId = item.id searchParamRef.groupId = item.id
} }
let option: SelectMixedOption = { label: item.name, value: item.id } const option: SelectMixedOption = {
label: item.name,
value: item.id
}
taskGroupOptions.value.push(option) taskGroupOptions.value.push(option)
}) })
} }

3
dolphinscheduler-ui-next/src/views/resource/task-group/queue/use-form.ts

@ -19,7 +19,6 @@ import { useI18n } from 'vue-i18n'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
import type { FormRules } from 'naive-ui' import type { FormRules } from 'naive-ui'
import type { TaskGroupQueuePriorityUpdateReq } from '@/service/modules/task-group/types' import type { TaskGroupQueuePriorityUpdateReq } from '@/service/modules/task-group/types'
import _ from 'lodash'
export function useForm() { export function useForm() {
const { t } = useI18n() const { t } = useI18n()
@ -35,7 +34,7 @@ export function useForm() {
required: true, required: true,
trigger: ['input', 'blur'], trigger: ['input', 'blur'],
validator() { validator() {
let value = state.formData.priority + '' const value = state.formData.priority + ''
if (value && state.formData.priority >= 0) { if (value && state.formData.priority >= 0) {
} else { } else {
return new Error(t('resource.task_group_queue.priority_not_empty')) return new Error(t('resource.task_group_queue.priority_not_empty'))

12
dolphinscheduler-ui-next/src/views/resource/task-group/queue/use-table.ts

@ -15,12 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { useAsyncState, useAsyncQueue } from '@vueuse/core'
import { h, reactive, ref } from 'vue' import { h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { parseISO, format } from 'date-fns' import { parseISO, format } from 'date-fns'
import { useRouter } from 'vue-router'
import type { Router } from 'vue-router'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface' import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { import {
queryTaskGroupListPaging, queryTaskGroupListPaging,
@ -30,14 +27,13 @@ import TableAction from './components/table-action'
import _ from 'lodash' import _ from 'lodash'
export function useTable( export function useTable(
updatePriority = (queueId: number, priority: number): void => {}, updatePriority = (unusedQueueId: number, unusedPriority: number): void => {},
resetTableData = () => {} resetTableData = () => {}
) { ) {
const { t } = useI18n() const { t } = useI18n()
const router: Router = useRouter()
const columns: TableColumns<any> = [ const columns: TableColumns<any> = [
{ title: '#', key: 'index',render: (row, index) => index + 1 }, { title: '#', key: 'index', render: (row, index) => index + 1 },
{ title: t('resource.task_group_queue.project_name'), key: 'projectName' }, { title: t('resource.task_group_queue.project_name'), key: 'projectName' },
{ title: t('resource.task_group_queue.task_name'), key: 'taskName' }, { title: t('resource.task_group_queue.task_name'), key: 'taskName' },
{ {
@ -97,10 +93,10 @@ export function useTable(
const taskGroupList = values[1].totalList const taskGroupList = values[1].totalList
variables.totalPage = values[0].totalPage variables.totalPage = values[0].totalPage
variables.tableData = values[0].totalList.map( variables.tableData = values[0].totalList.map(
(item: any, index: number) => { (item: any, unused: number) => {
let taskGroupName = '' let taskGroupName = ''
if (taskGroupList) { if (taskGroupList) {
let taskGroup = _.find(taskGroupList, { id: item.groupId }) const taskGroup = _.find(taskGroupList, { id: item.groupId })
if (taskGroup) { if (taskGroup) {
taskGroupName = taskGroup.name taskGroupName = taskGroup.name
} }

10
dolphinscheduler-ui-next/src/views/security/alarm-group-manage/use-table.ts

@ -81,7 +81,8 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('security.alarm_group.edit') default: () => t('security.alarm_group.edit')
@ -109,7 +110,10 @@ export function useTable() {
size: 'small' size: 'small'
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DeleteOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
} }
), ),
default: () => t('security.alarm_group.delete') default: () => t('security.alarm_group.delete')
@ -153,7 +157,7 @@ export function useTable() {
const getTableData = (params: any) => { const getTableData = (params: any) => {
const { state } = useAsyncState( const { state } = useAsyncState(
queryAlertGroupListPaging({ ...params }).then((res: AlarmGroupRes) => { queryAlertGroupListPaging({ ...params }).then((res: AlarmGroupRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseISO(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'

2
dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-columns.ts

@ -50,7 +50,7 @@ export function useColumns(onCallback: Function) {
title: t('security.alarm_instance.operation'), title: t('security.alarm_instance.operation'),
key: 'operation', key: 'operation',
width: 150, width: 150,
render: (rowData, rowIndex) => { render: (rowData, unused) => {
return h(NSpace, null, { return h(NSpace, null, {
default: () => [ default: () => [
h( h(

2
dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts

@ -73,7 +73,7 @@ export function useTable() {
const deleteRecord = async (id: number) => { const deleteRecord = async (id: number) => {
try { try {
const res = await deleteAlertPluginInstance(id) const ignored = await deleteAlertPluginInstance(id)
updateList() updateList()
} catch (e) { } catch (e) {
window.$message.error((e as Error).message) window.$message.error((e as Error).message)

10
dolphinscheduler-ui-next/src/views/security/environment-manage/use-table.ts

@ -105,7 +105,8 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('security.environment.edit') default: () => t('security.environment.edit')
@ -134,7 +135,10 @@ export function useTable() {
class: 'delete' class: 'delete'
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DeleteOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
} }
), ),
default: () => t('security.environment.delete') default: () => t('security.environment.delete')
@ -178,7 +182,7 @@ export function useTable() {
const getTableData = (params: any) => { const getTableData = (params: any) => {
const { state } = useAsyncState( const { state } = useAsyncState(
queryEnvironmentListPaging({ ...params }).then((res: EnvironmentRes) => { queryEnvironmentListPaging({ ...params }).then((res: EnvironmentRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseISO(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'

6
dolphinscheduler-ui-next/src/views/security/k8s-namespace-manage/components/use-modal.ts

@ -87,9 +87,11 @@ export function useModal(
} }
const updateK8SNamespaceModal = () => { const updateK8SNamespaceModal = () => {
updateK8sNamespace(variables.model, variables.model.id).then((res: any) => { updateK8sNamespace(variables.model, variables.model.id).then(
(ignored: any) => {
ctx.emit('confirmModal', props.showModalRef) ctx.emit('confirmModal', props.showModalRef)
}) }
)
} }
return { return {

10
dolphinscheduler-ui-next/src/views/security/k8s-namespace-manage/use-table.ts

@ -113,7 +113,8 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('security.k8s_namespace.edit') default: () => t('security.k8s_namespace.edit')
@ -141,7 +142,10 @@ export function useTable() {
size: 'small' size: 'small'
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DeleteOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
} }
), ),
default: () => t('security.k8s_namespace.delete') default: () => t('security.k8s_namespace.delete')
@ -172,7 +176,7 @@ export function useTable() {
const getTableData = (params: any) => { const getTableData = (params: any) => {
const { state } = useAsyncState( const { state } = useAsyncState(
queryNamespaceListPaging({ ...params }).then((res: NamespaceListRes) => { queryNamespaceListPaging({ ...params }).then((res: NamespaceListRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseISO(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'

2
dolphinscheduler-ui-next/src/views/security/tenant-manage/components/tenant-modal.tsx

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, onMounted, PropType, toRefs, watch } from 'vue' import { defineComponent, PropType, toRefs, watch } from 'vue'
import Modal from '@/components/modal' import Modal from '@/components/modal'
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui' import { NForm, NFormItem, NInput, NSelect } from 'naive-ui'
import { useModalData } from './use-modalData' import { useModalData } from './use-modalData'

8
dolphinscheduler-ui-next/src/views/security/tenant-manage/components/use-modalData.ts

@ -76,19 +76,19 @@ export function useModalData(
const submitTenantModal = () => { const submitTenantModal = () => {
verifyTenantCode({ tenantCode: variables.model.tenantCode }).then( verifyTenantCode({ tenantCode: variables.model.tenantCode }).then(
(res: any) => { (unused: any) => {
const data = { const data = {
tenantCode: variables.model.tenantCode, tenantCode: variables.model.tenantCode,
queueId: variables.model.queueId, queueId: variables.model.queueId,
description: variables.model.description description: variables.model.description
} }
createTenant(data).then( createTenant(data).then(
(res: any) => { (unused: any) => {
variables.model.tenantCode = '' variables.model.tenantCode = ''
variables.model.description = '' variables.model.description = ''
ctx.emit('confirmModal', props.showModalRef) ctx.emit('confirmModal', props.showModalRef)
}, },
(err: any) => { (unused: any) => {
return return
} }
) )
@ -103,7 +103,7 @@ export function useModalData(
description: variables.model.description, description: variables.model.description,
id: variables.model.id id: variables.model.id
} }
updateTenant(data, { id: variables.model.id }).then((res: any) => { updateTenant(data, { id: variables.model.id }).then((unused: any) => {
ctx.emit('confirmModal', props.showModalRef) ctx.emit('confirmModal', props.showModalRef)
}) })
} }

10
dolphinscheduler-ui-next/src/views/security/tenant-manage/use-table.ts

@ -98,7 +98,8 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('security.tenant.edit') default: () => t('security.tenant.edit')
@ -127,7 +128,10 @@ export function useTable() {
class: 'delete' class: 'delete'
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DeleteOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
} }
), ),
default: () => t('security.tenant.delete') default: () => t('security.tenant.delete')
@ -158,7 +162,7 @@ export function useTable() {
const getTableData = (params: any) => { const getTableData = (params: any) => {
const { state } = useAsyncState( const { state } = useAsyncState(
queryTenantListPaging({ ...params }).then((res: any) => { queryTenantListPaging({ ...params }).then((res: any) => {
variables.tableData = res.totalList.map((item: any, index: number) => { variables.tableData = res.totalList.map((item: any, unused: number) => {
return { return {
...item ...item
} }

2
dolphinscheduler-ui-next/src/views/security/token-manage/components/use-modal.ts

@ -20,14 +20,12 @@ import { useI18n } from 'vue-i18n'
import { useUserStore } from '@/store/user/user' import { useUserStore } from '@/store/user/user'
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { format } from 'date-fns' import { format } from 'date-fns'
import { queryAlertPluginInstanceList } from '@/service/modules/alert-plugin'
import { listAll } from '@/service/modules/users' import { listAll } from '@/service/modules/users'
import { import {
generateToken, generateToken,
createToken, createToken,
updateToken updateToken
} from '@/service/modules/token' } from '@/service/modules/token'
import type { AlertPluginItem } from '@/service/modules/alert-plugin/types'
import type { UserListRes } from '@/service/modules/users/types' import type { UserListRes } from '@/service/modules/users/types'
import type { UserInfoRes } from '@/service/modules/users/types' import type { UserInfoRes } from '@/service/modules/users/types'

15
dolphinscheduler-ui-next/src/views/security/token-manage/use-table.ts

@ -20,13 +20,8 @@ import { reactive, h, ref } from 'vue'
import { parseISO, format } from 'date-fns' import { parseISO, format } from 'date-fns'
import { NButton, NIcon, NPopconfirm, NSpace, NTooltip } from 'naive-ui' import { NButton, NIcon, NPopconfirm, NSpace, NTooltip } from 'naive-ui'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import {
queryAlertGroupListPaging,
delAlertGroupById
} from '@/service/modules/alert-group'
import { DeleteOutlined, EditOutlined } from '@vicons/antd' import { DeleteOutlined, EditOutlined } from '@vicons/antd'
import { queryAccessTokenList, deleteToken } from '@/service/modules/token' import { queryAccessTokenList, deleteToken } from '@/service/modules/token'
import type { AlarmGroupRes } from '@/service/modules/alert-group/types'
import type { TokenRes } from '@/service/modules/token/types' import type { TokenRes } from '@/service/modules/token/types'
export function useTable() { export function useTable() {
@ -90,7 +85,8 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('security.token.edit') default: () => t('security.token.edit')
@ -119,7 +115,10 @@ export function useTable() {
class: 'delete' class: 'delete'
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DeleteOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
} }
), ),
default: () => t('security.token.delete') default: () => t('security.token.delete')
@ -163,7 +162,7 @@ export function useTable() {
const getTableData = (params: any) => { const getTableData = (params: any) => {
const { state } = useAsyncState( const { state } = useAsyncState(
queryAccessTokenList({ ...params }).then((res: TokenRes) => { queryAccessTokenList({ ...params }).then((res: TokenRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
item.expireTime = format( item.expireTime = format(
parseISO(item.expireTime), parseISO(item.expireTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'

4
dolphinscheduler-ui-next/src/views/security/user-manage/use-table.tsx

@ -61,7 +61,7 @@ function useColumns({ onEdit, onDelete }: UseTableProps) {
{ {
title: t('security.user.state'), title: t('security.user.state'),
key: 'state', key: 'state',
render: (rowData: any, rowIndex: number) => { render: (rowData: any, unused: number) => {
return rowData.state === 1 ? ( return rowData.state === 1 ? (
<NTag type='success'>{t('security.user.state_enabled')}</NTag> <NTag type='success'>{t('security.user.state_enabled')}</NTag>
) : ( ) : (
@ -84,7 +84,7 @@ function useColumns({ onEdit, onDelete }: UseTableProps) {
key: 'operation', key: 'operation',
fixed: 'right', fixed: 'right',
width: 140, width: 140,
render: (rowData: any, rowIndex: number) => { render: (rowData: any, unused: number) => {
return ( return (
<NSpace> <NSpace>
<NDropdown <NDropdown

10
dolphinscheduler-ui-next/src/views/security/worker-group-manage/use-table.ts

@ -102,7 +102,8 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('security.worker_group.edit') default: () => t('security.worker_group.edit')
@ -131,7 +132,10 @@ export function useTable() {
class: 'delete' class: 'delete'
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(DeleteOutlined) }) icon: () =>
h(NIcon, null, {
default: () => h(DeleteOutlined)
})
} }
), ),
default: () => t('security.worker_group.delete') default: () => t('security.worker_group.delete')
@ -175,7 +179,7 @@ export function useTable() {
const getTableData = (params: any) => { const getTableData = (params: any) => {
const { state } = useAsyncState( const { state } = useAsyncState(
queryAllWorkerGroupsPaging({ ...params }).then((res: WorkerGroupRes) => { queryAllWorkerGroupsPaging({ ...params }).then((res: WorkerGroupRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
return { return {
...item ...item
} }

2
dolphinscheduler-ui-next/src/views/security/yarn-queue-manage/components/use-modal.ts

@ -76,7 +76,7 @@ export function useModal(
const updateYarnQueueModal = () => { const updateYarnQueueModal = () => {
updateQueue({ ...variables.model }, { id: variables.model.id }).then( updateQueue({ ...variables.model }, { id: variables.model.id }).then(
(res: any) => { (ignored: any) => {
ctx.emit('confirmModal', props.showModalRef) ctx.emit('confirmModal', props.showModalRef)
} }
) )

5
dolphinscheduler-ui-next/src/views/security/yarn-queue-manage/use-table.ts

@ -77,7 +77,8 @@ export function useTable() {
} }
}, },
{ {
icon: () => h(NIcon, null, { default: () => h(EditOutlined) }) icon: () =>
h(NIcon, null, { default: () => h(EditOutlined) })
} }
), ),
default: () => t('security.yarn_queue.edit') default: () => t('security.yarn_queue.edit')
@ -103,7 +104,7 @@ export function useTable() {
const getTableData = (params: any) => { const getTableData = (params: any) => {
const { state } = useAsyncState( const { state } = useAsyncState(
queryQueueListPaging({ ...params }).then((res: QueueRes) => { queryQueueListPaging({ ...params }).then((res: QueueRes) => {
variables.tableData = res.totalList.map((item, index) => { variables.tableData = res.totalList.map((item, unused) => {
return { return {
...item ...item
} }

Loading…
Cancel
Save