diff --git a/src/api/adminRemnawave.ts b/src/api/adminRemnawave.ts index dad19cf..1613a75 100644 --- a/src/api/adminRemnawave.ts +++ b/src/api/adminRemnawave.ts @@ -174,8 +174,8 @@ export interface NodeRealtimeStats { uploadBytes: number; totalBytes: number; usersOnline: number; - inbounds: InboundTraffic[]; - outbounds: InboundTraffic[]; + inbounds?: InboundTraffic[]; + outbounds?: InboundTraffic[]; } // Squads diff --git a/src/pages/AdminRemnawave.tsx b/src/pages/AdminRemnawave.tsx index 4cf8420..c2f515a 100644 --- a/src/pages/AdminRemnawave.tsx +++ b/src/pages/AdminRemnawave.tsx @@ -923,12 +923,12 @@ function TrafficTab({ data, isLoading, onRefresh }: TrafficTabProps) { {formatBytes(node.totalBytes)} - {node.inbounds.length > 0 && ( + {(node.inbounds?.length ?? 0) > 0 && (
{t('admin.remnawave.traffic.inbounds', 'Inbounds')}
- {[...node.inbounds] + {[...(node.inbounds ?? [])] .sort((a, b) => b.totalBytes - a.totalBytes) .map((ib) => ({t('admin.remnawave.traffic.outbounds', 'Outbounds')}
- {[...node.outbounds] + {[...(node.outbounds ?? [])] .sort((a, b) => b.totalBytes - a.totalBytes) .map((ob) => (