修复工作流404问题

This commit is contained in:
xlsea 2024-01-26 14:41:37 +08:00
parent 4fb9ac010a
commit 71e0a024e1
4 changed files with 47 additions and 39 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,8 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Easy Retry</title> <title>Easy Retry</title>
<script type="module" crossorigin src="./assets/D95t2zJ0.js"></script> <script type="module" crossorigin src="./assets/nqxcaVpR.js"></script>
<link rel="stylesheet" crossorigin href="./assets/i0Vr07RR.css"> <link rel="stylesheet" crossorigin href="./assets/eHB570AZ.css">
</head> </head>
<body> <body>

View File

@ -81,6 +81,7 @@ export default {
interval: null, interval: null,
startId: 0, startId: 0,
fromIndex: 0, fromIndex: 0,
controller: new AbortController(),
indicator: <a-icon type="loading" style="font-size: 24px; color: '#d9d9d9'" spin/>, indicator: <a-icon type="loading" style="font-size: 24px; color: '#d9d9d9'" spin/>,
LevelEnum: { LevelEnum: {
DEBUG: { DEBUG: {
@ -104,46 +105,53 @@ export default {
}, },
mounted () { mounted () {
this.getLogList() this.getLogList()
this.interval = setInterval(() => { },
this.getLogList() beforeDestroy () {
}, 1000) this.stopLog()
}, },
methods: { methods: {
onCancel () { onCancel () {
clearInterval(this.interval) this.stopLog()
this.$emit('update:open', false) this.$emit('update:open', false)
}, },
stopLog () {
this.finished = true
this.controller.abort()
clearTimeout(this.interval)
this.interval = undefined
},
getLogList () { getLogList () {
if (!this.finished) { request(
request( {
{ url: '/job/log/list',
url: '/job/log/list', method: 'get',
method: 'get', params: {
params: { taskBatchId: this.record.taskBatchId,
taskBatchId: this.record.taskBatchId, jobId: this.record.jobId,
jobId: this.record.jobId, taskId: this.record.id,
taskId: this.record.id, startId: this.startId,
startId: this.startId, fromIndex: this.fromIndex,
fromIndex: this.fromIndex, size: 50
size: 50 },
} signal: this.controller.signal
}
)
.then((res) => {
this.finished = res.data.finished
this.startId = res.data.nextStartId
this.fromIndex = res.data.fromIndex
if (res.data.message) {
this.logList.push(...res.data.message)
this.logList.sort((a, b) => a.time_stamp - b.time_stamp)
} }
) if (!this.finished) {
.then((res) => { clearTimeout(this.interval)
this.finished = res.data.finished this.interval = setTimeout(this.getLogList, 1000)
this.startId = res.data.nextStartId }
this.fromIndex = res.data.fromIndex })
if (res.data.message) { .catch(() => {
this.logList.push(...res.data.message) this.finished = true
this.logList.sort((a, b) => a.time_stamp - b.time_stamp) })
}
})
.catch(() => {
this.finished = true
})
} else {
clearInterval(this.interval)
}
}, },
timestampToDate (timestamp) { timestampToDate (timestamp) {
const date = new Date(Number.parseInt(timestamp.toString())) const date = new Date(Number.parseInt(timestamp.toString()))