Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,13 @@ import { useI18n } from 'vue-i18n'
import { useAsyncState } from '@vueuse/core'
import { queryLog } from '@/service/modules/log'
import { stateType } from '@/common/common'
import { useUISettingStore } from '@/store/ui-setting/ui-setting'
import Card from '@/components/card'
import LogModal from '@/components/log-modal'
import totalCount from '@/utils/tableTotalCount'

const BatchTaskInstance = defineComponent({
name: 'task-instance',
setup() {
const uiSettingStore = useUISettingStore()
const logTimer = uiSettingStore.getLogTimer
const { t, variables, getTableData, createColumns } = useTable()

const requestTableData = () => {
Expand Down Expand Up @@ -114,9 +111,7 @@ const BatchTaskInstance = defineComponent({
variables.showModalRef = false
}

let getLogsID: number

const getLogs = (row: any, logTimer: number) => {
const getLogs = (row: any) => {
const { state } = useAsyncState(
queryLog({
taskInstanceId: Number(row.id),
Expand All @@ -125,23 +120,10 @@ const BatchTaskInstance = defineComponent({
}).then((res: any) => {
variables.logRef += res.message || ''
if (res && res.message !== '') {
variables.limit += 1000
variables.skipLineNum += res.lineNum
getLogs(row, logTimer)
getLogs(row)
} else {
variables.logLoadingRef = false
if (logTimer !== 0) {
if (typeof getLogsID === 'number') {
clearTimeout(getLogsID)
}
getLogsID = setTimeout(() => {
variables.logRef = ''
variables.limit = 1000
variables.skipLineNum = 0
variables.logLoadingRef = true
getLogs(row, logTimer)
}, logTimer * 1000)
}
}
}),
{}
Expand All @@ -154,7 +136,7 @@ const BatchTaskInstance = defineComponent({
variables.logRef = ''
variables.limit = 1000
variables.skipLineNum = 0
getLogs(row, logTimer)
getLogs(row)
}

const trim = getCurrentInstance()?.appContext.config.globalProperties.trim
Expand All @@ -172,7 +154,7 @@ const BatchTaskInstance = defineComponent({
() => variables.showModalRef,
() => {
if (variables.showModalRef) {
getLogs(variables.row, logTimer)
getLogs(variables.row)
} else {
variables.row = {}
variables.logRef = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { useI18n } from 'vue-i18n'
import { useAsyncState } from '@vueuse/core'
import { queryLog } from '@/service/modules/log'
import { streamStateType } from '@/common/common'
import { useUISettingStore } from '@/store/ui-setting/ui-setting'
import Card from '@/components/card'
import LogModal from '@/components/log-modal'
import totalCount from '@/utils/tableTotalCount'
Expand All @@ -48,8 +47,6 @@ const BatchTaskInstance = defineComponent({
name: 'task-instance',
setup() {
let setIntervalP: number
const uiSettingStore = useUISettingStore()
const logTimer = uiSettingStore.getLogTimer
const { t, variables, getTableData, createColumns } = useTable()

const onUpdatePageSize = () => {
Expand Down Expand Up @@ -96,7 +93,7 @@ const BatchTaskInstance = defineComponent({
variables.showModalRef = false
}

const getLogs = (row: any, logTimer: number) => {
const getLogs = (row: any) => {
const { state } = useAsyncState(
queryLog({
taskInstanceId: Number(row.id),
Expand All @@ -105,18 +102,10 @@ const BatchTaskInstance = defineComponent({
}).then((res: any) => {
variables.logRef += res.message || ''
if (res && res.message !== '') {
variables.limit += 1000
variables.skipLineNum += res.lineNum
getLogs(row, logTimer)
getLogs(row)
} else {
variables.logLoadingRef = false
setTimeout(() => {
variables.logRef = ''
variables.limit = 1000
variables.skipLineNum = 0
variables.logLoadingRef = true
getLogs(row, logTimer)
}, logTimer * 1000)
}
}),
{}
Expand All @@ -129,7 +118,7 @@ const BatchTaskInstance = defineComponent({
variables.logRef = ''
variables.limit = 1000
variables.skipLineNum = 0
getLogs(row, logTimer)
getLogs(row)
}

const trim = getCurrentInstance()?.appContext.config.globalProperties.trim
Expand All @@ -154,7 +143,7 @@ const BatchTaskInstance = defineComponent({
() => variables.showModalRef,
() => {
if (variables.showModalRef) {
getLogs(variables.row, logTimer)
getLogs(variables.row)
} else {
variables.row = {}
variables.logRef = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ import './x6-style.scss'
import { queryLog } from '@/service/modules/log'
import { useAsyncState } from '@vueuse/core'
import utils from '@/utils'
import { useUISettingStore } from '@/store/ui-setting/ui-setting'
import { executeTask } from '@/service/modules/executors'
import DependenciesModal from '@/views/projects/components/dependencies/dependencies-modal'

Expand Down Expand Up @@ -88,9 +87,6 @@ export default defineComponent({
const route = useRoute()
const theme = useThemeStore()

const uiSettingStore = useUISettingStore()
const logTimer = uiSettingStore.getLogTimer

// Whether the graph can be operated
provide('readonly', toRef(props, 'readonly'))

Expand Down Expand Up @@ -246,12 +242,10 @@ export default defineComponent({
taskModalVisible.value = false
viewLog(taskId, taskType)

getLogs(logTimer)
getLogs()
}

let getLogsID: number

const getLogs = (logTimer: number) => {
const getLogs = () => {
const { state } = useAsyncState(
queryLog({
taskInstanceId: nodeVariables.logTaskId,
Expand All @@ -260,21 +254,10 @@ export default defineComponent({
}).then((res: any) => {
nodeVariables.logRef += res.message || ''
if (res && res.message !== '') {
nodeVariables.limit += 1000
nodeVariables.skipLineNum += res.lineNum
getLogs(logTimer)
getLogs()
} else {
nodeVariables.logLoadingRef = false
if (logTimer !== 0) {
if (typeof getLogsID === 'number') {
clearTimeout(getLogsID)
}
getLogsID = setTimeout(() => {
nodeVariables.limit += 1000
nodeVariables.skipLineNum += 1000
getLogs(logTimer)
}, logTimer * 1000)
}
}
}),
{}
Expand All @@ -283,11 +266,11 @@ export default defineComponent({
return state
}

const refreshLogs = (logTimer: number) => {
const refreshLogs = () => {
nodeVariables.logRef = ''
nodeVariables.limit = 1000
nodeVariables.skipLineNum = 0
getLogs(logTimer)
getLogs()
}

const handleExecuteTask = (
Expand Down
Loading