feat(routers): integrate Banana Pi Client API and onboard LibreSpeed measurements

Discover Ethernet routers under the board, map physical SIM slots, expose vendor controls and real telemetry, and provide packaged VPS speed tests with a live monochrome gauge. Enforce compact typography across Core and Node UI.
This commit is contained in:
DCCONSTRUCTIONS
2026-11-11 23:53:46 +03:00
parent 58ac9fe3d2
commit a49fb00b8e
208 changed files with 7007 additions and 881 deletions
+3 -3
View File
@@ -4,12 +4,12 @@ import type {RouterSnapshot,RouterTransport} from './contracts';
export function useRouters(transport:RouterTransport){
const [value,setValue]=useState<RouterSnapshot|null>(null),[error,setError]=useState('');
useEffect(()=>{
let active=true;let timer:ReturnType<typeof setTimeout>;
let active=true;let cadence=3000;let timer:ReturnType<typeof setTimeout>;
setValue(null);setError('');
async function poll(){
try{const next=await transport.read();if(active){setValue(next);setError('');}}
try{const next=await transport.read();if(active){setValue(next);setError('');cadence=next.results.some(r=>r.action==='speedtest'&&(r.state==='queued'||r.state==='applying'))?1000:3000;}}
catch{if(active){setValue(previous=>previous?{...previous,fresh:false}:previous);setError('Не удалось обновить сведения о роутере.');}}
finally{if(active)timer=setTimeout(()=>void poll(),3000);}
finally{if(active)timer=setTimeout(()=>void poll(),cadence);}
}
void poll();return()=>{active=false;clearTimeout(timer);};
},[transport]);