MCPcopy
hub / github.com/MacRimi/ProxMenux / loadFirewallStatus

Function loadFirewallStatus

AppImage/components/security.tsx:255–278  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253 }, [])
254
255 const loadFirewallStatus = async () => {
256 try {
257 setFirewallLoading(true)
258 const data = await fetchApi("/api/security/firewall/status")
259 if (data.success) {
260 setFirewallData({
261 pve_firewall_installed: data.pve_firewall_installed,
262 pve_firewall_active: data.pve_firewall_active,
263 cluster_fw_enabled: data.cluster_fw_enabled,
264 host_fw_enabled: data.host_fw_enabled,
265 rules_count: data.rules_count,
266 rules: data.rules || [],
267 monitor_port_open: data.monitor_port_open,
268 })
269 }
270 } catch (err) {
271 // Was a silent catch — left the user staring at "0 firewall rules" when
272 // the request 401'd or the backend was down. At minimum surface the
273 // failure in the browser console so devtools shows what went wrong.
274 console.error("[security] Failed to load firewall status:", err)
275 } finally {
276 setFirewallLoading(false)
277 }
278 }
279
280 const loadNetworkInterfaces = async () => {
281 try {

Callers 6

SecurityFunction · 0.85
handleAddRuleFunction · 0.85
handleDeleteRuleFunction · 0.85
handleSaveEditRuleFunction · 0.85
handleFirewallToggleFunction · 0.85
handleMonitorPortToggleFunction · 0.85

Calls 1

fetchApiFunction · 0.90

Tested by

no test coverage detected