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: () => { callback: () => {
this.xterm.selectAll() this.xterm.selectAll()
const text = this.xterm.getSelection() 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) downloadText(text, filename)
} }
} }

View File

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

View File

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

View File

@ -439,7 +439,7 @@ export default {
this.executionInfo.timeCost = 0 this.executionInfo.timeCost = 0
this.executionInfo.status = 'running' this.executionInfo.status = 'running'
this.currentTaskId = res.task_id 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.setCostTimeInterval()
this.writeExecutionOutput() this.writeExecutionOutput()
}).catch(() => { }).catch(() => {