feat: add Traffic tab with per-inbound breakdown in admin remnawave

- Add NodeRealtimeStats and InboundTraffic TypeScript interfaces
- Type getNodesRealtime return as NodeRealtimeStats[]
- Add new Traffic tab to AdminRemnawave page showing per-node
  inbound/outbound traffic sorted by total bytes
- Display download/upload/total per inbound tag for each node
This commit is contained in:
Fringg
2026-03-28 22:47:29 +03:00
parent a34a34204c
commit 4ebc21b348
2 changed files with 172 additions and 2 deletions

View File

@@ -159,6 +159,25 @@ export interface NodeActionResponse {
is_disabled?: boolean;
}
// Realtime Traffic
export interface InboundTraffic {
tag: string;
downloadBytes: number;
uploadBytes: number;
totalBytes: number;
}
export interface NodeRealtimeStats {
nodeUuid: string;
nodeName: string;
downloadBytes: number;
uploadBytes: number;
totalBytes: number;
usersOnline: number;
inbounds: InboundTraffic[];
outbounds: InboundTraffic[];
}
// Squads
export interface SquadWithLocalInfo {
uuid: string;
@@ -282,7 +301,7 @@ export const adminRemnawaveApi = {
return response.data;
},
getNodesRealtime: async (): Promise<Record<string, unknown>[]> => {
getNodesRealtime: async (): Promise<NodeRealtimeStats[]> => {
const response = await apiClient.get('/cabinet/admin/remnawave/nodes/realtime');
return response.data;
},