diff --git a/src/components/Widgets/Term/index.vue b/src/components/Widgets/Term/index.vue index 365b88869..57668df00 100644 --- a/src/components/Widgets/Term/index.vue +++ b/src/components/Widgets/Term/index.vue @@ -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) + } } ] }