-
This commit is contained in:
@ -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',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user