Skip to content

Commit

Permalink
fix next path
Browse files Browse the repository at this point in the history
  • Loading branch information
qiweiii committed Oct 23, 2024
1 parent 9a4c253 commit b3a2e80
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions components/telemetry-dashboard.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -37,6 +38,8 @@ export default function TelemetryDashboard() {
const [nodeInfo, setNodeInfo] = useState<NodeInfo[]>([]);
const intervalsRef = useRef<{ [key: string]: NodeJS.Timeout }>({});

const router = useRouter();

const setNodeConnected = useCallback(
(endpoint: string, connected: boolean) => {
setNodeInfo((prev) =>
Expand Down Expand Up @@ -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)}`
);
}}
>
<TableCell className="font-medium truncate max-w-[150px]">
{node.name || "-"}
Expand Down

0 comments on commit b3a2e80

Please sign in to comment.