fix: websocket proxy

This commit is contained in:
hamster1963
2024-11-23 17:31:00 +08:00
parent 1bda0cc3b7
commit d1558b71c4
5 changed files with 61 additions and 26 deletions

View File

@@ -1,4 +1,20 @@
import { useWebSocketContext } from "@/lib/websocketContext";
import { NezhaAPI } from "@/types/nezha-api";
export default function Servers() {
const { connected, message } = useWebSocketContext()
if (!connected || !message) {
return (
<p>...</p>
)
}
const nezhaWsData = JSON.parse(message) as NezhaAPI[]
console.log(nezhaWsData)
return (
<div className="mx-auto w-full max-w-5xl px-4 lg:px-0">
<div className="flex justify-between mb-4 mt-4 items-center">