Skip to content

feat(ui-react): add admin device list and detail pages#6113

Merged
gustavosbarreto merged 2 commits intomasterfrom
feat/ui-react/admin-device-pages
Apr 6, 2026
Merged

feat(ui-react): add admin device list and detail pages#6113
gustavosbarreto merged 2 commits intomasterfrom
feat/ui-react/admin-device-pages

Conversation

@luizhf42
Copy link
Copy Markdown
Member

@luizhf42 luizhf42 commented Apr 2, 2026

What

Read-only admin device pages (list + detail) for instance-wide device visibility across all namespaces. Feature #7 from the admin panel implementation plan.

Relates to shellhub-io/team#93

Why

Instance administrators need to inspect devices across every namespace from a single view without switching between per-namespace device pages. The Vue admin already has this; this is the React port.

Changes

  • hooks/useAdminDevices.ts: useAdminDevices (paginated list with search filter, status filter, sorting, tag normalization) and useAdminDevice (single device with select: normalizeDevice for consistent tag handling). Follows the useAdminNamespaces pattern.

  • pages/admin/devices/index.tsx: List page with status filter tabs (All/Accepted/Pending/Rejected), debounced hostname search via server-side base64 filter, sortable columns (Hostname, Last Seen, Status) with aria-sort on <th> elements, online status dots, namespace cross-links, and pagination. Clickable rows navigate to detail page — no action column, consistent with other admin pages.

  • pages/admin/devices/AdminDeviceDetails.tsx: Detail page with breadcrumb, online indicator, 3-card info grid (Identity, System, Namespace & Timeline), read-only tag chips, and conditional public key section. No mutations — entirely read-only.

  • pages/admin/devices/DeviceStatusChip.tsx: Maps all five device statuses to colored icon+label chips. Same pattern as UserStatusChip.

  • App.tsx: Lazy-loaded routes at /admin/devices and /admin/devices/:uid inside the LicenseGuard block. Sidebar entry already existed.

  • Tests: 31 tests across 3 files covering rendering, loading/empty/error states, row navigation, tab interaction, and detail page data display.

Testing

The admin device endpoints (GET /admin/api/devices, GET /admin/api/devices/{uid}) require an enterprise license and X-Admin: true header. The generated SDK functions deleteDeviceAdmin, updateDeviceNameAdmin, and updateDeviceStatusAdmin exist but have no backend routes — they are intentionally unused.

luizhf42 added 2 commits April 2, 2026 17:26
Read-only admin pages for instance-wide device management.
List page with status tabs, hostname search, sortable
columns, and cross-namespace visibility. Detail page with
identity, system info, namespace link, tags, and public key
sections.
@luizhf42 luizhf42 requested a review from a team as a code owner April 2, 2026 20:30
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Claude finished @luizhf42's task in 2m 45s —— View job


Code Review Complete

Reviewed 8 files across code quality, security, testing, TypeScript/React patterns, and architecture — no issues found. The code looks good as-is.

The implementation follows existing patterns well (route structure matches AdminNamespaces, hooks follow useAdminNamespaces conventions, component structure is consistent with the admin panel). API contracts are correct against the OpenAPI spec, access control is properly layered, and all imports resolve.


If you push additional changes and want a new review, tag @shellhub-io/admin and a team member can trigger it.

@luizhf42 luizhf42 self-assigned this Apr 2, 2026
@luizhf42 luizhf42 added kind/feature New feature or request area/ui product/enterprise Issue/PR related to Enterprise Edition labels Apr 2, 2026
@gustavosbarreto gustavosbarreto merged commit 2c5018c into master Apr 6, 2026
23 checks passed
@gustavosbarreto gustavosbarreto deleted the feat/ui-react/admin-device-pages branch April 6, 2026 12:49
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants