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
@@ -0,0 +1,30 @@
import express from 'express';
import { SshSuspendController } from './ssh-suspend.controller';
import { isAuthenticated } from '../auth/auth.middleware'; // 取消注释:如果需要认证
const router = express.Router();
const sshSuspendController = new SshSuspendController();
// 定义获取挂起 SSH 会话列表的路由
// 路径将是 /api/v1/ssh-suspend/suspended-sessions (因为基础路径是 /api/v1/ssh-suspend)
router.get(
'/suspended-sessions',
isAuthenticated, // 取消注释:添加认证中间件
sshSuspendController.getSuspendedSshSessions
);
// Route to terminate an active 'hanging' suspended session and remove its entry
router.delete(
'/terminate/:suspendSessionId',
isAuthenticated,
sshSuspendController.terminateAndRemoveSession
);
// Route to remove an already 'disconnected_by_backend' suspended session entry
router.delete(
'/entry/:suspendSessionId',
isAuthenticated,
sshSuspendController.removeSessionEntry
);
export default router;