feat: 支持一键导出批量命令执行日志

This commit is contained in:
wangruidong
2024-03-07 16:58:23 +08:00
committed by w940853815
parent 64d2854e49
commit 18fc63b8c0

View File

@@ -25,6 +25,7 @@
import 'xterm/css/xterm.css'
import { Terminal } from 'xterm'
import { FitAddon } from 'xterm-addon-fit'
import { downloadText } from '@/utils/common'
export default {
name: 'Term',
@@ -75,6 +76,16 @@ export default {
callback: () => {
this.xterm.reset()
}
},
{
tip: this.$tc('common.Export'),
icon: 'download',
callback: () => {
this.xterm.selectAll()
const text = this.xterm.getSelection()
const filename = `shortcut_cmd_${this.$route.query?.taskId}.log`
downloadText(text, filename)
}
}
]
}