diff --git a/components/telemetry-dashboard.tsx b/components/telemetry-dashboard.tsx index 62a4895..1d37152 100644 --- a/components/telemetry-dashboard.tsx +++ b/components/telemetry-dashboard.tsx @@ -1,6 +1,7 @@ "use client"; import { useState, useEffect, useCallback, useRef } from "react"; +import { useRouter } from "next/navigation"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import { @@ -37,6 +38,8 @@ export default function TelemetryDashboard() { const [nodeInfo, setNodeInfo] = useState([]); const intervalsRef = useRef<{ [key: string]: NodeJS.Timeout }>({}); + const router = useRouter(); + const setNodeConnected = useCallback( (endpoint: string, connected: boolean) => { setNodeInfo((prev) => @@ -273,14 +276,11 @@ export default function TelemetryDashboard() { ? "" : "bg-red-100 dark:bg-red-500 text-black dark:text-white" }`} - onClick={() => - window.open( - `${ - window.location.pathname - }/node/?endpoint=${encodeURIComponent(node.endpoint)}`, - "_blank" - ) - } + onClick={() => { + router.push( + `/node?endpoint=${encodeURIComponent(node.endpoint)}` + ); + }} > {node.name || "-"}