🐛 fix(dashboard): Format Bytes

This commit is contained in:
web@ppanel 2024-12-19 18:14:55 +07:00
parent 2f56ef5eec
commit d8b0bd9c2d
24 changed files with 8097 additions and 2720 deletions

View File

@ -2,7 +2,7 @@
import { queryServerTotalData, queryTicketWaitReply } from '@/services/admin/console';
import { Icon } from '@iconify/react';
import { formatBytes, unitConversion } from '@repo/ui/utils';
import { formatBytes } from '@repo/ui/utils';
import { Card, CardContent, CardHeader, CardTitle } from '@shadcn/ui/card';
import { ChartContainer, ChartTooltip, ChartTooltipContent } from '@shadcn/ui/chart';
import { Bar, BarChart, CartesianGrid, LabelList, XAxis, YAxis } from '@shadcn/ui/lib/recharts';
@ -163,7 +163,7 @@ export default function Statistics() {
<ChartContainer
config={{
traffic: {
label: t('todayUploadTraffic'),
label: t('traffic'),
color: 'hsl(var(--primary))',
},
type: {
@ -186,7 +186,7 @@ export default function Statistics() {
type='number'
tickLine={false}
axisLine={false}
tickFormatter={(value) => formatBytes(unitConversion('gbToBytes', value) || 0)}
tickFormatter={(value) => formatBytes(value || 0)}
/>
<YAxis
type='category'
@ -201,12 +201,15 @@ export default function Statistics() {
<ChartTooltip
content={
<ChartTooltipContent
label={false}
label={true}
labelFormatter={(label) =>
dataType === 'nodes'
? `${t('nodes')}: ${label}`
: `${t('users')}: ${label}`
}
formatter={(value) => {
return formatBytes(Number(value) || 0);
}}
/>
}
/>

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Dnešní nahraný provoz",
"total": "Celkem",
"totalIncome": "Celkový příjem",
"traffic": "provoz",
"trafficRank": "Pořadí návštěvnosti",
"type": "Typ",
"userTitle": "Statistiky uživatele",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Heutiger Upload-Verkehr",
"total": "Gesamt",
"totalIncome": "Gesamteinkommen",
"traffic": "Verkehr",
"trafficRank": "Verkehrsrangliste",
"type": "Typ",
"userTitle": "Nutzerstatistik",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Today's Upload Traffic",
"total": "Total",
"totalIncome": "Total Income",
"traffic": "Traffic",
"trafficRank": "Traffic Ranking",
"type": "Type",
"userTitle": "User Statistics",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Tráfico de subida de hoy",
"total": "Total",
"totalIncome": "Ingresos totales",
"traffic": "tráfico",
"trafficRank": "Clasificación de tráfico",
"type": "tipo",
"userTitle": "Estadísticas de usuario",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Tráfico de carga de hoy",
"total": "Total",
"totalIncome": "Ingreso total",
"traffic": "tráfico",
"trafficRank": "Clasificación de tráfico",
"type": "tipo",
"userTitle": "Estadísticas del Usuario",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Tämän päivän lähetysliikenne",
"total": "Yhteensä",
"totalIncome": "Kokonaistulot",
"traffic": "liikenne",
"trafficRank": "Liikenteen sijoitus",
"type": "tyyppi",
"userTitle": "Käyttäjätilastot",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Trafic de téléchargement d'aujourd'hui",
"total": "Total",
"totalIncome": "Revenu total",
"traffic": "trafic",
"trafficRank": "Classement du trafic",
"type": "Type",
"userTitle": "Statistiques de l'utilisateur",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "आज का अपलोड ट्रैफिक",
"total": "कुल",
"totalIncome": "कुल आय",
"traffic": "ट्रैफिक",
"trafficRank": "ट्रैफिक रैंक",
"type": "प्रकार",
"userTitle": "उपयोगकर्ता सांख्यिकी",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Mai feltöltési forgalom",
"total": "Összesen",
"totalIncome": "Összes bevétel",
"traffic": "forgalom",
"trafficRank": "Forgalmi rangsor",
"type": "típus",
"userTitle": "Felhasználói statisztikák",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "本日のアップロードトラフィック",
"total": "合計",
"totalIncome": "総収入",
"traffic": "トラフィック",
"trafficRank": "トラフィックランキング",
"type": "タイプ",
"userTitle": "ユーザー統計",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "오늘 업로드 트래픽",
"total": "총계",
"totalIncome": "총수입",
"traffic": "트래픽",
"trafficRank": "트래픽 순위",
"type": "유형",
"userTitle": "사용자 통계",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Dagens opplastningstrafikk",
"total": "Totalt",
"totalIncome": "Totalinntekt",
"traffic": "trafikk",
"trafficRank": "Trafikkrangering",
"type": "Type",
"userTitle": "Brukerstatistikk",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Dzisiejszy przesył danych",
"total": "Razem",
"totalIncome": "Całkowity dochód",
"traffic": "ruch",
"trafficRank": "Ranking ruchu",
"type": "typ",
"userTitle": "Statystyki użytkownika",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Tráfego de upload de hoje",
"total": "Total",
"totalIncome": "Renda Total",
"traffic": "tráfego",
"trafficRank": "Classificação de Tráfego",
"type": "tipo",
"userTitle": "Estatísticas do Usuário",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Traficul de încărcare de astăzi",
"total": "Total",
"totalIncome": "Venit total",
"traffic": "trafic",
"trafficRank": "Clasament trafic",
"type": "tip",
"userTitle": "Statistici utilizator",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Сегодняшний объем загруженного трафика",
"total": "Итого",
"totalIncome": "Общий доход",
"traffic": "трафик",
"trafficRank": "Рейтинг трафика",
"type": "Тип",
"userTitle": "Статистика пользователей",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "ปริมาณการอัปโหลดวันนี้",
"total": "รวมทั้งหมด",
"totalIncome": "รายได้รวม",
"traffic": "การจราจร",
"trafficRank": "อันดับการเข้าชม",
"type": "ประเภท",
"userTitle": "สถิติผู้ใช้",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Bugün Yükleme Trafiği",
"total": "Toplam",
"totalIncome": "Toplam Gelir",
"traffic": "trafik",
"trafficRank": "Trafik Sıralaması",
"type": "Tür",
"userTitle": "Kullanıcı İstatistikleri",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Сьогоднішній обсяг завантаження",
"total": "Загалом",
"totalIncome": "Загальний дохід",
"traffic": "трафік",
"trafficRank": "Рейтинг трафіку",
"type": "Тип",
"userTitle": "Статистика користувача",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "Lưu lượng tải lên hôm nay",
"total": "Tổng cộng",
"totalIncome": "Tổng thu nhập",
"traffic": "lưu lượng",
"trafficRank": "Xếp hạng lưu lượng",
"type": "Loại",
"userTitle": "Thống kê người dùng",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "今日上传流量",
"total": "总计",
"totalIncome": "总收入",
"traffic": "流量",
"trafficRank": "流量排行",
"type": "类型",
"userTitle": "用户统计",

View File

@ -20,6 +20,7 @@
"todayUploadTraffic": "今日上傳流量",
"total": "總計",
"totalIncome": "總收入",
"traffic": "流量",
"trafficRank": "流量排行",
"type": "類型",
"userTitle": "使用者統計",

10784
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff