feat: 添加标签管理模态框

This commit is contained in:
Baobhan Sith
2025-05-11 11:20:26 +08:00
parent 1eb1efde72
commit 598df938bf
40 changed files with 634 additions and 170 deletions
+4 -4
View File
@@ -18,15 +18,15 @@ import {
SshSuspendAutoTerminatedNotification,
SshMarkForSuspendRequest,
SshMarkedForSuspendAck,
SshUnmarkForSuspendRequest, // +++ 新增导入 +++
SshUnmarkedForSuspendAck, // +++ 新增导入 +++
SshUnmarkForSuspendRequest,
SshUnmarkedForSuspendAck,
ClientState
} from './types';
import { SshSuspendService } from '../services/ssh-suspend.service';
import { SftpService } from '../services/sftp.service';
import { cleanupClientConnection } from './utils';
import { clientStates } from './state';
import { temporaryLogStorageService } from '../services/temporary-log-storage.service'; // +++ 新增导入
import { temporaryLogStorageService } from '../services/temporary-log-storage.service';
// Handlers
import { handleRdpProxyConnection } from './handlers/rdp.handler';
@@ -233,7 +233,7 @@ export function initializeConnectionHandler(wss: WebSocketServer, sshSuspendServ
// console.warn(`[WebSocket Handler][${type}] WebSocket 在发送 SSH_OUTPUT_CACHED_CHUNK 前已关闭 (会话 ${newFrontendSessionId})。`);
}
// +++ 新增:发送 ssh:connected 消息 +++
// +++ 发送 ssh:connected 消息 +++
if (ws.readyState === WebSocket.OPEN) {
ws.send(JSON.stringify({
type: 'ssh:connected',
@@ -4,7 +4,7 @@ import { AuthenticatedWebSocket, ClientState } from '../types';
import { clientStates, sftpService, statusMonitorService, auditLogService, notificationService } from '../state';
import * as SshService from '../../services/ssh.service';
import { cleanupClientConnection } from '../utils';
import { temporaryLogStorageService } from '../../services/temporary-log-storage.service'; // +++ 新增导入
import { temporaryLogStorageService } from '../../services/temporary-log-storage.service';
import { startDockerStatusPolling } from './docker.handler';
import WebSocket from 'ws';
+4 -4
View File
@@ -110,7 +110,7 @@ export interface SshMarkForSuspendRequest {
type: "SSH_MARK_FOR_SUSPEND";
payload: {
sessionId: string; // The ID of the active SSH session to be marked
initialBuffer?: string; // +++ 新增:可选的初始屏幕缓冲区内容 +++
initialBuffer?: string; // +++ 可选的初始屏幕缓冲区内容 +++
};
}
@@ -205,7 +205,7 @@ export interface SshMarkedForSuspendAck {
};
}
export interface SshUnmarkedForSuspendAck { // +++ 新增 S2C 类型 +++
export interface SshUnmarkedForSuspendAck { // +++ S2C 类型 +++
type: "SSH_UNMARKED_FOR_SUSPEND_ACK";
payload: {
sessionId: string; // The ID of the session that was unmarked
@@ -231,7 +231,7 @@ export type SshSuspendClientToServerMessages =
| SshSuspendRemoveEntryRequest
| SshSuspendEditNameRequest
| SshMarkForSuspendRequest
| SshUnmarkForSuspendRequest; // +++ 新增到联合类型 +++
| SshUnmarkForSuspendRequest;
// Union type for all server-to-client messages for SSH Suspend
export type SshSuspendServerToClientMessages =
@@ -244,7 +244,7 @@ export type SshSuspendServerToClientMessages =
| SshSuspendNameEditedResponse
| SshSuspendAutoTerminatedNotification
| SshMarkedForSuspendAck
| SshUnmarkedForSuspendAck; // +++ 新增到联合类型 +++
| SshUnmarkedForSuspendAck;
// It might be useful to have a general type for incoming messages if not already present
// For example, if you have a main message handler:
+2 -2
View File
@@ -2,9 +2,9 @@ import { PortInfo, ClientState } from './types';
import { SftpService } from '../services/sftp.service';
import { StatusMonitorService } from '../services/status-monitor.service';
import { clientStates, sftpService, statusMonitorService } from './state';
import { sshSuspendService } from '../services/ssh-suspend.service'; // +++ 新增导入 +++
import { sshSuspendService } from '../services/ssh-suspend.service';
// --- 新增:解析 Ports 字符串的辅助函数 ---
// --- 解析 Ports 字符串的辅助函数 ---
export function parsePortsString(portsString: string | undefined | null): PortInfo[] {
if (!portsString) {
return [];