Adds the desktop web assistant app (Vite + React) with OpenClaw bridge proxy and exposes it on the local network (host: 0.0.0.0, port 5174). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
458 B
JavaScript
19 lines
458 B
JavaScript
import { useState, useEffect, useRef } from 'react'
|
|
import { healthCheck } from '../lib/api'
|
|
|
|
export function useBridgeHealth() {
|
|
const [isOnline, setIsOnline] = useState(null)
|
|
const intervalRef = useRef(null)
|
|
|
|
useEffect(() => {
|
|
const check = async () => {
|
|
setIsOnline(await healthCheck())
|
|
}
|
|
check()
|
|
intervalRef.current = setInterval(check, 15000)
|
|
return () => clearInterval(intervalRef.current)
|
|
}, [])
|
|
|
|
return isOnline
|
|
}
|