diff --git a/src/locales/ru.json b/src/locales/ru.json index a175dae..bf8081d 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -1645,6 +1645,7 @@ "totalUpload": "Отдача", "totalTraffic": "Всего", "online": "онлайн", + "realtimeTitle": "Текущий трафик", "inbounds": "Inbounds", "outbounds": "Outbounds" }, diff --git a/src/pages/AdminRemnawave.tsx b/src/pages/AdminRemnawave.tsx index d7fee72..25dec88 100644 --- a/src/pages/AdminRemnawave.tsx +++ b/src/pages/AdminRemnawave.tsx @@ -139,15 +139,46 @@ function StatCard({ label, value, icon, color = 'accent', subValue }: StatCardPr ); } +function NodeTrafficBreakdown({ + title, + items, +}: { + title: string; + items: { tag: string; downloadBytes: number; uploadBytes: number; totalBytes: number }[]; +}) { + return ( +
{title}
+ {[...items] + .sort((a, b) => b.totalBytes - a.totalBytes) + .map((it) => ( +- {t('admin.remnawave.traffic.noData', 'No traffic data available')} -
- -- {t('admin.remnawave.traffic.inbounds', 'Inbounds')} -
- {[...(node.inbounds ?? [])] - .sort((a, b) => b.totalBytes - a.totalBytes) - .map((ib) => ( -- {t('admin.remnawave.traffic.outbounds', 'Outbounds')} -
- {[...(node.outbounds ?? [])] - .sort((a, b) => b.totalBytes - a.totalBytes) - .map((ob) => ( -