perf: Refactor error handling and improve parameter assignment in job forms

This commit is contained in:
w940853815
2025-11-14 16:03:48 +08:00
committed by wrd
parent c1dcea1b29
commit 2ae3e06484
3 changed files with 11 additions and 9 deletions

View File

@@ -515,6 +515,8 @@ export default {
this.setBtn()
this.selectAssets = assets
this.selectNodes = nodes
}).catch(() => {
this.lastRequestPayload = null
})
},
viewConfirmRunAssets() {
@@ -525,8 +527,8 @@ export default {
.then(() => {
this.xterm.write(
'\x1b[31m' +
this.$tc('StopLogOutput').replace('currentTaskId', this.currentTaskId) +
'\x1b[0m'
this.$tc('StopLogOutput').replace('currentTaskId', this.currentTaskId) +
'\x1b[0m'
)
this.xterm.write(this.wrapperError(''))
this.getTaskStatus()

View File

@@ -441,8 +441,7 @@ export default {
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
this.setCostTimeInterval()
this.writeExecutionOutput()
}).catch((error) => {
this.$message.error(this.$tc('Error'), error)
}).catch(() => {
this.execute_stop()
})
})

View File

@@ -224,11 +224,12 @@ export default {
title: this.$t('ExecuteAfterSaving'),
callback: (value, form, btn) => {
form.value.run_after_save = true
const parameters = form.value.variable.reduce((acc, item) => {
acc[item.var_name] = item.default_value || ''
return acc
}, {})
form.value['parameters'] = parameters
if (form.value?.variable) {
form.value['parameters'] = form.value.variable.reduce((acc, item) => {
acc[item.var_name] = item.default_value || ''
return acc
}, {})
}
this.submitForm(form, btn)
}
}