diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 29989d0..5e8d8af 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -185,53 +185,65 @@ export default async function AdminPage() { - {/* Recent Activity */} + {/* Recent API Calls */}

Recent API Calls

-
- - - - - - - - - - - - {recentUsage?.map((item) => ( - - - - - - - - ))} - -
TimeUserAPI TypeStatusError
- {new Date(item.created_at).toLocaleString('de-DE')} - - {(item.profiles as any)?.username || 'Unknown'} - - - {item.api_type === 'google_search' ? 'Search' : 'AI'} - - - - {item.success ? 'Success' : 'Failed'} - - - {item.error_message || '-'} -
+
+ Total calls logged: {recentUsage?.length || 0}
+ {!recentUsage || recentUsage.length === 0 ? ( +
+ +

No API calls recorded yet

+ {recentError && ( +

Error: {recentError.message}

+ )} +
+ ) : ( +
+ + + + + + + + + + + + {recentUsage.map((call: any) => ( + + + + + + + + ))} + +
TimeUserAPI TypeEndpointStatus
+ {new Date(call.created_at).toLocaleString('de-DE')} + + {call.profiles?.username || 'Unknown'} + + + {call.api_type === 'google_search' ? 'Google Search' : 'Gemini AI'} + + + {call.endpoint} + + {call.success ? ( + + ) : ( + + )} +
+
+ )}