import { Button, Group, Modal, Notification, Space, Switch, Text } from "@mantine/core"; import { useForm } from "@mantine/form"; import { useState } from "react" import { ImCross } from "react-icons/im"; import { okNotify, resetfiregex } from "../../js/utils"; function ResetModal({ opened, onClose }:{ opened: boolean, onClose: () => void }) { const form = useForm({ initialValues: { delete_data:false, } }) const [loadingBtn, setLoadingBtn] = useState(false) const [error, setError] = useState(null) const close = () => { setError(null) setLoadingBtn(false) form.reset() onClose() } const submitRequest = async ({ delete_data }:{ delete_data:boolean }) => { setLoadingBtn(true) await resetfiregex(delete_data).then(res => { if(!res){ okNotify("Firegex Resetted!","Firegex has been resetted!") setError(null); close() form.reset() }else{ setError(res) } }).catch( err => setError(err.toString())) setLoadingBtn(false) } return Resetting firegex will trigger the reloading of the firewall rules in nftables and the restarting of all services filters (technically the c++ filter processes).
This will only cause the stop of the filters for a second and then restore them, during this time the services will continue to be available without interruptions.
Enabling the option below you will totaly reset firegex like you started it for the first time.
{error?<> } color="red" onClose={()=>{setError(null)}}> Error: {error} :null}
} export default ResetModal;