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" dashboardUid="docker-containers"
panelId={8} panelId={8}
/> />
<GrafanaWidget <div className="grid grid-cols-3 gap-2">
title="RAG Pipeline" <GrafanaWidget title="Files Processed" dashboardUid="rag-pipeline" panelId={1} height={120} />
dashboardUid="rag-pipeline" <GrafanaWidget title="Failed Files" dashboardUid="rag-pipeline" panelId={2} height={120} />
panelId={1} <GrafanaWidget title="Total Chunks" dashboardUid="rag-pipeline" panelId={3} height={120} />
/> </div>
</div> </div>

View File

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