From 21f2cd40daafbd81e59c2192696f380f643fd8ec Mon Sep 17 00:00:00 2001 From: chaos-zhu Date: Wed, 29 Oct 2025 21:57:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=B3=E9=94=AE=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=87=8D=E6=96=B0=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../terminal/components/other-settings.vue | 32 +++++++------------ .../views/terminal/components/terminal.vue | 13 ++++++-- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/web/src/views/terminal/components/other-settings.vue b/web/src/views/terminal/components/other-settings.vue index a955758..09b0ba4 100644 --- a/web/src/views/terminal/components/other-settings.vue +++ b/web/src/views/terminal/components/other-settings.vue @@ -16,20 +16,16 @@ :show-message="false" > - - - - (Plus专属功能) - - + + + import { computed, getCurrentInstance } from 'vue' import useMobileWidth from '@/composables/useMobileWidth' -import PlusSupportTip from '@/components/common/PlusSupportTip.vue' const { proxy: { $store } } = getCurrentInstance() const { isMobileScreen } = useMobileWidth() @@ -87,7 +82,7 @@ const props = defineProps({ } }) -const emit = defineEmits(['update:show']) +const emit = defineEmits(['update:show',]) const visible = computed({ get: () => props.show, @@ -109,7 +104,6 @@ const autoShowContextMenu = computed({ set: (newVal) => $store.setTerminalSetting({ autoShowContextMenu: newVal }) }) -const isPlusActive = computed(() => $store.isPlusActive) diff --git a/web/src/views/terminal/components/terminal.vue b/web/src/views/terminal/components/terminal.vue index 7aa5d66..961c4a9 100644 --- a/web/src/views/terminal/components/terminal.vue +++ b/web/src/views/terminal/components/terminal.vue @@ -335,14 +335,14 @@ const reconnectTerminal = (isCommonTips = false, tips) => { socket.value = null socketConnected.value = false if (isCommonTips) { - if (isPlusActive.value && autoReconnect.value) { + if (autoReconnect.value) { term.value.write(`\r\n\x1b[91m${ tips },自动重连中...\x1b[0m \r\n`) connectIO() } else { term.value.write(`\r\n\x1b[91mError: ${ tips },请重新连接。([终端设置->其他设置]中开启自动重连)\x1b[0m \r\n`) } } else { - term.value.write(`\n${ tips } \n`) + term.value.write(`\r\n\x1b[91m${ tips }\x1b[0m \r\n`) connectIO() } } @@ -633,6 +633,14 @@ const handleRightClick = async (e) => { handleClear() } } + const reconnect = { + label: '重新连接', + onClick: () => { + reconnectTerminal(false, '重新连接中...') + term.value.clearSelection() + focusTab() + } + } const dockerId = isDockerId(str) ? { label: 'docker容器ID', children: [ @@ -755,6 +763,7 @@ const handleRightClick = async (e) => { pasteSelection, search, clear, + reconnect, dockerId, dockerComposeYml, ].filter(Boolean)