refactor: simplify API routes and add sniffer status functionality
Some checks failed
Build and Deploy MITM Webserver / build (push) Failing after 5s
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.
This commit is contained in:
21
frontend/src/types/sniffer.ts
Normal file
21
frontend/src/types/sniffer.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Status of an individual interface monitored by the AF_PACKET sniffer.
|
||||
*/
|
||||
export interface InterfaceSnifferStatus {
|
||||
/** Whether the sniffer thread is active */
|
||||
running: boolean;
|
||||
|
||||
/** Whether the interface exists in /sys/class/net */
|
||||
exists: boolean;
|
||||
|
||||
/** Whether the interface is operationally UP */
|
||||
up: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Response model for the sniffer status endpoint.
|
||||
* Maps interface names to their sniffer status.
|
||||
*/
|
||||
export interface SnifferStatusResponse {
|
||||
interfaces: Record<string, InterfaceSnifferStatus>;
|
||||
}
|
||||
Reference in New Issue
Block a user