add url analytics and logs routers
This commit is contained in:
9
app/(protected)/admin/urls/analytics/loading.tsx
Normal file
9
app/(protected)/admin/urls/analytics/loading.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
export default function DashboardUrlsLoading() {
|
||||
return (
|
||||
<>
|
||||
<Skeleton className="h-[400px] w-full rounded-lg" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
22
app/(protected)/admin/urls/analytics/page.tsx
Normal file
22
app/(protected)/admin/urls/analytics/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { getCurrentUser } from "@/lib/session";
|
||||
import { constructMetadata } from "@/lib/utils";
|
||||
import Globe from "@/app/(protected)/dashboard/urls/globe";
|
||||
|
||||
export const metadata = constructMetadata({
|
||||
title: "Globe Analytics",
|
||||
description: "Display link's globe analytics.",
|
||||
});
|
||||
|
||||
export default async function DashboardPage() {
|
||||
const user = await getCurrentUser();
|
||||
|
||||
if (!user?.id) redirect("/login");
|
||||
|
||||
return (
|
||||
<>
|
||||
<Globe isAdmin />
|
||||
</>
|
||||
);
|
||||
}
|
||||
11
app/(protected)/admin/urls/logs/loading.tsx
Normal file
11
app/(protected)/admin/urls/logs/loading.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { DashboardHeader } from "@/components/dashboard/header";
|
||||
|
||||
export default function DashboardUrlsLoading() {
|
||||
return (
|
||||
<>
|
||||
<DashboardHeader heading="Live Logs" text="" />
|
||||
<Skeleton className="h-[400px] w-full rounded-lg" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
24
app/(protected)/admin/urls/logs/page.tsx
Normal file
24
app/(protected)/admin/urls/logs/page.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { getCurrentUser } from "@/lib/session";
|
||||
import { constructMetadata } from "@/lib/utils";
|
||||
import { DashboardHeader } from "@/components/dashboard/header";
|
||||
import LiveLog from "@/app/(protected)/dashboard/urls/live-logs";
|
||||
|
||||
export const metadata = constructMetadata({
|
||||
title: "Live Logs",
|
||||
description: "Display link's real-time live logs.",
|
||||
});
|
||||
|
||||
export default async function DashboardPage() {
|
||||
const user = await getCurrentUser();
|
||||
|
||||
if (!user?.id) redirect("/login");
|
||||
|
||||
return (
|
||||
<>
|
||||
<DashboardHeader heading="Live Logs" text="" />
|
||||
<LiveLog live={true} admin />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -120,6 +120,16 @@ export const sidebarLinks: SidebarNavItem[] = [
|
||||
title: "Cloud Storage Manage",
|
||||
authorizeOnly: UserRole.ADMIN,
|
||||
},
|
||||
{
|
||||
href: "/admin/urls/analytics",
|
||||
title: "Analytics",
|
||||
authorizeOnly: UserRole.ADMIN,
|
||||
},
|
||||
{
|
||||
href: "/admin/urls/logs",
|
||||
title: "Ip Logs",
|
||||
authorizeOnly: UserRole.ADMIN,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user