fix: add i18n keys for Traffic tab, prevent sort mutation

- Add traffic tab/section locale keys to ru, en, zh, fa
- Use spread copy before .sort() to avoid mutating React Query cache
This commit is contained in:
Fringg
2026-03-28 22:52:30 +03:00
parent 4ebc21b348
commit 5d7b94fc48
5 changed files with 42 additions and 2 deletions

View File

@@ -1493,9 +1493,19 @@
"tabs": { "tabs": {
"overview": "Overview", "overview": "Overview",
"nodes": "Nodes", "nodes": "Nodes",
"traffic": "Traffic",
"squads": "Squads", "squads": "Squads",
"sync": "Sync" "sync": "Sync"
}, },
"traffic": {
"noData": "No traffic data available",
"totalDownload": "Download",
"totalUpload": "Upload",
"totalTraffic": "Total",
"online": "online",
"inbounds": "Inbounds",
"outbounds": "Outbounds"
},
"overview": { "overview": {
"system": "System", "system": "System",
"usersOnline": "Online", "usersOnline": "Online",

View File

@@ -2755,9 +2755,19 @@
"tabs": { "tabs": {
"overview": "نمای کلی", "overview": "نمای کلی",
"nodes": "گره‌ها", "nodes": "گره‌ها",
"traffic": "ترافیک",
"squads": "گروه‌ها", "squads": "گروه‌ها",
"sync": "همگام‌سازی" "sync": "همگام‌سازی"
}, },
"traffic": {
"noData": "داده ترافیکی موجود نیست",
"totalDownload": "دانلود",
"totalUpload": "آپلود",
"totalTraffic": "مجموع",
"online": "آنلاین",
"inbounds": "ورودی‌ها",
"outbounds": "خروجی‌ها"
},
"nodes": { "nodes": {
"confirmRestartAll": "آیا مطمئنید می‌خواهید همه گره‌ها را راه‌اندازی مجدد کنید؟", "confirmRestartAll": "آیا مطمئنید می‌خواهید همه گره‌ها را راه‌اندازی مجدد کنید؟",
"disable": "غیرفعال", "disable": "غیرفعال",

View File

@@ -1514,9 +1514,19 @@
"tabs": { "tabs": {
"overview": "Обзор", "overview": "Обзор",
"nodes": "Ноды", "nodes": "Ноды",
"traffic": "Трафик",
"squads": "Сквады", "squads": "Сквады",
"sync": "Синхронизация" "sync": "Синхронизация"
}, },
"traffic": {
"noData": "Нет данных о трафике",
"totalDownload": "Загрузка",
"totalUpload": "Отдача",
"totalTraffic": "Всего",
"online": "онлайн",
"inbounds": "Inbounds",
"outbounds": "Outbounds"
},
"overview": { "overview": {
"system": "Система", "system": "Система",
"usersOnline": "Онлайн", "usersOnline": "Онлайн",

View File

@@ -2763,9 +2763,19 @@
"tabs": { "tabs": {
"overview": "概览", "overview": "概览",
"nodes": "节点", "nodes": "节点",
"traffic": "流量",
"squads": "小队", "squads": "小队",
"sync": "同步" "sync": "同步"
}, },
"traffic": {
"noData": "暂无流量数据",
"totalDownload": "下载",
"totalUpload": "上传",
"totalTraffic": "总计",
"online": "在线",
"inbounds": "入站",
"outbounds": "出站"
},
"nodes": { "nodes": {
"confirmRestartAll": "确定要重启所有节点吗?", "confirmRestartAll": "确定要重启所有节点吗?",
"disable": "禁用", "disable": "禁用",

View File

@@ -928,7 +928,7 @@ function TrafficTab({ data, isLoading, onRefresh }: TrafficTabProps) {
<p className="mb-2 text-xs font-medium text-dark-400"> <p className="mb-2 text-xs font-medium text-dark-400">
{t('admin.remnawave.traffic.inbounds', 'Inbounds')} {t('admin.remnawave.traffic.inbounds', 'Inbounds')}
</p> </p>
{node.inbounds {[...node.inbounds]
.sort((a, b) => b.totalBytes - a.totalBytes) .sort((a, b) => b.totalBytes - a.totalBytes)
.map((ib) => ( .map((ib) => (
<div <div
@@ -953,7 +953,7 @@ function TrafficTab({ data, isLoading, onRefresh }: TrafficTabProps) {
<p className="mb-2 text-xs font-medium text-dark-400"> <p className="mb-2 text-xs font-medium text-dark-400">
{t('admin.remnawave.traffic.outbounds', 'Outbounds')} {t('admin.remnawave.traffic.outbounds', 'Outbounds')}
</p> </p>
{node.outbounds {[...node.outbounds]
.sort((a, b) => b.totalBytes - a.totalBytes) .sort((a, b) => b.totalBytes - a.totalBytes)
.map((ob) => ( .map((ob) => (
<div <div