Skip to content

feat(ui-react): add admin firewall rules list and detail pages#6116

Open
luizhf42 wants to merge 2 commits intomasterfrom
feat/ui-react/admin-firewall-rules-pages
Open

feat(ui-react): add admin firewall rules list and detail pages#6116
luizhf42 wants to merge 2 commits intomasterfrom
feat/ui-react/admin-firewall-rules-pages

Conversation

@luizhf42
Copy link
Copy Markdown
Member

@luizhf42 luizhf42 commented Apr 6, 2026

What

Read-only admin pages for viewing firewall rules across all namespaces in the instance.

Why

Feature #9 from shellhub-io/team#93 — admins need visibility into firewall rules without navigating into each namespace individually.

Changes

  • hooks/useAdminFirewallRules: useAdminFirewallRules (paginated list) and useAdminFirewallRule (single by ID), following the same pattern as useAdminDevices
  • pages/admin/firewall-rules/index: 7-column table (priority, action, source IP, username, device filter, status, namespace) with client-side search and pagination. Search filters the current page only — the admin firewall API has no server-side filter param. Pagination hides while searching to avoid misleading counts
  • pages/admin/firewall-rules/AdminFirewallRuleDetails: two-card layout — rule properties (ID, namespace, priority, action, status) and connection criteria (source IP, username, device filter via FilterBadge)
  • App.tsx: two lazy-loaded routes under LicenseGuard
  • useFirewallRules normalization fix: the API returns both hostname and tags fields on the filter object. The old "tags" in rule.filter check was always true, causing hostname-filtered rules to display as "All devices". Now checks tags.length > 0 before using the tags branch
  • FilterBadge icon: swapped ClipboardDocumentListIcon to CpuChipIcon for hostname filters — clearer association with devices

Testing

59 new tests across three files covering hook behavior, list page states, client-side search filtering, detail page rendering, and filter badge variants.

@luizhf42 luizhf42 requested a review from a team as a code owner April 6, 2026 15:27
@luizhf42 luizhf42 self-assigned this Apr 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@luizhf42 luizhf42 added kind/feature New feature or request area/ui product/enterprise Issue/PR related to Enterprise Edition labels Apr 6, 2026
luizhf42 added 2 commits April 6, 2026 14:42
Read-only admin pages for instance-wide firewall rule visibility.
List page with 7-column table, client-side search, and pagination.
Detail page with rule properties and connection criteria cards.

Also fixes filter normalization in useFirewallRules to correctly
handle API responses where both hostname and tags fields are
present, and swaps FilterBadge hostname icon to CpuChipIcon for
clarity.
@luizhf42 luizhf42 force-pushed the feat/ui-react/admin-firewall-rules-pages branch from 75c77e0 to 83a69c3 Compare April 6, 2026 17:42
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui kind/feature New feature or request product/enterprise Issue/PR related to Enterprise Edition status/work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant