♻️ refactor: Add localization updates for log and server files across multiple languages
- Added new keys for "server", "subscribe", "detail", "pending", "sending", "sent", and "unknown" in log.json files for various languages. - Introduced a "type" object with transaction types (Recharge, Withdraw, Purchase, Refund, Reward, Commission) in log.json files for multiple languages. - Updated "traffic_ratio" to "Ratio" and added "transport" in servers.json for English localization. - Ensured consistency and accuracy in translations for all affected languages including German, English, Spanish, French, Russian, Chinese, and more.
This commit is contained in:
@@ -1,23 +1,31 @@
|
||||
'use client';
|
||||
|
||||
import { UserDetail } from '@/app/dashboard/user/user-detail';
|
||||
import { UserDetail, UserSubscribeDetail } from '@/app/dashboard/user/user-detail';
|
||||
import { IpLink } from '@/components/ip-link';
|
||||
import { ProTable } from '@/components/pro-table';
|
||||
import { filterSubscribeLog } from '@/services/admin/log';
|
||||
import { formatDate } from '@/utils/common';
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from '@workspace/ui/components/tooltip';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
|
||||
export default function SubscribeLogPage() {
|
||||
const t = useTranslations('log');
|
||||
const sp = useSearchParams();
|
||||
|
||||
const today = new Date().toISOString().split('T')[0];
|
||||
|
||||
const initialFilters = {
|
||||
search: sp.get('search') || undefined,
|
||||
date: sp.get('date') || undefined,
|
||||
date: sp.get('date') || today,
|
||||
user_id: sp.get('user_id') ? Number(sp.get('user_id')) : undefined,
|
||||
};
|
||||
return (
|
||||
<ProTable<API.SubscribeLog, { search?: string }>
|
||||
<ProTable<API.SubscribeLog, { date?: string; user_id?: number }>
|
||||
header={{ title: t('title.subscribe') }}
|
||||
initialFilters={initialFilters}
|
||||
columns={[
|
||||
@@ -26,14 +34,37 @@ export default function SubscribeLogPage() {
|
||||
header: t('column.user'),
|
||||
cell: ({ row }) => <UserDetail id={Number(row.original.user_id)} />,
|
||||
},
|
||||
{ accessorKey: 'user_subscribe_id', header: t('column.subscribeId') },
|
||||
{ accessorKey: 'token', header: t('column.token') },
|
||||
{
|
||||
accessorKey: 'user_subscribe_id',
|
||||
header: t('column.subscribe'),
|
||||
cell: ({ row }) => (
|
||||
<UserSubscribeDetail id={Number(row.original.user_subscribe_id)} enabled hoverCard />
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorKey: 'client_ip',
|
||||
header: t('column.ip'),
|
||||
cell: ({ row }) => <IpLink ip={String((row.original as any).client_ip || '')} />,
|
||||
},
|
||||
{ accessorKey: 'user_agent', header: t('column.userAgent') },
|
||||
{
|
||||
accessorKey: 'user_agent',
|
||||
header: t('column.userAgent'),
|
||||
cell: ({ row }) => {
|
||||
const userAgent = String(row.original.user_agent || '');
|
||||
return (
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className='max-w-48 cursor-help truncate'>{userAgent}</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p className='max-w-md break-words'>{userAgent}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: 'timestamp',
|
||||
header: t('column.time'),
|
||||
@@ -41,7 +72,6 @@ export default function SubscribeLogPage() {
|
||||
},
|
||||
]}
|
||||
params={[
|
||||
{ key: 'search' },
|
||||
{ key: 'date', type: 'date' },
|
||||
{ key: 'user_id', placeholder: t('column.userId') },
|
||||
]}
|
||||
@@ -49,7 +79,6 @@ export default function SubscribeLogPage() {
|
||||
const { data } = await filterSubscribeLog({
|
||||
page: pagination.page,
|
||||
size: pagination.size,
|
||||
search: filter?.search,
|
||||
date: (filter as any)?.date,
|
||||
user_id: (filter as any)?.user_id,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user