diff --git a/app/(app)/dashboard/page.tsx b/app/(app)/dashboard/page.tsx index c97c2de..e58b2be 100644 --- a/app/(app)/dashboard/page.tsx +++ b/app/(app)/dashboard/page.tsx @@ -35,6 +35,7 @@ interface Event { project_name?: string; link_id?: string; link_slug?: string; + link_tags?: string; } // 格式化日期函数 @@ -77,6 +78,19 @@ const extractEventInfo = (event: Event) => { // 解析用户属性 const userAttrs = parseJsonSafely(event.user_attributes || '{}'); + // 解析标签信息 + let tags: string[] = []; + try { + if (event.link_tags) { + const parsedTags = JSON.parse(event.link_tags); + if (Array.isArray(parsedTags)) { + tags = parsedTags; + } + } + } catch { + // 解析失败则保持空数组 + } + return { eventTime: event.created_at || event.event_time, linkName: event.link_label || linkAttrs?.name || eventAttrs?.link_name || event.link_slug || '-', @@ -90,7 +104,8 @@ const extractEventInfo = (event: Event) => { os: event.os || '-', userInfo: getUserDisplayName(userAttrs), teamName: event.team_name || '-', - projectName: event.project_name || '-' + projectName: event.project_name || '-', + tags: tags }; }; @@ -330,7 +345,126 @@ export default function DashboardPage() { )} - {/* 仪表板内容 */} + {/* 事件列表部分 - 现在放在最上面 */} +
| + Time + | ++ Link Name + | ++ Original URL + | ++ Event Type + | ++ Tags + | ++ User + | ++ Team/Project + | ++ Device Info + | +
|---|---|---|---|---|---|---|---|
| + {formatDate(info.eventTime)} + | +
+ {info.linkName}
+
+ ID: {event.link_id?.substring(0, 8) || '-'}
+
+ |
+ + + {info.originalUrl} + + | ++ + {info.eventType} + + | +
+
+ {info.tags && info.tags.length > 0 ? (
+ info.tags.map((tag, idx) => (
+
+ {tag}
+
+ ))
+ ) : (
+ -
+ )}
+
+ |
+
+ {info.userInfo}
+ {info.visitorId}...
+ |
+
+ {info.teamName}
+ {info.projectName}
+ |
+
+
+
+ Device:
+ {info.device}
+
+
+ Browser:
+ {info.browser}
+
+
+ OS:
+ {info.os}
+
+
+ |
+
| - Time - | -- Link Name - | -- Original URL - | -- Event Type - | -- User - | -- Team/Project - | -- Device Info - | -
|---|---|---|---|---|---|---|
| - {formatDate(info.eventTime)} - | -
- {info.linkName}
-
- ID: {event.link_id?.substring(0, 8) || '-'}
-
- |
- - - {info.originalUrl} - - | -- - {info.eventType} - - | -
- {info.userInfo}
- {info.visitorId}...
- |
-
- {info.teamName}
- {info.projectName}
- |
-
-
-
- Device:
- {info.device}
-
-
- Browser:
- {info.browser}
-
-
- OS:
- {info.os}
-
-
- |
-