This commit is contained in:
Baobhan Sith
2025-05-10 11:10:34 +08:00
parent 3605ce0aee
commit 43aec26632
3 changed files with 1 additions and 4 deletions
@@ -192,12 +192,10 @@ export class SshSuspendService extends EventEmitter {
* @returns Promise<SuspendedSessionInfo[]> 挂起会话信息的数组。
*/
async listSuspendedSessions(userId: number): Promise<SuspendedSessionInfo[]> {
console.log(`[SshSuspendService DEBUG] listSuspendedSessions: Called for userId=${userId}`);
const userSessions = this.getUserSessions(userId);
const sessionsInfo: SuspendedSessionInfo[] = [];
for (const [suspendSessionId, details] of userSessions.entries()) {
console.log(`[SshSuspendService DEBUG] listSuspendedSessions: Processing suspendSessionId=${suspendSessionId}, status=${details.backendSshStatus}`);
sessionsInfo.push({
suspendSessionId,
connectionName: details.connectionName,
@@ -23,7 +23,6 @@ export class SshSuspendController {
return;
}
console.log(`[SshSuspendController] getSuspendedSshSessions called for user ID: ${userId}`);
const sessions: SuspendedSessionInfo[] = await sshSuspendService.listSuspendedSessions(userId);
res.status(200).json(sessions);
@@ -256,7 +256,7 @@ export function createSshTerminalManager(sessionId: string, wsDeps: SshTerminalD
return; // 忽略不属于此会话的消息
}
console.log(`[会话 ${sessionId}][SSH终端模块] SSH 会话已连接。`);
console.log(`[会话 ${sessionId}][SSH终端模块] SSH 会话已连接。 Payload:`, payload, 'Full message:', message); // 更详细的日志
isSshConnected.value = true; // 更新状态
// 连接成功后聚焦终端
terminalInstance.value?.focus();