|
46 | 46 | /> |
47 | 47 |
|
48 | 48 | <!-- 连接提示 --> |
49 | | - <div v-if="isConnecting" class="connection-status-overlay"> |
50 | | - <div class="connecting-card"> |
51 | | - <div class="spinner-container"> |
52 | | - <div class="pulse-ring"></div> |
53 | | - <el-icon class="is-loading" size="32" color="#409eff"><Loading /></el-icon> |
54 | | - </div> |
55 | | - <h3 class="connecting-title">正在建立安全连接</h3> |
56 | | - <p class="connecting-desc">正在向目标服务器发起 SSH 连接请求...</p> |
57 | | - </div> |
58 | | - </div> |
| 49 | + <ConnectingOverlay |
| 50 | + :visible="isConnecting" |
| 51 | + :subtitle="connectionDisplay" |
| 52 | + /> |
59 | 53 |
|
60 | 54 | <!-- 连接状态提示 --> |
61 | 55 | <div v-if="connectionError" class="connection-error"> |
|
95 | 89 | <script setup> |
96 | 90 | import { ref, computed, onMounted, onUnmounted, nextTick, watch } from 'vue' |
97 | 91 | import { useRouter } from 'vue-router' |
98 | | -import { ArrowLeft, Connection, Close, Delete, Monitor, Folder, Document, Edit, Select, Tickets, Loading } from '@element-plus/icons-vue' |
| 92 | +import { ArrowLeft, Connection, Close, Delete, Monitor, Folder, Document, Edit, Select, Tickets } from '@element-plus/icons-vue' |
99 | 93 | import { useAuthStore } from '@/stores/auth' |
100 | 94 | import { useQuickSftp } from '@/composables/useQuickSftp' |
101 | 95 | import { ElMessage } from 'element-plus' |
102 | 96 | import QuickSftpFileManager from '@/components/QuickSftpFileManager.vue' |
103 | 97 | import CommandLibrary from '@/components/CommandLibrary.vue' |
104 | 98 | import TerminalStatusBar from '@/components/TerminalStatusBar.vue' |
105 | 99 | import XtermTerminal from '@/components/XtermTerminal.vue' |
| 100 | +import ConnectingOverlay from '@/components/ConnectingOverlay.vue' |
106 | 101 | import { io } from 'socket.io-client' |
107 | 102 |
|
108 | 103 | const props = defineProps({ |
@@ -456,72 +451,7 @@ onUnmounted(() => { |
456 | 451 | text-align: center; |
457 | 452 | } |
458 | 453 |
|
459 | | -/* 现代化连接状态遮罩层 */ |
460 | | -.connection-status-overlay { |
461 | | - position: absolute; |
462 | | - top: 0; |
463 | | - left: 0; |
464 | | - right: 0; |
465 | | - bottom: 0; |
466 | | - background-color: rgba(30, 30, 30, 0.75); |
467 | | - backdrop-filter: blur(8px); |
468 | | - display: flex; |
469 | | - justify-content: center; |
470 | | - align-items: center; |
471 | | - z-index: 50; |
472 | | - animation: fadeIn 0.3s ease; |
473 | | -} |
474 | | -
|
475 | | -.connecting-card { |
476 | | - background: linear-gradient(145deg, #2a2a2d, #222225); |
477 | | - border: 1px solid rgba(255, 255, 255, 0.08); |
478 | | - border-radius: 16px; |
479 | | - padding: 40px; |
480 | | - display: flex; |
481 | | - flex-direction: column; |
482 | | - align-items: center; |
483 | | - box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4); |
484 | | - transform: translateY(-20px); |
485 | | -} |
486 | | -
|
487 | | -.spinner-container { |
488 | | - position: relative; |
489 | | - width: 80px; |
490 | | - height: 80px; |
491 | | - display: flex; |
492 | | - justify-content: center; |
493 | | - align-items: center; |
494 | | - margin-bottom: 24px; |
495 | | -} |
496 | | -
|
497 | | -.pulse-ring { |
498 | | - position: absolute; |
499 | | - width: 100%; |
500 | | - height: 100%; |
501 | | - border-radius: 50%; |
502 | | - border: 2px solid #409eff; |
503 | | - animation: pulse 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) infinite; |
504 | | - opacity: 0; |
505 | | -} |
506 | | -
|
507 | | -@keyframes pulse { |
508 | | - 0% { transform: scale(0.5); opacity: 0.8; } |
509 | | - 100% { transform: scale(1.5); opacity: 0; } |
510 | | -} |
511 | | -
|
512 | | -.connecting-title { |
513 | | - color: #ffffff; |
514 | | - font-size: 18px; |
515 | | - font-weight: 500; |
516 | | - margin: 0 0 8px 0; |
517 | | - letter-spacing: 0.5px; |
518 | | -} |
519 | | -
|
520 | | -.connecting-desc { |
521 | | - color: #909399; |
522 | | - font-size: 13px; |
523 | | - margin: 0; |
524 | | -} |
| 454 | +/* ConnectingOverlay 已提取为独立组件 ConnectingOverlay.vue */ |
525 | 455 |
|
526 | 456 | .prompt-content { |
527 | 457 | color: #909399; |
|
0 commit comments