Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 4 additions & 41 deletions admin-ui/src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
CheckCircle,
AlertCircle,
Clock,
TrendingUp,
Server,
Search

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'Search' import from lucide-react appears to be unused after removing the indexed chunks card. Consider removing this unused import to keep the code clean.

Suggested change
Search
Server

Copilot uses AI. Check for mistakes.
} from 'lucide-react'
Expand All @@ -29,7 +28,7 @@ export const Dashboard: React.FC = () => {
apiKey: apiKey!
}),
enabled: !!apiKey,
refetchInterval: 30000, // Refetch every 30 seconds
refetchInterval: 5000, // Refetch every 5 seconds

Copilot AI Aug 20, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A 5-second refresh interval may cause excessive API calls and unnecessary load on the backend. Consider if 5 seconds is truly necessary for this use case, or if a slightly longer interval (e.g., 10-15 seconds) would provide sufficient real-time updates while reducing server load.

Suggested change
refetchInterval: 5000, // Refetch every 5 seconds
refetchInterval: 10000, // Refetch every 10 seconds

Copilot uses AI. Check for mistakes.
})

// Calculate statistics from real data
Expand All @@ -39,9 +38,7 @@ export const Dashboard: React.FC = () => {
totalDocuments: 0,
completedDocuments: 0,
processingDocuments: 0,
errorDocuments: 0,
totalChunks: 0, // TODO: Add chunk count API
indexedChunks: 0
errorDocuments: 0
}
}

Expand All @@ -57,9 +54,7 @@ export const Dashboard: React.FC = () => {
totalDocuments,
completedDocuments,
processingDocuments,
errorDocuments,
totalChunks: 0, // TODO: Add chunk count API
indexedChunks: completedDocuments // Approximation
errorDocuments
}
}, [documentsPage?.content])

Expand Down Expand Up @@ -133,7 +128,7 @@ export const Dashboard: React.FC = () => {
</div>

{/* Stats Grid */}
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3">
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium text-gray-600">
Expand Down Expand Up @@ -202,38 +197,6 @@ export const Dashboard: React.FC = () => {
</p>
</CardContent>
</Card>

<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium text-gray-600">
Total Chunks
</CardTitle>
<TrendingUp className="h-4 w-4 text-blue-500" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">{stats.totalChunks.toLocaleString()}</div>
<p className="text-xs text-gray-600 mt-1">
Knowledge segments
</p>
</CardContent>
</Card>

<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium text-gray-600">
Indexed
</CardTitle>
<Server className="h-4 w-4 text-purple-500" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold text-purple-600">
{stats.indexedChunks.toLocaleString()}
</div>
<p className="text-xs text-gray-600 mt-1">
Ready for search
</p>
</CardContent>
</Card>
</div>

{/* Recent Activity */}
Expand Down