@@ -132,17 +95,14 @@
@@ -722,7 +324,7 @@ onUnmounted(() => {
.terminal-page {
height: 100%;
overflow: hidden;
- background-color: #1e1e1e;
+ background-color: #1c1c1e;
display: flex;
flex-direction: column;
}
@@ -731,7 +333,7 @@ onUnmounted(() => {
height: 100%;
display: flex;
flex-direction: column;
- background-color: #1e1e1e;
+ background-color: #1c1c1e;
}
.terminal-header {
@@ -930,49 +532,6 @@ onUnmounted(() => {
font-weight: normal;
}
-/* 右键菜单样式 */
-.context-menu {
- position: fixed;
- background: #2d2d30;
- border: 1px solid #3e3e42;
- border-radius: 4px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
- z-index: 1000;
- min-width: 120px;
- padding: 4px 0;
- animation: fadeIn 0.15s ease-in-out;
-}
-
-@keyframes fadeIn {
- from { opacity: 0; transform: scale(0.95); }
- to { opacity: 1; transform: scale(1); }
-}
-
-.menu-item {
- display: flex;
- align-items: center;
- padding: 8px 16px;
- cursor: pointer;
- color: #ffffff;
- font-size: 13px;
- transition: background-color 0.2s ease;
- gap: 8px;
-}
-
-.menu-item:hover {
- background-color: rgba(58, 134, 255, 0.2);
-}
-
-.menu-item.disabled {
- color: #6c6c6c;
- cursor: not-allowed;
-}
-
-.menu-item.clickable:hover {
- background-color: #f0f2f5;
- color: var(--el-color-primary);
-}
-
/* 常用命令抽屉样式 */
.command-list-container {
display: flex;
@@ -1090,176 +649,11 @@ onUnmounted(() => {
color: #303133;
}
-.menu-divider {
- height: 1px;
- background-color: #3e3e42;
- margin: 4px 0;
-}
-
-.menu-item .el-icon {
+.cmd-name {
font-size: 14px;
- width: 16px;
+ font-weight: 500;
+ color: #303133;
}
-
-
-/* XTerm.js 样式调整 */
-:deep(.xterm) {
- padding: 10px;
- position: relative;
-}
-
-:deep(.xterm-viewport) {
- background-color: #1e1e1e !important;
-}
-
-:deep(.xterm-screen) {
- background-color: #1e1e1e !important;
-}
-
-/* 强制在 xterm-screen 后方追加一段空白,确保滚动到底部时有足够间距 */
-:deep(.xterm-screen::after) {
- content: "";
- display: block;
- height: 32px;
- width: 100%;
-}
-
-:deep(.xterm-helper-textarea) {
- opacity: 0 !important;
- color: transparent !important;
- caret-color: transparent !important;
- resize: none !important;
- outline: none !important;
- border: none !important;
- padding: 0 !important;
- margin: 0 !important;
-}
-
-.copy-button {
- transition: all 0.3s ease;
-}
-
-.copy-button.copied {
- background-color: rgba(58, 134, 255, 0.3) !important;
- border-color: rgba(58, 134, 255, 0.8) !important;
- color: #ffffff !important;
- transform: scale(1.05);
- box-shadow: 0 0 15px rgba(58, 134, 255, 0.4);
-}
-
-.copy-button:hover {
- background-color: rgba(58, 134, 255, 0.1);
- border-color: rgba(58, 134, 255, 0.6);
-}
-
-:deep(.xterm .xterm-selection) {
- background-color: rgba(58, 134, 255, 0.2) !important;
- border-radius: 2px;
- mix-blend-mode: screen;
-}
-
-:deep(.xterm) {
- padding: 0 !important;
- overflow: hidden !important;
- position: relative !important;
- height: 100% !important;
- width: 100% !important;
- display: flex !important;
- flex-direction: column !important;
-}
-
-:deep(.xterm-screen) {
- background-color: #1e1e1e !important;
- width: 100% !important;
- height: 100% !important;
- display: flex !important;
- flex-direction: column !important;
-}
-
-:deep(.xterm-viewport) {
- background-color: #1e1e1e !important;
- overflow-y: auto !important;
- overflow-x: hidden !important;
- scrollbar-width: thin;
- scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
- position: relative !important;
- direction: ltr !important;
- width: 100% !important;
- height: 100% !important;
- pointer-events: auto !important;
-}
-
-:deep(.xterm-viewport::-webkit-scrollbar) {
- width: 12px;
-}
-
-:deep(.xterm-viewport::-webkit-scrollbar-track) {
- background: rgba(255, 255, 255, 0.05);
- border-radius: 6px;
- margin: 2px;
-}
-
-:deep(.xterm-viewport::-webkit-scrollbar-thumb) {
- background: rgba(255, 255, 255, 0.3);
- border-radius: 6px;
- border: 2px solid transparent;
- background-clip: content-box;
- transition: background 0.2s ease;
-}
-
-:deep(.xterm-viewport::-webkit-scrollbar-thumb:hover) {
- background: rgba(255, 255, 255, 0.5);
-}
-
-:deep(.xterm-viewport::-webkit-scrollbar-thumb:active) {
- background: rgba(255, 255, 255, 0.7);
-}
-
-:deep(.xterm-screen) {
- overflow: visible !important;
- width: 100% !important;
- height: 100% !important;
- background-color: #1e1e1e !important;
-}
-
-:deep(.xterm-scroll-area) {
- overflow: visible !important;
-}
-
-:deep(.xterm-char-measure-element) {
- position: absolute !important;
- left: -9999px !important;
- top: -9999px !important;
- visibility: hidden !important;
- width: auto !important;
- height: auto !important;
- opacity: 0 !important;
- pointer-events: none !important;
-}
-
-.terminal {
- position: relative;
- overflow: hidden;
- pointer-events: auto !important;
- height: 100%;
- width: 100%;
- background-color: #1e1e1e !important;
- display: flex;
- flex-direction: column;
-}
-
-:deep(.xterm-rows) {
- color: #ffffff !important;
- background-color: #1e1e1e !important;
-}
-
-:deep(.xterm-row) {
- color: #ffffff !important;
- background-color: #1e1e1e !important;
-}
-
-:deep(.xterm-selection-layer) {
- background-color: rgba(54,99,181,0.35) !important;
-}
+/* Command list and other specific QuickConnect styles */
diff --git a/frontend/src/views/Terminal.vue b/frontend/src/views/Terminal.vue
index 4e815eb..a45cc81 100644
--- a/frontend/src/views/Terminal.vue
+++ b/frontend/src/views/Terminal.vue
@@ -41,51 +41,13 @@
-
-
-
-
+ :is-connected="terminalStore.isConnected"
+ @data="handleTerminalData"
+ @resize="handleTerminalResize"
+ @selection-change="hasSelection = $event"
+ />
@@ -136,11 +98,7 @@
@@ -937,74 +498,6 @@ onUnmounted(() => {
font-weight: normal;
}
-/* 右键菜单样式 */
-.context-menu {
- position: fixed;
- background: #2d2d30;
- border: 1px solid #3e3e42;
- border-radius: 4px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
- z-index: 1000;
- min-width: 120px;
- padding: 4px 0;
- animation: fadeIn 0.15s ease-in-out;
-}
-
-@keyframes fadeIn {
- from { opacity: 0; transform: scale(0.95); }
- to { opacity: 1; transform: scale(1); }
-}
-
-.menu-item {
- display: flex;
- align-items: center;
- padding: 8px 16px;
- cursor: pointer;
- color: #ffffff;
- font-size: 13px;
- transition: background-color 0.2s ease;
- gap: 8px;
-}
-
-.menu-item:hover {
- background-color: rgba(58, 134, 255, 0.2);
-}
-
-.menu-item.disabled {
- color: #6c6c6c;
- cursor: not-allowed;
-}
-
-.menu-item.disabled:hover {
- background-color: transparent;
-}
-
-.menu-divider {
- height: 1px;
- background-color: #3e3e42;
- margin: 4px 0;
-}
-
-.menu-item .el-icon {
- font-size: 14px;
- width: 16px;
-}
-
-
-
-/* XTerm.js 样式调整 */
-:deep(.xterm) {
- padding: 10px;
- position: relative;
-}
-
-:deep(.xterm-viewport) {
- background-color: #1e1e1e !important;
-}
-
-:deep(.xterm-screen) {
- background-color: #1e1e1e !important;
-}
/* xterm-helper-textarea: 仅隐藏视觉,保留事件监听能力(IME 修复需要) */
:deep(.xterm-helper-textarea) {
diff --git a/frontend/src/views/TerminalNew.vue b/frontend/src/views/TerminalNew.vue
index 6912df0..42ed972 100644
--- a/frontend/src/views/TerminalNew.vue
+++ b/frontend/src/views/TerminalNew.vue
@@ -1392,33 +1392,47 @@ onUnmounted(() => {
background: rgba(255, 255, 255, 0.5);
}
+/* 右键菜单样式 - Apple MacOS 风格 */
.context-menu {
position: fixed;
- background: #2d2d30;
- border: 1px solid #3e3e42;
- border-radius: 4px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
+ background: rgba(30, 30, 30, 0.75);
+ backdrop-filter: blur(20px) saturate(180%);
+ -webkit-backdrop-filter: blur(20px) saturate(180%);
+ border: 1px solid rgba(255, 255, 255, 0.1);
+ border-radius: 8px;
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
z-index: 1000;
- min-width: 160px;
+ min-width: 140px;
padding: 6px 0;
+ animation: fadeIn 0.15s ease-in-out;
+}
+
+@keyframes fadeIn {
+ from { opacity: 0; transform: scale(0.95) translateY(-2px); }
+ to { opacity: 1; transform: scale(1) translateY(0); }
}
.menu-item {
display: flex;
align-items: center;
- padding: 8px 16px;
+ padding: 6px 12px;
+ margin: 2px 6px;
cursor: pointer;
- color: #ffffff;
+ color: #f5f5f5;
font-size: 13px;
- transition: background-color 0.2s ease;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
+ border-radius: 6px;
+ transition: all 0.1s ease;
+ gap: 10px;
}
.menu-item:hover {
- background-color: rgba(58, 134, 255, 0.2);
+ background-color: #0a84ff; /* Apple Blue */
+ color: #ffffff;
}
.menu-item.disabled {
- color: #6c6c6c;
+ color: rgba(255, 255, 255, 0.3);
cursor: not-allowed;
}