Merge branch 'main' of github.com:Pwnzer0tt1/firegex

This commit is contained in:
Domingo Dirutigliano
2025-07-28 15:45:45 +02:00
2 changed files with 21 additions and 21 deletions

View File

@@ -45,6 +45,8 @@ Heres a brief description about the firegex structure:
- [Frontend (React)](frontend/README.md) - [Frontend (React)](frontend/README.md)
- [Backend (FastAPI + C++)](backend/README.md) - [Backend (FastAPI + C++)](backend/README.md)
More specific information about how Firegex works, and in particular about the nfproxy module, are available here (in italian only): [https://github.com/domysh/engineering-thesis](https://github.com/domysh/engineering-thesis) (PDF in the release attachments)
![Firegex Working Scheme](docs/FiregexInternals.png) ![Firegex Working Scheme](docs/FiregexInternals.png)
### Main Points of Firegex ### Main Points of Firegex

View File

@@ -21,7 +21,25 @@ function App() {
const [reqError, setReqError] = useState<undefined|string>() const [reqError, setReqError] = useState<undefined|string>()
const [error, setError] = useState<string|null>() const [error, setError] = useState<string|null>()
const [loadinBtn, setLoadingBtn] = useState(false); const [loadinBtn, setLoadingBtn] = useState(false);
const queryClient = useQueryClient()
useEffect(()=>{
socketio.auth = { token: localStorage.getItem("access_token") }
socketio.connect()
getStatus()
socketio.on("update", (data) => {
queryClient.invalidateQueries({ queryKey: data })
})
socketio.on("connect_error", (err) => {
errorNotify("Socket.Io connection failed! ",`Error message: [${err.message}]`)
getStatus()
});
return () => {
socketio.off("update")
socketio.off("connect_error")
socketio.disconnect()
}
},[])
const getStatus = () =>{ const getStatus = () =>{
getstatus().then( res =>{ getstatus().then( res =>{
@@ -140,26 +158,6 @@ function App() {
const PageRouting = ({ getStatus }:{ getStatus:()=>void }) => { const PageRouting = ({ getStatus }:{ getStatus:()=>void }) => {
const queryClient = useQueryClient()
useEffect(()=>{
socketio.auth = { token: localStorage.getItem("access_token") }
socketio.connect()
getStatus()
socketio.on("update", (data) => {
queryClient.invalidateQueries({ queryKey: data })
})
socketio.on("connect_error", (err) => {
errorNotify("Socket.Io connection failed! ",`Error message: [${err.message}]`)
getStatus()
});
return () => {
socketio.off("update")
socketio.off("connect_error")
socketio.disconnect()
}
},[])
return <Routes> return <Routes>
<Route element={<MainLayout><Outlet /></MainLayout>}> <Route element={<MainLayout><Outlet /></MainLayout>}>
<Route path="nfregex" element={<NFRegex><Outlet /></NFRegex>} > <Route path="nfregex" element={<NFRegex><Outlet /></NFRegex>} >