mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-28 02:47:04 -05:00
Implement admin database stats dashboard
Add admin-only database statistics dashboard - Introduces types for database statistics and recent additions - Implements hooks to fetch statistics and recent additions via RPCs - Adds UI components for stats cards and a recent additions table - Integrates new AdminDatabaseStats page and routing under /admin/database-stats - Updates admin sidebar and app routes to expose the new dashboard - Enables real-time updates and export capabilities for recent additions
This commit is contained in:
62
src/types/database-stats.ts
Normal file
62
src/types/database-stats.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
export interface DatabaseStatistics {
|
||||
parks: {
|
||||
total: number;
|
||||
active: number;
|
||||
historical: number;
|
||||
added_7d: number;
|
||||
added_30d: number;
|
||||
};
|
||||
rides: {
|
||||
total: number;
|
||||
active: number;
|
||||
historical: number;
|
||||
added_7d: number;
|
||||
added_30d: number;
|
||||
};
|
||||
companies: {
|
||||
total: number;
|
||||
manufacturers: number;
|
||||
operators: number;
|
||||
designers: number;
|
||||
added_7d: number;
|
||||
added_30d: number;
|
||||
};
|
||||
ride_models: {
|
||||
total: number;
|
||||
added_7d: number;
|
||||
added_30d: number;
|
||||
};
|
||||
locations: {
|
||||
total: number;
|
||||
};
|
||||
timeline_events: {
|
||||
total: number;
|
||||
};
|
||||
photos: {
|
||||
total: number;
|
||||
added_7d: number;
|
||||
added_30d: number;
|
||||
};
|
||||
users: {
|
||||
total: number;
|
||||
active_30d: number;
|
||||
};
|
||||
submissions: {
|
||||
pending: number;
|
||||
approved: number;
|
||||
rejected: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface RecentAddition {
|
||||
entity_id: string;
|
||||
entity_type: 'park' | 'ride' | 'company' | 'ride_model' | 'location' | 'timeline_event' | 'photo';
|
||||
entity_name: string;
|
||||
entity_slug: string | null;
|
||||
park_slug: string | null;
|
||||
image_url: string | null;
|
||||
created_at: string;
|
||||
created_by_id: string | null;
|
||||
created_by_username: string | null;
|
||||
created_by_avatar: string | null;
|
||||
}
|
||||
Reference in New Issue
Block a user