feat: Add database stats tab to admin dashboard with PostgreSQL support

This commit is contained in:
Your Name
2026-03-31 22:58:50 +02:00
parent d4236b0757
commit 33ccb4fde5
2 changed files with 102 additions and 1 deletions

View File

@@ -876,6 +876,18 @@ export interface AdminSystemHealth {
tasks_last_1h: number;
failures_last_1h: number;
database_size_mb: number;
database_type: string;
}
export interface DatabaseStats {
database_type: string;
tables: Array<{
table_name: string;
row_count: number;
total_size_kb?: number;
data_size_kb?: number;
}>;
table_count: number;
}
export async function getAdminRatingsDetail(page = 1, perPage = 20, tool = ''): Promise<AdminRatingsDetail> {
@@ -905,6 +917,11 @@ export async function getAdminSystemHealth(): Promise<AdminSystemHealth> {
return response.data;
}
export async function getDatabaseStats(): Promise<DatabaseStats> {
const response = await api.get<DatabaseStats>('/internal/admin/database-stats');
return response.data;
}
// --- Account / Usage / API Keys ---
export interface UsageSummary {