update
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from 'express';
|
||||
import { AuditLogService } from '../services/audit.service';
|
||||
import { AuditLogService } from './audit.service';
|
||||
import { AuditLogActionType } from '../types/audit.types';
|
||||
|
||||
const auditLogService = new AuditLogService();
|
||||
|
||||
@@ -3,11 +3,11 @@ import bcrypt from 'bcrypt';
|
||||
import { getDbInstance, runDb, getDb, allDb } from '../database/connection';
|
||||
import speakeasy from 'speakeasy';
|
||||
import qrcode from 'qrcode';
|
||||
import { NotificationService } from '../services/notification.service';
|
||||
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 { NotificationService } from '../notifications/notification.service';
|
||||
import { AuditLogService } from '../audit/audit.service';
|
||||
import { ipBlacklistService } from '../auth/ip-blacklist.service';
|
||||
import { captchaService } from '../auth/captcha.service';
|
||||
import { settingsService } from '../settings/settings.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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import { settingsService } from './settings.service';
|
||||
import { settingsService } from '../settings/settings.service';
|
||||
|
||||
// CAPTCHA 验证 API 端点
|
||||
const HCAPTCHA_VERIFY_URL = 'https://api.hcaptcha.com/siteverify';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
import { getDbInstance, runDb, getDb as getDbRow, allDb } from '../database/connection';
|
||||
import { settingsService } from './settings.service';
|
||||
import { NotificationService } from './notification.service';
|
||||
import { settingsService } from '../settings/settings.service';
|
||||
import { NotificationService } from '../notifications/notification.service';
|
||||
|
||||
|
||||
const notificationService = new NotificationService(); // 实例化 NotificationService
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { ipBlacklistService } from '../services/ip-blacklist.service';
|
||||
import { settingsService } from '../services/settings.service';
|
||||
import { ipBlacklistService } from '../auth/ip-blacklist.service';
|
||||
import { settingsService } from '../settings/settings.service';
|
||||
|
||||
/**
|
||||
* IP 黑名单检查中间件
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import ipaddr from 'ipaddr.js';
|
||||
import { settingsService } from '../services/settings.service';
|
||||
import { settingsService } from '../settings/settings.service';
|
||||
|
||||
const IP_WHITELIST_SETTING_KEY = 'ipWhitelist';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as CommandHistoryService from '../services/command-history.service';
|
||||
import * as CommandHistoryService from './command-history.service';
|
||||
|
||||
/**
|
||||
* 处理添加新命令历史记录的请求
|
||||
|
||||
@@ -61,7 +61,7 @@ import { ipWhitelistMiddleware } from './auth/ipWhitelist.middleware';
|
||||
|
||||
|
||||
import './services/event.service';
|
||||
import './services/notification.processor.service';
|
||||
import './notifications/notification.processor.service';
|
||||
import './notifications/notification.dispatcher.service';
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import eventService, { AppEventType, AppEventPayload } from './event.service';
|
||||
import eventService, { AppEventType, AppEventPayload } from '../services/event.service';
|
||||
import { NotificationSettingsRepository } from '../notifications/notification.repository';
|
||||
import { NotificationSetting, NotificationEvent, NotificationChannelType, WebhookConfig, EmailConfig, TelegramConfig, NotificationChannelConfig } from '../types/notification.types';
|
||||
import i18next, { i18nInitializationPromise } from '../i18n';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import * as nodemailer from "nodemailer";
|
||||
import Mail from "nodemailer/lib/mailer";
|
||||
import i18next, { defaultLng, supportedLngs } from "../i18n";
|
||||
import { settingsService } from "./settings.service";
|
||||
import { settingsService } from "../settings/settings.service";
|
||||
import { formatInTimeZone } from "date-fns-tz";
|
||||
|
||||
const testSubjectKey = "testNotification.subject";
|
||||
|
||||
@@ -4,7 +4,7 @@ import SMTPTransport from "nodemailer/lib/smtp-transport";
|
||||
import { INotificationSender } from "../notification.dispatcher.service";
|
||||
import { ProcessedNotification } from "../notification.processor.service";
|
||||
import { EmailConfig } from "../../types/notification.types";
|
||||
import { settingsService } from "../settings.service";
|
||||
import { settingsService } from "../../settings/settings.service";
|
||||
|
||||
class EmailSenderService implements INotificationSender {
|
||||
async send(notification: ProcessedNotification): Promise<void> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as ProxyService from '../services/proxy.service';
|
||||
import { AuditLogService } from '../services/audit.service';
|
||||
import * as ProxyService from '../proxies/proxy.service';
|
||||
import { AuditLogService } from '../audit/audit.service';
|
||||
|
||||
const auditLogService = new AuditLogService();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as QuickCommandsService from '../services/quick-commands.service';
|
||||
import { QuickCommandSortBy } from '../services/quick-commands.service';
|
||||
import * as QuickCommandsService from './quick-commands.service';
|
||||
import { QuickCommandSortBy } from './quick-commands.service';
|
||||
|
||||
/**
|
||||
* 处理添加新快捷指令的请求
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
import * as ConnectionRepository from '../connections/connection.repository';
|
||||
import * as ProxyRepository from '../proxies/proxy.repository';
|
||||
import * as TagService from '../services/tag.service';
|
||||
import * as TagService from '../tags/tag.service';
|
||||
import { getDbInstance, runDb, getDb as getDbRow, allDb } from '../database/connection';
|
||||
import { decrypt, getEncryptionKeyBuffer as getCryptoKeyBuffer } from '../utils/crypto';
|
||||
import { getAllDecryptedSshKeys, DecryptedSshKeyDetails } from '../services/ssh_key.service';
|
||||
import { getAllDecryptedSshKeys, DecryptedSshKeyDetails } from '../ssh_keys/ssh_key.service';
|
||||
import archiver from 'archiver';
|
||||
archiver.registerFormat('zip-encrypted', require("archiver-zip-encrypted"));
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import net from 'net';
|
||||
import * as ConnectionRepository from '../connections/connection.repository';
|
||||
import * as ProxyRepository from '../proxies/proxy.repository';
|
||||
import { decrypt } from '../utils/crypto';
|
||||
import * as SshKeyService from './ssh_key.service';
|
||||
import * as SshKeyService from '../ssh_keys/ssh_key.service';
|
||||
|
||||
const CONNECT_TIMEOUT = 20000; // 连接超时时间 (毫秒)
|
||||
const TEST_TIMEOUT = 15000; // 测试连接超时时间 (毫秒)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Client } from 'ssh2';
|
||||
import { WebSocket } from 'ws';
|
||||
import { ClientState } from '../websocket';
|
||||
import { settingsService } from './settings.service';
|
||||
import { settingsService } from '../settings/settings.service';
|
||||
|
||||
|
||||
interface ServerStatus {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from 'express';
|
||||
import { sshSuspendService } from '../services/ssh-suspend.service';
|
||||
import { sshSuspendService } from './ssh-suspend.service';
|
||||
import { SuspendedSessionInfo } from '../types/ssh-suspend.types';
|
||||
|
||||
export class SshSuspendController {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as SshKeyService from '../services/ssh_key.service';
|
||||
import { CreateSshKeyInput, UpdateSshKeyInput } from '../services/ssh_key.service';
|
||||
import * as SshKeyService from './ssh_key.service';
|
||||
import { CreateSshKeyInput, UpdateSshKeyInput } from './ssh_key.service';
|
||||
|
||||
/**
|
||||
* 获取所有 SSH 密钥的名称列表 (GET /api/v1/ssh-keys)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as TagService from '../services/tag.service';
|
||||
import { AuditLogService } from '../services/audit.service';
|
||||
import * as TagService from './tag.service';
|
||||
import { AuditLogService } from '../audit/audit.service';
|
||||
|
||||
const auditLogService = new AuditLogService();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from 'express';
|
||||
import * as terminalThemeService from '../services/terminal-theme.service';
|
||||
import * as terminalThemeService from './terminal-theme.service';
|
||||
import { CreateTerminalThemeDto, UpdateTerminalThemeDto } from '../types/terminal-theme.types';
|
||||
import type { ITheme } from 'xterm';
|
||||
import multer from 'multer';
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface AppearanceSettings {
|
||||
pageBackgroundImage?: string; // 页面背景图片 URL 或路径
|
||||
editorFontSize?: number; // 编辑器字体大小 (px)
|
||||
editorFontFamily?: string | null; // Monaco Editor 字体偏好
|
||||
mobileEditorFontSize?: number; // 移动端 Monaco 编辑器字体大小 (px)
|
||||
terminalBackgroundEnabled?: boolean; // 终端背景是否启用
|
||||
terminalBackgroundOverlayOpacity?: number; // 终端背景蒙版透明度 (0-1)
|
||||
terminal_custom_html?: string; // 用户自定义终端背景 HTML
|
||||
|
||||
@@ -5,7 +5,7 @@ import { initializeHeartbeat } from './websocket/heartbeat';
|
||||
import { initializeUpgradeHandler } from './websocket/upgrade';
|
||||
import { initializeConnectionHandler } from './websocket/connection';
|
||||
import { clientStates } from './websocket/state';
|
||||
import { sshSuspendService } from './services/ssh-suspend.service';
|
||||
import { sshSuspendService } from './ssh-suspend/ssh-suspend.service';
|
||||
import { SftpService } from './sftp/sftp.service';
|
||||
import { cleanupClientConnection } from './websocket/utils';
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ClientState } from './types';
|
||||
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 { AuditLogService } from '../audit/audit.service';
|
||||
import { NotificationService } from '../notifications/notification.service';
|
||||
import { DockerService } from '../docker/docker.service';
|
||||
import { settingsService } from '../services/settings.service'; // 添加导入
|
||||
import { settingsService } from '../settings/settings.service'; // 添加导入
|
||||
|
||||
// 存储所有活动客户端的状态 (key: sessionId)
|
||||
export const clientStates = new Map<string, ClientState>();
|
||||
|
||||
@@ -2,7 +2,7 @@ import { PortInfo, ClientState } from './types';
|
||||
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';
|
||||
import { sshSuspendService } from '../ssh-suspend/ssh-suspend.service';
|
||||
|
||||
// --- 解析 Ports 字符串的辅助函数 ---
|
||||
export function parsePortsString(portsString: string | undefined | null): PortInfo[] {
|
||||
|
||||
Reference in New Issue
Block a user