feat(ui-react): add admin device list and detail pages#6113
Merged
gustavosbarreto merged 2 commits intomasterfrom Apr 6, 2026
Merged
feat(ui-react): add admin device list and detail pages#6113gustavosbarreto merged 2 commits intomasterfrom
gustavosbarreto merged 2 commits intomasterfrom
Conversation
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.
|
Claude finished @luizhf42's task in 2m 45s —— View job Code Review CompleteReviewed 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 If you push additional changes and want a new review, tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) anduseAdminDevice(single device withselect: normalizeDevicefor consistent tag handling). Follows theuseAdminNamespacespattern.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-sorton<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/devicesand/admin/devices/:uidinside theLicenseGuardblock. 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 andX-Admin: trueheader. The generated SDK functionsdeleteDeviceAdmin,updateDeviceNameAdmin, andupdateDeviceStatusAdminexist but have no backend routes — they are intentionally unused.