);
}
diff --git a/src/app/(dashboard)/dashboard/page.tsx b/src/app/(dashboard)/dashboard/page.tsx
index 9fb3b11..2ce2dc0 100644
--- a/src/app/(dashboard)/dashboard/page.tsx
+++ b/src/app/(dashboard)/dashboard/page.tsx
@@ -1,34 +1,53 @@
+import Link from "next/link";
+import { AppWindow, Settings } from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+
export default function DashboardPage() {
return (
-
- {/* Sidebar Navigation */}
-
+
+
+
+
+
+
+ 应用管理
+
+
+ 管理您的 OAuth 应用,查看应用详情和统计信息
+
+
+
+
+
+
+
+
- {/* Main Content Area */}
-
- Welcome to Your Dashboard
- Select an option from the menu to get started.
-
+
+
+
+
+ 账号设置
+
+
+ 管理您的账号信息,包括个人资料和安全设置
+
+
+
+
+
+
+
);
}
diff --git a/src/app/(dashboard)/layout.tsx b/src/app/(dashboard)/layout.tsx
index ae409bb..a73f8d6 100644
--- a/src/app/(dashboard)/layout.tsx
+++ b/src/app/(dashboard)/layout.tsx
@@ -1,6 +1,7 @@
import { redirect } from "next/navigation";
import { getCurrentUser } from "@/lib/session";
+import { DashboardHeader } from "@/components/layout/dashboard-header";
export default async function DashboardLayout({
children,
@@ -10,5 +11,10 @@ export default async function DashboardLayout({
const user = await getCurrentUser();
if (!user) redirect("/sign-in");
- return
{children}
;
+ return (
+
+
+ {children}
+
+ );
}
diff --git a/src/components/clients/add-client.tsx b/src/components/clients/add-client.tsx
index c375224..733c23c 100644
--- a/src/components/clients/add-client.tsx
+++ b/src/components/clients/add-client.tsx
@@ -1,12 +1,17 @@
"use client";
import { useState } from "react";
+import { useRouter } from "next/navigation";
import { AddClientAction } from "@/actions/add-client";
+import { Plus } from "lucide-react";
+import { useToast } from "@/hooks/use-toast";
import { Button } from "@/components/ui/button";
import {
Dialog,
DialogContent,
+ DialogDescription,
+ DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
@@ -15,65 +20,111 @@ import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
export function AddClientButton() {
- const [isAddClientOpen, setIsAddClientOpen] = useState(false);
+ const [open, setOpen] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+ const { toast } = useToast();
+ const router = useRouter();
+
+ async function onSubmit(event: React.FormEvent
) {
+ event.preventDefault();
+ setIsLoading(true);
+
+ const formData = new FormData(event.currentTarget);
+ const response = await AddClientAction(formData);
+
+ setIsLoading(false);
+
+ if (response.success) {
+ setOpen(false);
+ router.refresh();
+ toast({
+ title: "应用创建成功",
+ description: "您可以开始使用新创建的应用了",
+ });
+ } else {
+ toast({
+ variant: "destructive",
+ title: "创建失败",
+ description: response.error,
+ });
+ }
+ }
return (
-