mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-15 04:41:10 -05:00
🐛 fix: Enhance server ID display in ServerTrafficLogPage with badges and server ratio
This commit is contained in:
parent
c6dd0b63f2
commit
6dfac27bc3
@ -3,6 +3,7 @@
|
|||||||
import { ProTable } from '@/components/pro-table';
|
import { ProTable } from '@/components/pro-table';
|
||||||
import { filterServerTrafficLog } from '@/services/admin/log';
|
import { filterServerTrafficLog } from '@/services/admin/log';
|
||||||
import { useServer } from '@/store/server';
|
import { useServer } from '@/store/server';
|
||||||
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { formatBytes } from '@workspace/ui/utils';
|
import { formatBytes } from '@workspace/ui/utils';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
@ -12,7 +13,7 @@ import { useSearchParams } from 'next/navigation';
|
|||||||
export default function ServerTrafficLogPage() {
|
export default function ServerTrafficLogPage() {
|
||||||
const t = useTranslations('log');
|
const t = useTranslations('log');
|
||||||
const sp = useSearchParams();
|
const sp = useSearchParams();
|
||||||
const { getServerName } = useServer();
|
const { getServerName, getServerById } = useServer();
|
||||||
|
|
||||||
const today = new Date().toISOString().split('T')[0];
|
const today = new Date().toISOString().split('T')[0];
|
||||||
|
|
||||||
@ -39,11 +40,17 @@ export default function ServerTrafficLogPage() {
|
|||||||
{
|
{
|
||||||
accessorKey: 'server_id',
|
accessorKey: 'server_id',
|
||||||
header: t('column.server'),
|
header: t('column.server'),
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => {
|
||||||
<span>
|
const server = getServerById(row.original.server_id);
|
||||||
{getServerName(row.original.server_id)} ({row.original.server_id})
|
const ratio = server?.ratio || 1;
|
||||||
</span>
|
return (
|
||||||
),
|
<div className='flex items-center gap-2'>
|
||||||
|
<Badge>{row.original.server_id}</Badge>
|
||||||
|
<span>{getServerName(row.original.server_id)}</span>
|
||||||
|
<Badge variant='outline'>{ratio}X</Badge>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'upload',
|
accessorKey: 'upload',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user