Show full device token in admin panel

- API now returns full registration_id instead of truncated version
- Added Device Token column to devices table in admin panel
- Device tokens are displayed with word-wrap for long tokens
- Added Devices link to sidebar navigation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-11-29 11:28:36 -06:00
parent 8022e03246
commit 80c9fca6e9
3 changed files with 12 additions and 4 deletions

View File

@@ -272,6 +272,7 @@ export default function DevicesPage() {
<TableHead>Name</TableHead> <TableHead>Name</TableHead>
<TableHead>User</TableHead> <TableHead>User</TableHead>
<TableHead>Device ID</TableHead> <TableHead>Device ID</TableHead>
<TableHead>Device Token</TableHead>
<TableHead>Active</TableHead> <TableHead>Active</TableHead>
<TableHead>Created</TableHead> <TableHead>Created</TableHead>
<TableHead className="w-24">Actions</TableHead> <TableHead className="w-24">Actions</TableHead>
@@ -280,13 +281,13 @@ export default function DevicesPage() {
<TableBody> <TableBody>
{isLoading ? ( {isLoading ? (
<TableRow> <TableRow>
<TableCell colSpan={7} className="text-center py-8"> <TableCell colSpan={8} className="text-center py-8">
Loading... Loading...
</TableCell> </TableCell>
</TableRow> </TableRow>
) : data?.data?.length === 0 ? ( ) : data?.data?.length === 0 ? (
<TableRow> <TableRow>
<TableCell colSpan={7} className="text-center py-8"> <TableCell colSpan={8} className="text-center py-8">
No devices found No devices found
</TableCell> </TableCell>
</TableRow> </TableRow>
@@ -323,6 +324,11 @@ export default function DevicesPage() {
{device.device_id.substring(0, 12)}... {device.device_id.substring(0, 12)}...
</code> </code>
</TableCell> </TableCell>
<TableCell>
<code className="text-xs bg-muted px-2 py-1 rounded break-all max-w-[200px] block">
{device.registration_id}
</code>
</TableCell>
<TableCell> <TableCell>
<Switch <Switch
checked={device.active} checked={device.active}

View File

@@ -22,6 +22,7 @@ import {
Mail, Mail,
Share2, Share2,
KeyRound, KeyRound,
Smartphone,
} from 'lucide-react'; } from 'lucide-react';
import { useRouter, usePathname } from 'next/navigation'; import { useRouter, usePathname } from 'next/navigation';
import { useAuthStore } from '@/store/auth'; import { useAuthStore } from '@/store/auth';
@@ -53,6 +54,7 @@ const menuItems = [
{ title: 'Documents', url: '/admin/documents', icon: FileText }, { title: 'Documents', url: '/admin/documents', icon: FileText },
{ title: 'Notifications', url: '/admin/notifications', icon: Bell }, { title: 'Notifications', url: '/admin/notifications', icon: Bell },
{ title: 'Notification Prefs', url: '/admin/notification-prefs', icon: BellRing }, { title: 'Notification Prefs', url: '/admin/notification-prefs', icon: BellRing },
{ title: 'Devices', url: '/admin/devices', icon: Smartphone },
{ title: 'Subscriptions', url: '/admin/subscriptions', icon: CreditCard }, { title: 'Subscriptions', url: '/admin/subscriptions', icon: CreditCard },
]; ];

View File

@@ -96,7 +96,7 @@ func (h *AdminDeviceHandler) ListAPNS(c *gin.Context) {
UserID: device.UserID, UserID: device.UserID,
Username: username, Username: username,
DeviceID: device.DeviceID, DeviceID: device.DeviceID,
RegistrationID: device.RegistrationID[:min(20, len(device.RegistrationID))] + "...", RegistrationID: device.RegistrationID, // Full device token
DateCreated: device.DateCreated.Format("2006-01-02T15:04:05Z"), DateCreated: device.DateCreated.Format("2006-01-02T15:04:05Z"),
} }
} }
@@ -153,7 +153,7 @@ func (h *AdminDeviceHandler) ListGCM(c *gin.Context) {
UserID: device.UserID, UserID: device.UserID,
Username: username, Username: username,
DeviceID: device.DeviceID, DeviceID: device.DeviceID,
RegistrationID: device.RegistrationID[:min(20, len(device.RegistrationID))] + "...", RegistrationID: device.RegistrationID, // Full device token
CloudMessageType: device.CloudMessageType, CloudMessageType: device.CloudMessageType,
DateCreated: device.DateCreated.Format("2006-01-02T15:04:05Z"), DateCreated: device.DateCreated.Format("2006-01-02T15:04:05Z"),
} }