feat: add admin traffic usage page with TanStack Table

Add AdminTrafficUsage page showing per-user traffic statistics by node
with period filtering (1/3/7/14/30d), server-side sorting, search,
pagination, and CSV export. Uses @tanstack/react-table with manual
sorting and dynamic node columns.
This commit is contained in:
Fringg
2026-02-07 09:04:55 +03:00
parent 280f4aef0d
commit a034a6068c
10 changed files with 716 additions and 8 deletions

View File

@@ -216,6 +216,16 @@ const EnvelopeIcon = () => (
</svg>
);
const ArrowsUpDownIcon = () => (
<svg className="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={1.5}>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"
/>
</svg>
);
const ChevronRightIcon = () => (
<svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
<path strokeLinecap="round" strokeLinejoin="round" d="M8.25 4.5l7.5 7.5-7.5 7.5" />
@@ -317,6 +327,12 @@ export default function AdminPanel() {
title: t('admin.nav.payments'),
description: t('admin.panel.paymentsDesc'),
},
{
to: '/admin/traffic-usage',
icon: <ArrowsUpDownIcon />,
title: t('admin.nav.trafficUsage'),
description: t('admin.panel.trafficUsageDesc'),
},
],
},
{