调整代码结构
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as appearanceService from '../services/appearance.service';
|
||||
import * as appearanceService from './appearance.service';
|
||||
import { UpdateAppearanceDto } from '../types/appearance.types';
|
||||
import multer from 'multer';
|
||||
import path from 'path';
|
||||
|
||||
@@ -8,7 +8,7 @@ import { AuditLogService } from '../services/audit.service';
|
||||
import { ipBlacklistService } from '../services/ip-blacklist.service';
|
||||
import { captchaService } from '../services/captcha.service';
|
||||
import { settingsService } from '../services/settings.service';
|
||||
import { passkeyService } from '../services/passkey.service'; // +++ Passkey Service
|
||||
import { passkeyService } from '../passkey/passkey.service'; // +++ Passkey Service
|
||||
import { passkeyRepository } from '../passkey/passkey.repository'; // +++ Passkey Repository
|
||||
import { userRepository } from '../user/user.repository'; // For passkey auth success
|
||||
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
import * as ConnectionRepository from '../connections/connection.repository';
|
||||
import * as ConnectionRepository from './connection.repository';
|
||||
import { encrypt, decrypt } from '../utils/crypto';
|
||||
import { AuditLogService } from './audit.service';
|
||||
import * as SshKeyService from './ssh_key.service';
|
||||
import { AuditLogService } from '../audit/audit.service';
|
||||
import * as SshKeyService from '../ssh_keys/ssh_key.service';
|
||||
import {
|
||||
ConnectionBase,
|
||||
ConnectionWithTags,
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as ConnectionService from '../services/connection.service';
|
||||
import * as ConnectionService from './connection.service';
|
||||
import * as SshService from '../services/ssh.service';
|
||||
import * as GuacamoleService from '../services/guacamole.service';
|
||||
import * as ImportExportService from '../services/import-export.service';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { DockerService, DockerCommand } from '../services/docker.service';
|
||||
import { DockerService, DockerCommand } from './docker.service';
|
||||
|
||||
// 由于没有 typedi,我们将手动实例化服务或通过其他方式获取实例
|
||||
// 简单起见,这里直接 new 一个实例。在实际项目中,可能需要更复杂的实例管理。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as FavoritePathsService from '../services/favorite-paths.service';
|
||||
import { FavoritePathSortBy } from '../services/favorite-paths.service';
|
||||
import * as FavoritePathsService from '../favorite-paths/favorite-paths.service';
|
||||
import { FavoritePathSortBy } from '../favorite-paths/favorite-paths.service';
|
||||
|
||||
/**
|
||||
* 处理添加新收藏路径的请求
|
||||
|
||||
@@ -62,7 +62,7 @@ import { ipWhitelistMiddleware } from './auth/ipWhitelist.middleware';
|
||||
|
||||
import './services/event.service';
|
||||
import './services/notification.processor.service';
|
||||
import './services/notification.dispatcher.service';
|
||||
import './notifications/notification.dispatcher.service';
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import type {
|
||||
// and for verification.authenticationInfo is AuthenticationInfo.
|
||||
// We will rely on TypeScript's inference from the VerifiedRegistrationResponse/VerifiedAuthenticationResponse types.
|
||||
} from '@simplewebauthn/server';
|
||||
import { passkeyRepository, Passkey, NewPasskey } from '../passkey/passkey.repository';
|
||||
import { passkeyRepository, Passkey, NewPasskey } from './passkey.repository';
|
||||
import { userRepository, User } from '../user/user.repository';
|
||||
import { config } from '../config/app.config';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as QuickCommandTagService from '../services/quick-command-tag.service';
|
||||
import * as QuickCommandTagService from './quick-command-tag.service';
|
||||
|
||||
/**
|
||||
* 处理获取所有快捷指令标签的请求
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Request, Response } from 'express';
|
||||
import { settingsService } from '../services/settings.service';
|
||||
import { AuditLogService } from '../services/audit.service';
|
||||
import { NotificationService } from '../services/notification.service';
|
||||
import { ipBlacklistService } from '../services/ip-blacklist.service';
|
||||
import { settingsService } from './settings.service';
|
||||
import { AuditLogService } from '../audit/audit.service';
|
||||
import { NotificationService } from '../notifications/notification.service';
|
||||
import { ipBlacklistService } from '../auth/ip-blacklist.service';
|
||||
import { exportConnectionsAsEncryptedZip } from '../services/import-export.service';
|
||||
import { UpdateSidebarConfigDto, UpdateCaptchaSettingsDto, CaptchaSettings } from '../types/settings.types';
|
||||
import { AppearanceSettings, UpdateAppearanceDto } from '../types/appearance.types';
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as crypto from 'crypto';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Client, ConnectConfig, SFTPWrapper } from 'ssh2';
|
||||
import { InitiateTransferPayload, TransferTask, TransferSubTask } from './transfers.types';
|
||||
import { getConnectionWithDecryptedCredentials } from '../services/connection.service';
|
||||
import { getConnectionWithDecryptedCredentials } from '../connections/connection.service';
|
||||
import type { ConnectionWithTags, DecryptedConnectionCredentials } from '../types/connection.types';
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { initializeUpgradeHandler } from './websocket/upgrade';
|
||||
import { initializeConnectionHandler } from './websocket/connection';
|
||||
import { clientStates } from './websocket/state';
|
||||
import { sshSuspendService } from './services/ssh-suspend.service';
|
||||
import { SftpService } from './services/sftp.service';
|
||||
import { SftpService } from './sftp/sftp.service';
|
||||
import { cleanupClientConnection } from './websocket/utils';
|
||||
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ import {
|
||||
ClientState
|
||||
} from './types';
|
||||
import { SshSuspendService } from '../services/ssh-suspend.service';
|
||||
import { SftpService } from '../services/sftp.service';
|
||||
import { SftpService } from '../sftp/sftp.service';
|
||||
import { cleanupClientConnection } from './utils';
|
||||
import { clientStates } from './state';
|
||||
import { temporaryLogStorageService } from '../services/temporary-log-storage.service';
|
||||
import { temporaryLogStorageService } from '../ssh-suspend/temporary-log-storage.service';
|
||||
|
||||
// Handlers
|
||||
import { handleRdpProxyConnection } from './handlers/rdp.handler';
|
||||
|
||||
@@ -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 '../../ssh-suspend/temporary-log-storage.service';
|
||||
import { startDockerStatusPolling } from './docker.handler';
|
||||
import WebSocket from 'ws';
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { ClientState } from './types';
|
||||
import { SftpService } from '../services/sftp.service';
|
||||
import { SftpService } from '../sftp/sftp.service';
|
||||
import { StatusMonitorService } from '../services/status-monitor.service';
|
||||
import { AuditLogService } from '../services/audit.service';
|
||||
import { NotificationService } from '../services/notification.service';
|
||||
import { DockerService } from '../services/docker.service';
|
||||
import { DockerService } from '../docker/docker.service';
|
||||
import { settingsService } from '../services/settings.service'; // 添加导入
|
||||
|
||||
// 存储所有活动客户端的状态 (key: sessionId)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PortInfo, ClientState } from './types';
|
||||
import { SftpService } from '../services/sftp.service';
|
||||
import { SftpService } from '../sftp/sftp.service';
|
||||
import { StatusMonitorService } from '../services/status-monitor.service';
|
||||
import { clientStates, sftpService, statusMonitorService } from './state';
|
||||
import { sshSuspendService } from '../services/ssh-suspend.service';
|
||||
|
||||
Reference in New Issue
Block a user