Browse Source

[UI-NEXT] Fix wrong packaging locations (#8851)

3.0.0/version-upgrade
kezhenxu94 3 years ago committed by GitHub
parent
commit
d3cbf8eeaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      .github/workflows/frontend.yml
  2. 3
      .github/workflows/unit-test.yml
  3. 2
      dolphinscheduler-api/src/main/assembly/dolphinscheduler-api-server.xml
  4. 2
      dolphinscheduler-dist/src/main/assembly/dolphinscheduler-bin.xml
  5. 3
      dolphinscheduler-dist/src/main/assembly/dolphinscheduler-src.xml
  6. 2
      dolphinscheduler-ui-next/src/components/chart/modules/Tree.tsx
  7. 2
      dolphinscheduler-ui-next/src/layouts/content/components/sidebar/index.tsx
  8. 2
      dolphinscheduler-ui-next/src/layouts/content/components/user/use-dropdown.ts
  9. 2
      dolphinscheduler-ui-next/src/layouts/content/index.tsx
  10. 11
      dolphinscheduler-ui-next/src/utils/log.ts
  11. 9
      dolphinscheduler-ui-next/src/views/login/index.tsx
  12. 6
      dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx
  13. 2
      dolphinscheduler-ui-next/src/views/projects/list/index.tsx
  14. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx
  15. 10
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts
  16. 2
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts
  17. 10
      dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts
  18. 14
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
  19. 22
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts
  20. 14
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts
  21. 9
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
  22. 9
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
  23. 25
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
  24. 10
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/tree/index.tsx
  25. 56
      dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx
  26. 8
      dolphinscheduler-ui-next/src/views/resource/file/create/index.tsx
  27. 9
      dolphinscheduler-ui-next/src/views/resource/file/index.tsx
  28. 2
      dolphinscheduler-ui-next/src/views/resource/file/table/table-action.tsx
  29. 6
      dolphinscheduler-ui-next/src/views/resource/udf/function/index.tsx
  30. 13
      dolphinscheduler-ui-next/src/views/resource/udf/resource/index.tsx
  31. 2
      dolphinscheduler-ui-next/src/views/resource/udf/resource/use-table.ts
  32. 12
      dolphinscheduler-ui-next/src/views/security/user-manage/components/use-authorize.ts
  33. 2
      dolphinscheduler-ui-next/src/views/security/user-manage/index.tsx

10
.github/workflows/frontend.yml

@ -23,15 +23,15 @@ on:
- dev - dev
paths: paths:
- '.github/workflows/frontend.yml' - '.github/workflows/frontend.yml'
- 'dolphinscheduler-ui/**' - 'dolphinscheduler-ui-next/**'
pull_request: pull_request:
paths: paths:
- '.github/workflows/frontend.yml' - '.github/workflows/frontend.yml'
- 'dolphinscheduler-ui/**' - 'dolphinscheduler-ui-next/**'
defaults: defaults:
run: run:
working-directory: dolphinscheduler-ui working-directory: dolphinscheduler-ui-next
concurrency: concurrency:
group: frontend-${{ github.event.pull_request.number || github.ref }} group: frontend-${{ github.event.pull_request.number || github.ref }}
@ -54,9 +54,9 @@ jobs:
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: 8 node-version: 16
- name: Compile and Build - name: Compile and Build
run: | run: |
npm install npm install
npm run lint npm run lint
npm run build npm run build:prod

3
.github/workflows/unit-test.yml

@ -23,6 +23,7 @@ on:
paths-ignore: paths-ignore:
- '**/*.md' - '**/*.md'
- 'dolphinscheduler-ui' - 'dolphinscheduler-ui'
- 'dolphinscheduler-ui-next'
- 'dolphinscheduler-python/pydolphinscheduler' - 'dolphinscheduler-python/pydolphinscheduler'
branches: branches:
- dev - dev
@ -76,7 +77,7 @@ jobs:
-Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.core.codeCoveragePlugin=jacoco
-Dsonar.projectKey=apache-dolphinscheduler -Dsonar.projectKey=apache-dolphinscheduler
-Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682 -Dsonar.login=e4058004bc6be89decf558ac819aa1ecbee57682
-Dsonar.exclusions=dolphinscheduler-ui/src/**/i18n/locale/*.js,dolphinscheduler-microbench/src/**/* -Dsonar.exclusions=dolphinscheduler-ui/src/**/i18n/locale/*.js,dolphinscheduler-ui-next/src/**/i18n/locale/*.js,dolphinscheduler-microbench/src/**/*
-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2
dolphinscheduler-api/src/main/assembly/dolphinscheduler-api-server.xml

@ -56,7 +56,7 @@
<outputDirectory>conf</outputDirectory> <outputDirectory>conf</outputDirectory>
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>${basedir}/../dolphinscheduler-ui/dist</directory> <directory>${basedir}/../dolphinscheduler-ui-next/dist</directory>
<outputDirectory>./ui</outputDirectory> <outputDirectory>./ui</outputDirectory>
</fileSet> </fileSet>
</fileSets> </fileSets>

2
dolphinscheduler-dist/src/main/assembly/dolphinscheduler-bin.xml vendored

@ -71,7 +71,7 @@
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>${basedir}/../dolphinscheduler-ui/dist</directory> <directory>${basedir}/../dolphinscheduler-ui-next/dist</directory>
<outputDirectory>./ui</outputDirectory> <outputDirectory>./ui</outputDirectory>
</fileSet> </fileSet>

3
dolphinscheduler-dist/src/main/assembly/dolphinscheduler-src.xml vendored

@ -56,6 +56,9 @@
<exclude>**/dolphinscheduler-ui/dist/**</exclude> <exclude>**/dolphinscheduler-ui/dist/**</exclude>
<exclude>**/dolphinscheduler-ui/node/**</exclude> <exclude>**/dolphinscheduler-ui/node/**</exclude>
<exclude>**/dolphinscheduler-ui/node_modules/**</exclude> <exclude>**/dolphinscheduler-ui/node_modules/**</exclude>
<exclude>**/dolphinscheduler-ui-next/dist/**</exclude>
<exclude>**/dolphinscheduler-ui-next/node/**</exclude>
<exclude>**/dolphinscheduler-ui-next/node_modules/**</exclude>
<!-- python ignore --> <!-- python ignore -->
<exclude>**/dolphinscheduler-python/pydolphinscheduler/.pytest_cache/**</exclude> <exclude>**/dolphinscheduler-python/pydolphinscheduler/.pytest_cache/**</exclude>

2
dolphinscheduler-ui-next/src/components/chart/modules/Tree.tsx

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, onMounted, PropType, ref, watch, reactive } from 'vue' import { defineComponent, PropType, ref, watch, reactive } from 'vue'
import initChart from '@/components/chart' import initChart from '@/components/chart'
import type { Ref } from 'vue' import type { Ref } from 'vue'
import { IChartDataItem } from '@/components/chart/modules/types' import { IChartDataItem } from '@/components/chart/modules/types'

2
dolphinscheduler-ui-next/src/layouts/content/components/sidebar/index.tsx

@ -60,7 +60,7 @@ const Sidebar = defineComponent({
onExpand={() => (this.collapsedRef = false)} onExpand={() => (this.collapsedRef = false)}
> >
<NMenu <NMenu
class="tab-vertical" class='tab-vertical'
value={this.sideKey} value={this.sideKey}
options={this.sideMenuOptions} options={this.sideMenuOptions}
defaultExpandedKeys={this.defaultExpandedKeys} defaultExpandedKeys={this.defaultExpandedKeys}

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

@ -18,7 +18,6 @@
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { logout } from '@/service/modules/logout' import { logout } from '@/service/modules/logout'
import { useUserStore } from '@/store/user/user' import { useUserStore } from '@/store/user/user'
import { useMenuStore } from '@/store/menu/menu'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import { DropdownOption } from 'naive-ui' import { DropdownOption } from 'naive-ui'
import cookies from 'js-cookie' import cookies from 'js-cookie'
@ -26,7 +25,6 @@ import cookies from 'js-cookie'
export function useDropDown() { export function useDropDown() {
const router: Router = useRouter() const router: Router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
const menuStore = useMenuStore()
const handleSelect = (key: string | number, unused: DropdownOption) => { const handleSelect = (key: string | number, unused: DropdownOption) => {
if (key === 'logout') { if (key === 'logout') {

2
dolphinscheduler-ui-next/src/layouts/content/index.tsx

@ -103,7 +103,7 @@ const Content = defineComponent({
<NLayout style='height: 100%'> <NLayout style='height: 100%'>
<NLayoutHeader style='height: 65px'> <NLayoutHeader style='height: 65px'>
<NavBar <NavBar
class="tab-horizontal" class='tab-horizontal'
onHandleMenuClick={this.getSideMenuOptions} onHandleMenuClick={this.getSideMenuOptions}
headerMenuOptions={this.headerMenuOptions} headerMenuOptions={this.headerMenuOptions}
localesOptions={this.localesOptions} localesOptions={this.localesOptions}

11
dolphinscheduler-ui-next/src/utils/log.ts

@ -16,8 +16,8 @@
*/ */
const log = { const log = {
capsule: (title: string, text: string, type?: string) => {}, capsule: (unusedTitle: string, unusedText: string, unusedType?: string) => {},
error: (info: any) => {} error: (unusedInfo: any) => {}
} }
/** /**
@ -51,7 +51,8 @@ const typeColor = (type = 'primary') => {
* @param {String} text info text * @param {String} text info text
* @param {String} type style * @param {String} type style
*/ */
log.capsule = (title: string, text: string, type: string = 'primary') => { log.capsule = (title: string, text: string, type = 'primary') => {
// eslint-disable-next-line no-console
console.log( console.log(
`%c ${title} %c ${text} %c`, `%c ${title} %c ${text} %c`,
'background:#35495E; padding: 2px ; border-radius: 3px 0 0 3px; color: #fff;', 'background:#35495E; padding: 2px ; border-radius: 3px 0 0 3px; color: #fff;',
@ -66,9 +67,13 @@ log.capsule = (title: string, text: string, type: string = 'primary') => {
* @description Prints text in error style * @description Prints text in error style
*/ */
log.error = function (info) { log.error = function (info) {
// eslint-disable-next-line no-console
console.group('error info') console.group('error info')
// eslint-disable-next-line no-console
console.log('responseURL: ', `${info.config.baseURL}${info.config.url}`) console.log('responseURL: ', `${info.config.baseURL}${info.config.url}`)
// eslint-disable-next-line no-console
console.log('msg: ', info.data.msg) console.log('msg: ', info.data.msg)
// eslint-disable-next-line no-console
console.groupEnd() console.groupEnd()
} }

9
dolphinscheduler-ui-next/src/views/login/index.tsx

@ -17,7 +17,14 @@
import { defineComponent, toRefs, withKeys } from 'vue' import { defineComponent, toRefs, withKeys } from 'vue'
import styles from './index.module.scss' import styles from './index.module.scss'
import { NInput, NButton, NSwitch, NForm, NFormItem, useMessage } from 'naive-ui' import {
NInput,
NButton,
NSwitch,
NForm,
NFormItem,
useMessage
} from 'naive-ui'
import { useForm } from './use-form' import { useForm } from './use-form'
import { useTranslate } from './use-translate' import { useTranslate } from './use-translate'
import { useLogin } from './use-login' import { useLogin } from './use-login'

6
dolphinscheduler-ui-next/src/views/projects/list/components/project-modal.tsx

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { defineComponent, PropType, toRefs, onMounted, watch } from 'vue' import { defineComponent, PropType, toRefs, watch } 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'
@ -65,7 +65,9 @@ const ProjectModal = defineComponent({
() => { () => {
if (props.statusRef === 0) { if (props.statusRef === 0) {
variables.model.projectName = '' variables.model.projectName = ''
variables.model.userName = (userStore.getUserInfo as UserInfoRes).userName variables.model.userName = (
userStore.getUserInfo as UserInfoRes
).userName
variables.model.description = '' variables.model.description = ''
} else { } else {
variables.model.projectName = props.row.name variables.model.projectName = props.row.name

2
dolphinscheduler-ui-next/src/views/projects/list/index.tsx

@ -26,7 +26,7 @@ import {
NPagination, NPagination,
NSpace NSpace
} from 'naive-ui' } from 'naive-ui'
import { defineComponent, onMounted, ref, toRefs, reactive, watch } from 'vue' import { defineComponent, onMounted, toRefs, watch } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import ProjectModal from './components/project-modal' import ProjectModal from './components/project-modal'
import styles from './index.module.scss' import styles from './index.module.scss'

2
dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx

@ -19,7 +19,6 @@ import {
defineComponent, defineComponent,
PropType, PropType,
ref, ref,
reactive,
watch, watch,
nextTick, nextTick,
provide, provide,
@ -139,6 +138,7 @@ const NodeDetailModal = defineComponent({
} }
const onTaskTypeChange = (taskType: ITaskType) => { const onTaskTypeChange = (taskType: ITaskType) => {
// eslint-disable-next-line vue/no-mutating-props
props.data.taskType = taskType props.data.taskType = taskType
} }

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

@ -158,12 +158,10 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
const getProjectList = async () => { const getProjectList = async () => {
const result = await queryProjectCreatedAndAuthorizedByUser() const result = await queryProjectCreatedAndAuthorizedByUser()
projectList.value = result.map( projectList.value = result.map((item: { code: number; name: string }) => ({
(item: { code: number; name: string }) => ({ value: item.code,
value: item.code, label: item.name
label: item.name }))
})
)
return projectList return projectList
} }
const getProcessList = async (code: number) => { const getProcessList = async (code: number) => {

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

@ -82,7 +82,7 @@ export function useRules(
validate: responseItem.validate, validate: responseItem.validate,
props: responseItem.props props: responseItem.props
} }
let name = responseItem.name?.replace('$t(', '').replace(')', '') const name = responseItem.name?.replace('$t(', '').replace(')', '')
item.name = name ? t(`project.node.${name}`) : '' item.name = name ? t(`project.node.${name}`) : ''
if (responseItem.type !== 'group') { if (responseItem.type !== 'group') {

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

@ -34,12 +34,10 @@ export function useDatasource(
if (loading.value) return if (loading.value) return
loading.value = true loading.value = true
const result = await queryDataSourceList({ type }) const result = await queryDataSourceList({ type })
dataSourceList.value = result.map( dataSourceList.value = result.map((item: { name: string; id: number }) => ({
(item: { name: string; id: number }) => ({ label: item.name,
label: item.name, value: item.id
value: item.id }))
})
)
loading.value = false loading.value = false
} }
onMounted(() => { onMounted(() => {

14
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx

@ -131,8 +131,9 @@ export default defineComponent({
if ( if (
props.definition?.processDefinition.name !== formValue.value.name props.definition?.processDefinition.name !== formValue.value.name
) { ) {
verifyName(params, projectCode) verifyName(params, projectCode).then(() =>
.then(() => context.emit('save', formValue.value)) context.emit('save', formValue.value)
)
} else { } else {
context.emit('save', formValue.value) context.emit('save', formValue.value)
} }
@ -175,11 +176,7 @@ export default defineComponent({
onCancel={onCancel} onCancel={onCancel}
autoFocus={false} autoFocus={false}
> >
<NForm <NForm model={formValue.value} rules={rule} ref={formRef}>
model={formValue.value}
rules={rule}
ref={formRef}
>
<NFormItem label={t('project.dag.workflow_name')} path='name'> <NFormItem label={t('project.dag.workflow_name')} path='name'>
<NInput v-model:value={formValue.value.name} /> <NInput v-model:value={formValue.value.name} />
</NFormItem> </NFormItem>
@ -206,7 +203,8 @@ export default defineComponent({
min={0} min={0}
v-slots={{ v-slots={{
suffix: () => '分' suffix: () => '分'
}} /> }}
/>
</NFormItem> </NFormItem>
)} )}
<NFormItem <NFormItem

22
dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts

@ -99,10 +99,10 @@ export function useModal(
? JSON.stringify(startParams) ? JSON.stringify(startParams)
: '' : ''
await startProcessInstance(state.startForm, variables.projectCode) await startProcessInstance(state.startForm, variables.projectCode)
window.$message.success(t('project.workflow.success')) window.$message.success(t('project.workflow.success'))
ctx.emit('updateList') ctx.emit('updateList')
ctx.emit('update:show') ctx.emit('update:show')
} }
}) })
} }
@ -194,10 +194,11 @@ export function useModal(
} }
const getStartParamsList = (code: number) => { const getStartParamsList = (code: number) => {
queryProcessDefinitionByCode(code, variables.projectCode) queryProcessDefinitionByCode(code, variables.projectCode).then(
.then((res: any) => { (res: any) => {
variables.startParamsList = res.processDefinition.globalParamList variables.startParamsList = res.processDefinition.globalParamList
}) }
)
} }
const getPreviewSchedule = () => { const getPreviewSchedule = () => {
@ -219,10 +220,9 @@ export function useModal(
endTime: end, endTime: end,
crontab: state.timingForm.crontab crontab: state.timingForm.crontab
}) })
previewSchedule({ schedule }, projectCode) previewSchedule({ schedule }, projectCode).then((res: any) => {
.then((res: any) => { variables.schedulePreviewList = res
variables.schedulePreviewList = res })
})
} }
}) })
} }

14
dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts

@ -172,21 +172,23 @@ export function useTable(
} }
const handleSwitchVersion = (version: number) => { const handleSwitchVersion = (version: number) => {
switchVersion(variables.projectCode, variables.row.code, version) switchVersion(variables.projectCode, variables.row.code, version).then(
.then(() => { () => {
window.$message.success(t('project.workflow.success')) window.$message.success(t('project.workflow.success'))
ctx.emit('updateList') ctx.emit('updateList')
getTableData(variables.row) getTableData(variables.row)
}) }
)
} }
const handleDeleteVersion = (version: number) => { const handleDeleteVersion = (version: number) => {
deleteVersion(variables.projectCode, variables.row.code, version) deleteVersion(variables.projectCode, variables.row.code, version).then(
.then(() => { () => {
window.$message.success(t('project.workflow.success')) window.$message.success(t('project.workflow.success'))
ctx.emit('updateList') ctx.emit('updateList')
getTableData(variables.row) getTableData(variables.row)
}) }
)
} }
return { return {

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

@ -75,11 +75,10 @@ export default defineComponent({
timeout: saveForm.timeoutFlag ? saveForm.timeout : 0 timeout: saveForm.timeoutFlag ? saveForm.timeout : 0
}, },
projectCode projectCode
) ).then((ignored: 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` }) })
})
} }
return () => ( return () => (

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

@ -94,11 +94,10 @@ export default defineComponent({
}, },
code, code,
projectCode projectCode
) ).then((ignored: 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` }) })
})
} }
onMounted(() => { onMounted(() => {

25
dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts

@ -18,14 +18,7 @@
import { h, ref, reactive } from 'vue' import { h, ref, reactive } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { import { NSpace, NTooltip, NButton, NPopconfirm, NEllipsis } from 'naive-ui'
NSpace,
NTooltip,
NButton,
NPopconfirm,
NEllipsis,
NIcon
} from 'naive-ui'
import { import {
deleteScheduleById, deleteScheduleById,
offline, offline,
@ -39,7 +32,6 @@ import {
EditOutlined EditOutlined
} from '@vicons/antd' } from '@vicons/antd'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { ISearchParam } from './types' import { ISearchParam } from './types'
import styles from '../index.module.scss' import styles from '../index.module.scss'
@ -253,15 +245,14 @@ export function useTable() {
if (variables.tableData.length === 1 && variables.page > 1) { if (variables.tableData.length === 1 && variables.page > 1) {
variables.page -= 1 variables.page -= 1
} }
deleteScheduleById(id, variables.projectCode) deleteScheduleById(id, variables.projectCode).then(() => {
.then(() => { window.$message.success(t('project.workflow.success'))
window.$message.success(t('project.workflow.success')) getTableData({
getTableData({ pageSize: variables.pageSize,
pageSize: variables.pageSize, pageNo: variables.page,
pageNo: variables.page, searchVal: variables.searchVal
searchVal: variables.searchVal
})
}) })
})
} }
return { return {

10
dolphinscheduler-ui-next/src/views/projects/workflow/definition/tree/index.tsx

@ -27,7 +27,7 @@ import { Router, useRouter } from 'vue-router'
import { viewTree } from '@/service/modules/process-definition' import { viewTree } from '@/service/modules/process-definition'
import { SelectMixedOption } from 'naive-ui/lib/select/src/interface' import { SelectMixedOption } from 'naive-ui/lib/select/src/interface'
import { find } from 'lodash' import { find } from 'lodash'
import { ITaskTypeNodeOption, ITaskStateOption } from './types' import { ITaskTypeNodeOption } from './types'
export default defineComponent({ export default defineComponent({
name: 'WorkflowDefinitionTiming', name: 'WorkflowDefinitionTiming',
@ -202,14 +202,14 @@ export default defineComponent({
const initChartData = (node: any, newNode: any) => { const initChartData = (node: any, newNode: any) => {
newNode.children = [] newNode.children = []
node?.children.map((child: any) => { node?.children.map((child: any) => {
let newChild = {} const newChild = {}
initChartData(child, newChild) initChartData(child, newChild)
newNode.children.push(newChild) newNode.children.push(newChild)
}) })
newNode.name = node.name newNode.name = node.name
newNode.value = node.name === 'DAG' ? 'DAG' : node?.type newNode.value = node.name === 'DAG' ? 'DAG' : node?.type
let taskTypeNodeOption = find(taskTypeNodeOptions.value, { const taskTypeNodeOption = find(taskTypeNodeOptions.value, {
taskType: newNode.value taskType: newNode.value
}) })
if (taskTypeNodeOption) { if (taskTypeNodeOption) {
@ -259,7 +259,7 @@ export default defineComponent({
} }
const getWorkflowTreeData = async (limit: number) => { const getWorkflowTreeData = async (limit: number) => {
if (projectCode && definitionCode) { if (projectCode.value && definitionCode) {
const res = await viewTree(projectCode.value, definitionCode.value, { const res = await viewTree(projectCode.value, definitionCode.value, {
limit: limit limit: limit
}) })
@ -331,7 +331,7 @@ export default defineComponent({
<NSpace align='center'> <NSpace align='center'>
{taskTypeNodeOptions {taskTypeNodeOptions
.filter((option: any) => option.image) .filter((option: any) => option.image)
.map((option: any, index: number) => ( .map((option: any, unused: number) => (
<NButton text size='tiny' color={option.color}> <NButton text size='tiny' color={option.color}>
<NImage width='20' src={option.image} /> <NImage width='20' src={option.image} />
{option.taskType} {option.taskType}

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

@ -84,18 +84,17 @@ export default defineComponent({
taskInstanceId: props.taskInstanceId, taskInstanceId: props.taskInstanceId,
skipLineNum: loadingIndex.value * 1000, skipLineNum: loadingIndex.value * 1000,
limit: loadingIndex.value === 0 ? 1000 : (loadingIndex.value + 1) * 1000 limit: loadingIndex.value === 0 ? 1000 : (loadingIndex.value + 1) * 1000
}).then((res: any) => {
setTimeout(() => {
loadingRef.value = false
if (res) {
window.$message.success(t('project.workflow.update_log_success'))
} else {
window.$message.warning(t('project.workflow.no_more_log'))
}
}, 1500)
textareaLog.value.innerHTML = res || t('project.workflow.no_log')
}) })
.then((res: any) => {
setTimeout(() => {
loadingRef.value = false
if (res) {
window.$message.success(t('project.workflow.update_log_success'))
} else {
window.$message.warning(t('project.workflow.no_more_log'))
}
}, 1500)
textareaLog.value.innerHTML = res || t('project.workflow.no_log')
})
} }
const showLog = () => { const showLog = () => {
@ -103,25 +102,24 @@ export default defineComponent({
taskInstanceId: props.taskInstanceId, taskInstanceId: props.taskInstanceId,
skipLineNum: loadingIndex.value * 1000, skipLineNum: loadingIndex.value * 1000,
limit: loadingIndex.value === 0 ? 1000 : (loadingIndex.value + 1) * 1000 limit: loadingIndex.value === 0 ? 1000 : (loadingIndex.value + 1) * 1000
}).then((res: any) => {
if (!res) {
isDataRef.value = false
setTimeout(() => {
window.$message.warning(t('project.workflow.no_more_log'))
}, 1000)
textareaLog.value.innerHTML =
contentRef.value || t('project.workflow.no_log')
} else {
isDataRef.value = true
contentRef.value = res
textareaLog.value.innerHTML =
contentRef.value || t('project.workflow.no_log')
setTimeout(() => {
textareaLog.value.scrollTop = 2
}, 800)
}
}) })
.then((res: any) => {
if (!res) {
isDataRef.value = false
setTimeout(() => {
window.$message.warning(t('project.workflow.no_more_log'))
}, 1000)
textareaLog.value.innerHTML =
contentRef.value || t('project.workflow.no_log')
} else {
isDataRef.value = true
contentRef.value = res
textareaLog.value.innerHTML =
contentRef.value || t('project.workflow.no_log')
setTimeout(() => {
textareaLog.value.scrollTop = 2
}, 800)
}
})
} }
const initLog = () => { const initLog = () => {

8
dolphinscheduler-ui-next/src/views/resource/file/create/index.tsx

@ -109,7 +109,13 @@ export default defineComponent({
</NFormItem> </NFormItem>
<div class={styles['file-edit-content']}> <div class={styles['file-edit-content']}>
<div class={styles.submit}> <div class={styles.submit}>
<NButton type='info' size='small' round onClick={this.handleFile} class='btn-submit'> <NButton
type='info'
size='small'
round
onClick={this.handleFile}
class='btn-submit'
>
{t('resource.file.save')} {t('resource.file.save')}
</NButton> </NButton>
<NButton <NButton

9
dolphinscheduler-ui-next/src/views/resource/file/index.tsx

@ -188,13 +188,16 @@ export default defineComponent({
<div class={styles['conditions-model']}> <div class={styles['conditions-model']}>
<NSpace> <NSpace>
<NButtonGroup> <NButtonGroup>
<NButton onClick={handleCreateFolder} class="btn-create-directory"> <NButton
onClick={handleCreateFolder}
class='btn-create-directory'
>
{t('resource.file.create_folder')} {t('resource.file.create_folder')}
</NButton> </NButton>
<NButton onClick={handleCreateFile} class="btn-create-file"> <NButton onClick={handleCreateFile} class='btn-create-file'>
{t('resource.file.create_file')} {t('resource.file.create_file')}
</NButton> </NButton>
<NButton onClick={handleUploadFile} class="btn-upload-file"> <NButton onClick={handleUploadFile} class='btn-upload-file'>
{t('resource.file.upload_files')} {t('resource.file.upload_files')}
</NButton> </NButton>
</NButtonGroup> </NButtonGroup>

2
dolphinscheduler-ui-next/src/views/resource/file/table/table-action.tsx

@ -127,7 +127,7 @@ export default defineComponent({
} }
style={{ marginRight: '-5px' }} style={{ marginRight: '-5px' }}
circle circle
class="btn-rename" class='btn-rename'
> >
<NIcon> <NIcon>
<EditOutlined /> <EditOutlined />

6
dolphinscheduler-ui-next/src/views/resource/udf/function/index.tsx

@ -94,7 +94,11 @@ export default defineComponent({
<Card class={styles.card}> <Card class={styles.card}>
<div class={styles.header}> <div class={styles.header}>
<NSpace> <NSpace>
<NButton type='primary' onClick={this.handleCreateFolder} class='btn-create-udf-function'> <NButton
type='primary'
onClick={this.handleCreateFolder}
class='btn-create-udf-function'
>
{t('resource.function.create_udf_function')} {t('resource.function.create_udf_function')}
</NButton> </NButton>
</NSpace> </NSpace>

13
dolphinscheduler-ui-next/src/views/resource/udf/resource/index.tsx

@ -115,10 +115,19 @@ export default defineComponent({
<Card class={styles.card}> <Card class={styles.card}>
<div class={styles.header}> <div class={styles.header}>
<NSpace> <NSpace>
<NButton type='primary' onClick={this.handleCreateFolder} class='btn-create-directory'> <NButton
type='primary'
onClick={this.handleCreateFolder}
class='btn-create-directory'
>
{t('resource.udf.create_folder')} {t('resource.udf.create_folder')}
</NButton> </NButton>
<NButton strong secondary onClick={this.handleUploadFile} class='btn-upload-udf'> <NButton
strong
secondary
onClick={this.handleUploadFile}
class='btn-upload-udf'
>
{t('resource.udf.upload_udf_resources')} {t('resource.udf.upload_udf_resources')}
</NButton> </NButton>
</NSpace> </NSpace>

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

@ -187,7 +187,7 @@ export function useTable() {
circle: true, circle: true,
type: 'error', type: 'error',
size: 'tiny', size: 'tiny',
class: 'btn-delete', class: 'btn-delete'
}, },
{ {
icon: () => h(DeleteOutlined) icon: () => h(DeleteOutlined)

12
dolphinscheduler-ui-next/src/views/security/user-manage/components/use-authorize.ts

@ -15,7 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
import { reactive } from 'vue' import { reactive } from 'vue'
import { useI18n } from 'vue-i18n'
import { import {
queryAuthorizedProject, queryAuthorizedProject,
queryUnauthorizedProject queryUnauthorizedProject
@ -40,8 +39,6 @@ import { removeUselessChildren } from '@/utils/tree-format'
import type { TAuthType, IResourceOption, IOption } from '../types' import type { TAuthType, IResourceOption, IOption } from '../types'
export function useAuthorize() { export function useAuthorize() {
const { t } = useI18n()
const state = reactive({ const state = reactive({
saving: false, saving: false,
loading: false, loading: false,
@ -124,13 +121,13 @@ export function useAuthorize() {
]) ])
state.loading = false state.loading = false
removeUselessChildren(resources[0]) removeUselessChildren(resources[0])
let udfResources = [] as IResourceOption[] const udfResources = [] as IResourceOption[]
let fileResources = [] as IResourceOption[] const fileResources = [] as IResourceOption[]
resources[0].forEach((item: IResourceOption) => { resources[0].forEach((item: IResourceOption) => {
item.type === 'FILE' ? fileResources.push(item) : udfResources.push(item) item.type === 'FILE' ? fileResources.push(item) : udfResources.push(item)
}) })
let udfTargets = [] as number[] const udfTargets = [] as number[]
let fileTargets = [] as number[] const fileTargets = [] as number[]
resources[1].forEach((item: { type: string; id: number }) => { resources[1].forEach((item: { type: string; id: number }) => {
item.type === 'FILE' item.type === 'FILE'
? fileTargets.push(item.id) ? fileTargets.push(item.id)
@ -138,7 +135,6 @@ export function useAuthorize() {
}) })
state.fileResources = fileResources state.fileResources = fileResources
state.udfResources = udfResources state.udfResources = udfResources
console.log(fileResources)
state.authorizedFileResources = fileTargets state.authorizedFileResources = fileTargets
state.authorizedUdfResources = fileTargets state.authorizedUdfResources = fileTargets
} }

2
dolphinscheduler-ui-next/src/views/security/user-manage/index.tsx

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

Loading…
Cancel
Save