mirror of
https://github.com/jumpserver/lina.git
synced 2025-10-21 07:29:02 +00:00
feat: 支持一键导出批量命令执行日志
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user