From 04327c19e307daa8b3da98b1c22ed65a1b783ee4 Mon Sep 17 00:00:00 2001 From: lijiahang Date: Wed, 18 Dec 2024 09:49:59 +0800 Subject: [PATCH] =?UTF-8?q?:hammer:=20=E5=91=BD=E4=BB=A4=E5=8F=91=E9=80=81?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/store/modules/terminal/index.ts | 11 +++++ .../terminal/components/command-bar/index.vue | 47 +++++++++++++++---- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/orion-visor-ui/src/store/modules/terminal/index.ts b/orion-visor-ui/src/store/modules/terminal/index.ts index 75088f2c..60371420 100644 --- a/orion-visor-ui/src/store/modules/terminal/index.ts +++ b/orion-visor-ui/src/store/modules/terminal/index.ts @@ -274,6 +274,17 @@ export default defineStore('terminal', { } }, + // 粘贴命令到会话 + pasteCommandToSession(session: ISshSession | undefined, command: string, newLine: boolean = false) { + const handler = session?.handler; + if (handler && handler.enabledStatus('pasteOrigin')) { + if (newLine) { + command = `${command}\r\n`; + } + handler.pasteOrigin(command); + } + }, + }, }); diff --git a/orion-visor-ui/src/views/host/terminal/components/command-bar/index.vue b/orion-visor-ui/src/views/host/terminal/components/command-bar/index.vue index bd9d323a..fbc2dfff 100644 --- a/orion-visor-ui/src/views/host/terminal/components/command-bar/index.vue +++ b/orion-visor-ui/src/views/host/terminal/components/command-bar/index.vue @@ -3,15 +3,26 @@
- + - 粘贴 + title="直接发送到终端" + @click="write(false)"> + 发送 + + + 执行 + + 清空 @@ -34,8 +45,8 @@
@@ -49,19 +60,37 @@