Move admin dashboard to admin.myhoneydue.com subdomain
- Remove Next.js basePath "/admin" — admin now serves at root - Update all internal links from /admin/xxx to /xxx - Change Go proxy to host-based routing: admin subdomain requests proxy to Next.js, /admin/* redirects to main web app - Update timeout middleware skipper for admin subdomain Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,6 @@ import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
output: "standalone",
|
||||
basePath: "/admin",
|
||||
trailingSlash: true,
|
||||
images: {
|
||||
unoptimized: true,
|
||||
|
||||
@@ -206,7 +206,7 @@ export default function AppleSocialAuthPage() {
|
||||
<TableCell className="font-mono text-sm text-muted-foreground">{entry.id}</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/users/${entry.user_id}`}
|
||||
href={`/users/${entry.user_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{entry.username}
|
||||
|
||||
@@ -205,7 +205,7 @@ export default function AuthTokensPage() {
|
||||
<TableCell className="font-mono text-sm text-muted-foreground">{token.user_id}</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/users/${token.user_id}`}
|
||||
href={`/users/${token.user_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{token.username}
|
||||
|
||||
@@ -221,7 +221,7 @@ export default function CompletionImagesPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/tasks/${img.task_id}`}
|
||||
href={`/tasks/${img.task_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{img.task_title || `Task #${img.task_id}`}
|
||||
@@ -234,7 +234,7 @@ export default function CompletionImagesPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/completions/${img.completion_id}`}
|
||||
href={`/completions/${img.completion_id}`}
|
||||
className="text-blue-600 hover:underline"
|
||||
>
|
||||
#{img.completion_id}
|
||||
|
||||
@@ -212,7 +212,7 @@ export default function ConfirmationCodesPage() {
|
||||
<TableCell className="font-mono text-sm text-muted-foreground">{code.id}</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/users/${code.user_id}`}
|
||||
href={`/users/${code.user_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{code.username}
|
||||
|
||||
@@ -312,7 +312,7 @@ export default function DevicesPage() {
|
||||
<TableCell>
|
||||
{device.user_id ? (
|
||||
<Link
|
||||
href={`/admin/users/${device.user_id}`}
|
||||
href={`/users/${device.user_id}`}
|
||||
className="text-blue-600 hover:underline"
|
||||
>
|
||||
{device.username || `User #${device.user_id}`}
|
||||
|
||||
@@ -221,7 +221,7 @@ export default function DocumentImagesPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/documents/${img.document_id}`}
|
||||
href={`/documents/${img.document_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{img.document_title || `Document #${img.document_id}`}
|
||||
@@ -229,7 +229,7 @@ export default function DocumentImagesPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/residences/${img.residence_id}`}
|
||||
href={`/residences/${img.residence_id}`}
|
||||
className="text-blue-600 hover:underline"
|
||||
>
|
||||
{img.residence_name || `#${img.residence_id}`}
|
||||
|
||||
@@ -102,7 +102,7 @@ export default function NotificationPrefsPage() {
|
||||
header: 'User',
|
||||
cell: ({ row }) => (
|
||||
<Link
|
||||
href={`/admin/users/${row.original.user_id}`}
|
||||
href={`/users/${row.original.user_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{row.original.username}
|
||||
@@ -265,7 +265,7 @@ export default function NotificationPrefsPage() {
|
||||
<DropdownMenuLabel>Actions</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href={`/admin/users/${pref.user_id}`}>View User</Link>
|
||||
<Link href={`/users/${pref.user_id}`}>View User</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
className="text-destructive"
|
||||
|
||||
@@ -125,7 +125,7 @@ const columns: ColumnDef<OnboardingEmail>[] = [
|
||||
<DropdownMenuContent align="end">
|
||||
<DropdownMenuLabel>Actions</DropdownMenuLabel>
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href={`/admin/users/${email.user_id}`}>View user</Link>
|
||||
<Link href={`/users/${email.user_id}`}>View user</Link>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
@@ -245,7 +245,7 @@ export default function PasswordResetCodesPage() {
|
||||
<TableCell className="font-mono text-sm text-muted-foreground">{code.id}</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/users/${code.user_id}`}
|
||||
href={`/users/${code.user_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{code.username}
|
||||
|
||||
@@ -232,7 +232,7 @@ export default function ShareCodesPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/residences/${code.residence_id}`}
|
||||
href={`/residences/${code.residence_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{code.residence_name}
|
||||
@@ -240,7 +240,7 @@ export default function ShareCodesPage() {
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/users/${code.created_by_id}`}
|
||||
href={`/users/${code.created_by_id}`}
|
||||
className="text-blue-600 hover:underline"
|
||||
>
|
||||
{code.created_by}
|
||||
|
||||
@@ -206,7 +206,7 @@ export default function UserProfilesPage() {
|
||||
<TableCell className="font-mono text-sm text-muted-foreground">{profile.id}</TableCell>
|
||||
<TableCell>
|
||||
<Link
|
||||
href={`/admin/users/${profile.user_id}`}
|
||||
href={`/users/${profile.user_id}`}
|
||||
className="font-medium text-blue-600 hover:underline"
|
||||
>
|
||||
{profile.username}
|
||||
|
||||
@@ -49,40 +49,40 @@ import {
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
const menuItems = [
|
||||
{ title: 'Dashboard', url: '/admin/', icon: Home },
|
||||
{ title: 'Users', url: '/admin/users', icon: Users },
|
||||
{ title: 'User Profiles', url: '/admin/user-profiles', icon: UserCircle },
|
||||
{ title: 'Apple Sign In', url: '/admin/apple-social-auth', icon: Apple },
|
||||
{ title: 'Auth Tokens', url: '/admin/auth-tokens', icon: Key },
|
||||
{ title: 'Confirmation Codes', url: '/admin/confirmation-codes', icon: Mail },
|
||||
{ title: 'Password Resets', url: '/admin/password-reset-codes', icon: KeyRound },
|
||||
{ title: 'Residences', url: '/admin/residences', icon: Building2 },
|
||||
{ title: 'Share Codes', url: '/admin/share-codes', icon: Share2 },
|
||||
{ title: 'Tasks', url: '/admin/tasks', icon: ClipboardList },
|
||||
{ title: 'Completions', url: '/admin/completions', icon: CheckCircle },
|
||||
{ title: 'Completion Images', url: '/admin/completion-images', icon: Image },
|
||||
{ title: 'Contractors', url: '/admin/contractors', icon: Wrench },
|
||||
{ title: 'Documents', url: '/admin/documents', icon: FileText },
|
||||
{ title: 'Document Images', url: '/admin/document-images', icon: ImagePlus },
|
||||
{ title: 'Notifications', url: '/admin/notifications', icon: Bell },
|
||||
{ title: 'Notification Prefs', url: '/admin/notification-prefs', icon: BellRing },
|
||||
{ title: 'Onboarding Emails', url: '/admin/onboarding-emails', icon: MailCheck },
|
||||
{ title: 'Devices', url: '/admin/devices', icon: Smartphone },
|
||||
{ title: 'Subscriptions', url: '/admin/subscriptions', icon: CreditCard },
|
||||
{ title: 'Dashboard', url: '/', icon: Home },
|
||||
{ title: 'Users', url: '/users', icon: Users },
|
||||
{ title: 'User Profiles', url: '/user-profiles', icon: UserCircle },
|
||||
{ title: 'Apple Sign In', url: '/apple-social-auth', icon: Apple },
|
||||
{ title: 'Auth Tokens', url: '/auth-tokens', icon: Key },
|
||||
{ title: 'Confirmation Codes', url: '/confirmation-codes', icon: Mail },
|
||||
{ title: 'Password Resets', url: '/password-reset-codes', icon: KeyRound },
|
||||
{ title: 'Residences', url: '/residences', icon: Building2 },
|
||||
{ title: 'Share Codes', url: '/share-codes', icon: Share2 },
|
||||
{ title: 'Tasks', url: '/tasks', icon: ClipboardList },
|
||||
{ title: 'Completions', url: '/completions', icon: CheckCircle },
|
||||
{ title: 'Completion Images', url: '/completion-images', icon: Image },
|
||||
{ title: 'Contractors', url: '/contractors', icon: Wrench },
|
||||
{ title: 'Documents', url: '/documents', icon: FileText },
|
||||
{ title: 'Document Images', url: '/document-images', icon: ImagePlus },
|
||||
{ title: 'Notifications', url: '/notifications', icon: Bell },
|
||||
{ title: 'Notification Prefs', url: '/notification-prefs', icon: BellRing },
|
||||
{ title: 'Onboarding Emails', url: '/onboarding-emails', icon: MailCheck },
|
||||
{ title: 'Devices', url: '/devices', icon: Smartphone },
|
||||
{ title: 'Subscriptions', url: '/subscriptions', icon: CreditCard },
|
||||
];
|
||||
|
||||
const limitationsItems = [
|
||||
{ title: 'Tier Limits', url: '/admin/limitations', icon: Layers },
|
||||
{ title: 'Upgrade Triggers', url: '/admin/limitations/triggers', icon: Sparkles },
|
||||
{ title: 'Tier Limits', url: '/limitations', icon: Layers },
|
||||
{ title: 'Upgrade Triggers', url: '/limitations/triggers', icon: Sparkles },
|
||||
];
|
||||
|
||||
const settingsItems = [
|
||||
{ title: 'Monitoring', url: '/admin/monitoring', icon: Activity },
|
||||
{ title: 'Automation Reference', url: '/admin/automation-reference', icon: Cog },
|
||||
{ title: 'Lookup Tables', url: '/admin/lookups', icon: BookOpen },
|
||||
{ title: 'Task Templates', url: '/admin/task-templates', icon: LayoutTemplate },
|
||||
{ title: 'Admin Users', url: '/admin/admin-users', icon: UserCog },
|
||||
{ title: 'Settings', url: '/admin/settings', icon: Settings },
|
||||
{ title: 'Monitoring', url: '/monitoring', icon: Activity },
|
||||
{ title: 'Automation Reference', url: '/automation-reference', icon: Cog },
|
||||
{ title: 'Lookup Tables', url: '/lookups', icon: BookOpen },
|
||||
{ title: 'Task Templates', url: '/task-templates', icon: LayoutTemplate },
|
||||
{ title: 'Admin Users', url: '/admin-users', icon: UserCog },
|
||||
{ title: 'Settings', url: '/settings', icon: Settings },
|
||||
];
|
||||
|
||||
export function AppSidebar() {
|
||||
@@ -134,7 +134,7 @@ export function AppSidebar() {
|
||||
<SidebarMenuItem key={item.title}>
|
||||
<SidebarMenuButton
|
||||
asChild
|
||||
isActive={pathname === item.url || (item.url !== '/admin/limitations' && pathname.startsWith(item.url))}
|
||||
isActive={pathname === item.url || (item.url !== '/limitations' && pathname.startsWith(item.url))}
|
||||
>
|
||||
<a href={item.url}>
|
||||
<item.icon className="h-4 w-4" />
|
||||
|
||||
@@ -41,7 +41,7 @@ api.interceptors.response.use(
|
||||
if (error.response?.status === 401) {
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.removeItem('admin_token');
|
||||
window.location.href = '/admin/login/';
|
||||
window.location.href = '/login/';
|
||||
}
|
||||
}
|
||||
return Promise.reject(error);
|
||||
|
||||
Reference in New Issue
Block a user