This commit is contained in:
2025-08-27 12:47:28 -04:00
parent dc0ea9d4c7
commit 124fe17546

View File

@ -41,16 +41,26 @@ const Dashboard: React.FC = () => {
try {
setLoading(true);
// Load applications and tokens data
const [appsResponse] = await Promise.all([
apiService.getApplications(100, 0),
]);
// Load applications
const appsResponse = await apiService.getApplications(100, 0);
// Load tokens for each application and count them
let totalTokens = 0;
for (const app of appsResponse.data) {
try {
const tokensResponse = await apiService.getTokensForApplication(app.app_id, 100, 0);
totalTokens += tokensResponse.count;
} catch (error) {
// Some apps might not have tokens, that's OK
console.debug(`No tokens found for app ${app.app_id}`);
}
}
// Calculate stats
const dashboardStats: DashboardStats = {
totalApplications: appsResponse.count,
totalTokens: 0, // We'd need to aggregate from all apps
recentActivity: 0,
totalTokens: totalTokens,
recentActivity: 0, // TODO: Could load from audit events
systemHealth: 'healthy',
};