feat: 添加 ip 追踪
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { withCors } from '@/lib/middleware'
|
||||
import { getIpGeodataLabel } from '@/lib/geodata'
|
||||
|
||||
// 获取指定主机的星标记录
|
||||
async function handleGetStarredRecords(req: NextRequest) {
|
||||
@@ -49,6 +50,7 @@ async function handleGetStarredRecords(req: NextRequest) {
|
||||
})
|
||||
const serializedRecords = records.map(record => ({
|
||||
...record,
|
||||
ipLocation: getIpGeodataLabel(record.ip),
|
||||
windows: record.windows.map(window => ({
|
||||
...window,
|
||||
memory: window.memory.toString()
|
||||
|
||||
Reference in New Issue
Block a user