File size: 1,778 Bytes
6a7089a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | import { useState } from "react";
import { useAppStore } from "../../stores/useAppStore";
export default function DebugPanel() {
const [open, setOpen] = useState(false);
const store = useAppStore();
if (!open) {
return (
<button
onClick={() => setOpen(true)}
className="fixed bottom-2 right-2 z-50 rounded bg-yellow-500 px-2 py-1 text-xs text-black"
>
🐛 Debug
</button>
);
}
return (
<div className="fixed bottom-2 right-2 z-50 max-h-96 w-80 overflow-auto rounded border border-yellow-500 bg-black/90 p-2 text-xs text-green-400 font-mono">
<div className="flex justify-between mb-2">
<span className="text-yellow-500 font-bold">Debug Panel</span>
<button onClick={() => setOpen(false)} className="text-white">
✕
</button>
</div>
<div className="space-y-1">
<div>instances: {store.instances?.length ?? "null"}</div>
<div>profiles: {store.profiles?.length ?? "null"}</div>
<div>agents: {store.agents?.length ?? "null"}</div>
<div>tabsChartData: {store.tabsChartData?.length ?? "null"}</div>
<div>serverChartData: {store.serverChartData?.length ?? "null"}</div>
<div>memoryChartData: {store.memoryChartData?.length ?? "null"}</div>
<div>selectedAgentId: {store.selectedAgentId ?? "null"}</div>
<div>profilesLoading: {String(store.profilesLoading)}</div>
<div>instancesLoading: {String(store.instancesLoading)}</div>
<div className="mt-2 text-yellow-500">Instances:</div>
{store.instances?.map((i) => (
<div key={i.id} className="ml-2 text-gray-400">
{i.id}: {i.status} ({i.profileName})
</div>
))}
</div>
</div>
);
}
|