feat: split RAG panel into 3 compact stats (processed, failed, chunks)

This commit is contained in:
2026-02-13 15:29:37 -05:00
parent 53f8adfa84
commit 51a3a8bdca
2 changed files with 9 additions and 7 deletions

View File

@@ -145,11 +145,11 @@ export default function Home() {
dashboardUid="docker-containers"
panelId={8}
/>
<GrafanaWidget
title="RAG Pipeline"
dashboardUid="rag-pipeline"
panelId={1}
/>
<div className="grid grid-cols-3 gap-2">
<GrafanaWidget title="Files Processed" dashboardUid="rag-pipeline" panelId={1} height={120} />
<GrafanaWidget title="Failed Files" dashboardUid="rag-pipeline" panelId={2} height={120} />
<GrafanaWidget title="Total Chunks" dashboardUid="rag-pipeline" panelId={3} height={120} />
</div>
</div>

View File

@@ -7,12 +7,14 @@ interface GrafanaWidgetProps {
title: string;
dashboardUid: string;
panelId: number;
height?: number;
}
export default function GrafanaWidget({
title,
dashboardUid,
panelId,
height,
}: GrafanaWidgetProps) {
const [loadError, setLoadError] = useState(false);
const grafanaHost = process.env.NEXT_PUBLIC_GRAFANA_HOST || "https://grafana.guapo613.beer";
@@ -21,7 +23,7 @@ export default function GrafanaWidget({
return (
<div className="bg-gray-800/40 backdrop-blur-sm rounded-lg border border-gray-700 overflow-hidden">
<div className="px-4 py-3 border-b border-gray-700 bg-gray-800/60 flex items-center justify-between">
<div className="px-4 py-2 border-b border-gray-700 bg-gray-800/60 flex items-center justify-between">
<h3 className="text-sm font-semibold text-white flex items-center gap-2">
<BarChart3 className="w-4 h-4 text-orange-500" />
{title}
@@ -36,7 +38,7 @@ export default function GrafanaWidget({
Open
</a>
</div>
<div className="relative h-48">
<div className="relative" style={{ height: height ? `${height}px` : '12rem' }}>
{loadError ? (
<div className="flex flex-col items-center justify-center h-full text-gray-500">
<AlertCircle className="w-8 h-8 mb-2" />