lvfengfree b92e1119ae fix: 修复菜单为空问题 - 移除后端过滤home路由的错误逻辑
- 修复RouteService中错误过滤home路由的问题
- 后端现在正确返回所有用户有权限的路由
- 添加设备管理相关功能(列表、在线监控、电源管理、远程监控)
- 添加详细的修复文档和重启脚本
- 更新权限配置脚本

问题根源:后端代码中有逻辑会过滤掉home路由,导致前端收到空数组,无法生成菜单
解决方案:移除过滤home路由的逻辑,让后端返回所有有权限的路由
2026-03-01 09:50:19 +08:00

98 lines
2.7 KiB
C++

//----------------------------------------------------------------------------
//
// Copyright (C) Intel Corporation, 2006 - 2007.
//
// File: TunnelManager.h
//
// Contents: Class for mapping between full address (including address and
// port) and tunnels.
//
// Notes:
//----------------------------------------------------------------------------
#ifndef _TUNNEL_MANAGER_H__
#define _TUNNEL_MANAGER_H__
#include <map>
#include <string>
#include <ace/RW_Thread_Mutex.h>
#include <ace/Vector_T.h>
#include <ace/SString.h>
#include <ace/Null_Mutex.h>
#include <ace/Thread_Mutex.h>
class AMT_Tunnel_Handler;
using namespace std;
// This class provides mapping between sockets, sessions, tunnels and channels.
// The class is thread safe and support multiple readers but single writer.
class Port_Address {
public:
ACE_CString fqdn;
ACE_UINT32 port;
// constructors
Port_Address():port() {};
Port_Address(const ACE_CString &fullAddress);
Port_Address(const ACE_CString &new_fqdn, ACE_UINT32 new_port);
bool operator== (const Port_Address& other);
};
class Tunnel_Manager {
private:
//===================================================
// CTOR/DTOR
//===================================================
Tunnel_Manager(void) {};
public:
static Tunnel_Manager& instance() {
static Tunnel_Manager t;
return t;
}
~Tunnel_Manager(void){};
//===================================================
// Public Function
//===================================================
int add_tunnel ( const AMT_Tunnel_Handler* tunnel,
const ACE_CString &address,
const ACE_UINT32 port);
int delete_tunnel( const ACE_CString &address,
const ACE_UINT32 port);
bool tunnel_exists( const ACE_CString &address,
const ACE_UINT32 port);
AMT_Tunnel_Handler* find_tunnel ( const ACE_CString &address,
const ACE_UINT32 port);
AMT_Tunnel_Handler* find_tunnel ( const ACE_CString &full_address);
void get_open_ports(const AMT_Tunnel_Handler* tunnel,
ACE_Vector<Port_Address> &ports);
// Read/Write guard
ACE_RW_Thread_Mutex& guard() {return rwmutex_;}
private:
// Read/Write lock of this container
ACE_RW_Thread_Mutex rwmutex_;
typedef map<ACE_CString, AMT_Tunnel_Handler*> TUNNEL_MAP;
//===================================================
// Data Members
//===================================================
TUNNEL_MAP _tunnel_map;
//===================================================
// Private Function
//===================================================
ACE_CString buildFullAddress(const ACE_CString &address, ACE_UINT32 port);
};
#endif // _TUNNEL_MANAGER_H__