This commit is contained in:
Baobhan Sith
2025-05-10 00:00:31 +08:00
parent 36afe3d5c2
commit c36e961426
29 changed files with 2268 additions and 41 deletions
@@ -1,4 +1,5 @@
import { ref, readonly, type Ref, ComputedRef } from 'vue';
import { useI18n } from 'vue-i18n'; // +++ Add import for useI18n +++
// import { useWebSocketConnection } from './useWebSocketConnection'; // 移除全局导入
import type { Terminal } from 'xterm';
import type { SearchAddon, ISearchOptions } from '@xterm/addon-search'; // *** 移除 ISearchResult 导入 ***
@@ -18,7 +19,7 @@ export interface SshTerminalDependencies {
* @param t i18n 翻译函数,从父组件传入
* @returns SSH 终端管理器实例
*/
export function createSshTerminalManager(sessionId: string, wsDeps: SshTerminalDependencies, t: Function) {
export function createSshTerminalManager(sessionId: string, wsDeps: SshTerminalDependencies, t: ReturnType<typeof useI18n>['t']) { // +++ Update type of t +++
// 使用依赖注入的 WebSocket 函数
const { sendMessage, onMessage, isConnected } = wsDeps;