mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
perf: Refactor error handling and improve parameter assignment in job forms
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user