增加客户端标识 & 套餐管理重置今日限额字段 &提取IP/IP管理模块新增字段

This commit is contained in:
Eamon-meng
2025-12-12 14:25:27 +08:00
parent ee7433e320
commit 26ea796b4d
9 changed files with 120 additions and 51 deletions

View File

@@ -265,20 +265,19 @@ export default function LongResource(props: LongResourceProps) {
<div className="flex gap-1">
{row.original.long.type === 1 ? (
<div className="flex gap-1">
{isAfter(row.original.long.expire, new Date())
{isAfter(row.original.long.expire_at, new Date())
? <span className="text-green-500"></span>
: <span className="text-red-500"></span>}
<span>|</span>
<span>
{row.original.long.daily_used}
{' '}
/
{row.original.long.daily_limit}
{row.original.long.last_at
&& new Date(row.original.long.last_at).toDateString() === new Date().toDateString()
? row.original.long.daily
: 0}/{row.original.long.quota}
</span>
<span>|</span>
<span>
{intlFormatDistance(row.original.long.expire, new Date())}
{intlFormatDistance(row.original.long.expire_at, new Date())}
{' '}
</span>
@@ -304,12 +303,14 @@ export default function LongResource(props: LongResourceProps) {
),
},
{
accessorKey: 'daily_last', header: '最近使用时间', cell: ({row}) => {
return (
format(row.original.long.daily_last, 'yyyy-MM-dd') === '0001-01-01'
? '-'
: format(row.original.long.daily_last, 'yyyy-MM-dd HH:mm')
)
accessorKey: 'last_at',
header: '最近使用时间',
cell: ({row}) => {
const lastAt = row.original.long.last_at
if (!lastAt) {
return '暂未使用'
}
return format(lastAt, 'yyyy-MM-dd HH:mm')
},
},
{

View File

@@ -265,22 +265,19 @@ export default function ShortResource(props: ShortResourceProps) {
<div className="flex gap-1">
{row.original.short.type === 1 ? (
<div className="flex gap-1">
{isAfter(row.original.short.expire, new Date())
{isAfter(row.original.short.expire_at, new Date())
? <span className="text-green-500"></span>
: <span className="text-red-500"></span>}
<span>|</span>
<span>
{row.original.short.daily_used}
{' '}
/
{row.original.short.daily_limit}
{row.original.short.last_at
&& new Date(row.original.short.last_at).toDateString() === new Date().toDateString()
? row.original.short.daily
: 0}/{row.original.short.quota}
</span>
<span>|</span>
<span>
{intlFormatDistance(row.original.short.expire, new Date())}
{' '}
{intlFormatDistance(row.original.short.expire_at, new Date())}
</span>
</div>
) : row.original.short.type === 2 ? (
@@ -304,12 +301,14 @@ export default function ShortResource(props: ShortResourceProps) {
),
},
{
accessorKey: 'daily_last', header: '最近使用时间', cell: ({row}) => {
return (
format(row.original.short.daily_last, 'yyyy-MM-dd') === '0001-01-01'
? '-'
: format(row.original.short.daily_last, 'yyyy-MM-dd HH:mm')
)
accessorKey: 'last_at',
header: '最近使用时间',
cell: ({row}) => {
const lastAt = row.original.short.last_at
if (!lastAt) {
return '暂未使用'
}
return format(lastAt, 'yyyy-MM-dd HH:mm')
},
},
{