fix: The left asset tree refreshes every time a shortcut command is executed

This commit is contained in:
wangruidong 2024-06-21 17:59:53 +08:00 committed by w940853815
parent ad52d17bda
commit 77c1af3dcf
4 changed files with 7 additions and 7 deletions

View File

@ -86,7 +86,7 @@ export default {
callback: () => {
this.xterm.selectAll()
const text = this.xterm.getSelection()
const filename = `${this.$route.query?.type}_${this.$route.query?.taskId}.log`
const filename = `${this.xtermConfig?.type}_${this.xtermConfig?.taskId}.log`
downloadText(text, filename)
}
}

View File

@ -98,7 +98,7 @@ export default {
left: {
run: {
type: 'button',
name: this.$t('Run'),
name: '',
align: 'left',
icon: 'fa fa-play',
tip: this.$t('RunCommand'),
@ -112,7 +112,7 @@ export default {
},
stop: {
type: 'button',
name: this.$t('Stop'),
name: '',
align: 'left',
icon: 'fa fa-stop',
tip: this.$t('StopJob'),
@ -447,7 +447,7 @@ export default {
this.executionInfo.timeCost = 0
this.executionInfo.status = 'running'
this.currentTaskId = res.task_id
this.$router.replace({ query: { taskId: this.currentTaskId, type: 'shortcut_cmd' }})
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
this.setCostTimeInterval()
this.writeExecutionOutput()
this.setBtn()
@ -456,7 +456,7 @@ export default {
stop() {
StopJob({ task_id: this.currentTaskId }).then(() => {
this.xterm.write('\x1b[31m' +
this.$tc('ops.StopLogOutput').replace('currentTaskId', this.currentTaskId) + '\x1b[0m')
this.$tc('StopLogOutput').replace('currentTaskId', this.currentTaskId) + '\x1b[0m')
this.xterm.write(this.wrapperError(''))
this.getTaskStatus()
}).catch((e) => {

View File

@ -55,7 +55,7 @@ export default {
}
},
mounted() {
this.$axios.get('/api/v1/ops/variables/help').then((data) => {
this.$axios.get('/api/v1/ops/variables/help/').then((data) => {
this.variables = data
})
},

View File

@ -439,7 +439,7 @@ export default {
this.executionInfo.timeCost = 0
this.executionInfo.status = 'running'
this.currentTaskId = res.task_id
this.$router.replace({ query: { taskId: this.currentTaskId, type: 'file_upload' }})
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
this.setCostTimeInterval()
this.writeExecutionOutput()
}).catch(() => {