Some checks failed
Build and Deploy MITM Webserver / build (push) Failing after 5s
- Updated API routes to remove redundant prefixes. - Introduced sniffer status fetching in the backend API. - Added Sniffing page and integrated it into the routing. - Created a new hook for backend API interactions. - Implemented sniffer status type definitions.
33 lines
746 B
TypeScript
33 lines
746 B
TypeScript
import { useEffect } from 'react';
|
|
import { useBackendAPI } from '../hooks/useBackendAPI';
|
|
import { fetchSnifferStatus } from '../api/apiClient';
|
|
|
|
export default function Sniffing() {
|
|
const {
|
|
interfacesQuery,
|
|
bridgesQuery,
|
|
createBridge,
|
|
removeBridge,
|
|
fetchBridges,
|
|
fetchInterfaces,
|
|
refreshBridges,
|
|
refreshInterfaces,
|
|
isCreating,
|
|
isRemoving,
|
|
} = useBackendAPI();
|
|
|
|
// fetch on mount (explicit, since queries are disabled by default)
|
|
useEffect(() => {
|
|
fetchInterfaces().catch(() => {});
|
|
fetchSnifferStatus().catch(() => {});
|
|
}, []);
|
|
|
|
const bridges = bridgesQuery.data ?? [];
|
|
const snifferStatus =
|
|
return (
|
|
<div className="sniffing-body">
|
|
<h1>Sniffing</h1>
|
|
</div>
|
|
);
|
|
}
|