feat: 添加 ip 追踪

This commit is contained in:
2026-06-09 18:43:54 +08:00
parent ca654754ae
commit 7571316685
10 changed files with 261 additions and 0 deletions
+2
View File
@@ -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()