mirror of
https://github.com/woodchen-ink/Q58Connect.git
synced 2025-07-18 05:51:55 +08:00
chore: Update copyright year and GitHub repository link
This commit is contained in:
parent
2bf60a8a22
commit
56131dd348
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 Tuluobo
|
||||
Copyright (c) 2025 Tuluobo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -33,7 +33,7 @@ export default function IndexPage() {
|
||||
开始使用
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="https://github.com/Tuluobo/discourse-connect">
|
||||
<Link href="https://github.com/woodchen-ink/discourse-connect">
|
||||
<Button
|
||||
size="lg"
|
||||
variant="outline"
|
||||
@ -47,7 +47,7 @@ export default function IndexPage() {
|
||||
</main>
|
||||
<footer className="bg-white py-8 shadow-inner dark:bg-gray-800">
|
||||
<div className="mx-auto max-w-7xl px-4 text-center text-gray-600 dark:text-gray-400 sm:px-6 lg:px-8">
|
||||
© 2024{" "}
|
||||
© 2025{" "}
|
||||
<a
|
||||
href="https://q58.pro"
|
||||
className="text-[#25263A] hover:underline dark:text-[#A0A1B2]"
|
||||
|
@ -40,29 +40,35 @@ export default async function ClientsPage() {
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>应用名称</TableHead>
|
||||
<TableHead>Client ID</TableHead>
|
||||
<TableHead>Client Secret</TableHead>
|
||||
<TableHead className="w-[200px]">应用名称</TableHead>
|
||||
<TableHead className="w-[200px]">Client ID</TableHead>
|
||||
<TableHead className="w-[200px]">Client Secret</TableHead>
|
||||
<TableHead>回调地址</TableHead>
|
||||
<TableHead className="text-right">操作</TableHead>
|
||||
<TableHead className="w-[140px]">操作</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{clients.map((client) => (
|
||||
<TableRow key={client.id}>
|
||||
<TableCell>{client.name}</TableCell>
|
||||
<TableCell className="font-mono">{client.clientId}</TableCell>
|
||||
<TableCell className="font-mono">
|
||||
<TableCell className="font-medium">{client.name}</TableCell>
|
||||
<TableCell className="font-mono text-sm">
|
||||
{client.clientId}
|
||||
</TableCell>
|
||||
<TableCell className="font-mono text-sm">
|
||||
{client.clientSecret}
|
||||
</TableCell>
|
||||
<TableCell>{client.redirectUri}</TableCell>
|
||||
<TableCell className="text-right">
|
||||
<Button variant="outline" size="sm" className="mr-2">
|
||||
编辑
|
||||
</Button>
|
||||
<Button variant="destructive" size="sm">
|
||||
删除
|
||||
</Button>
|
||||
<TableCell className="max-w-[300px] truncate">
|
||||
{client.redirectUri}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button variant="outline" size="sm">
|
||||
编辑
|
||||
</Button>
|
||||
<Button variant="destructive" size="sm">
|
||||
删除
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
|
@ -42,9 +42,11 @@ export default function DashboardPage() {
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Button className="w-full" variant="outline">
|
||||
设置
|
||||
</Button>
|
||||
<Link href="/dashboard/settings">
|
||||
<Button className="w-full" variant="outline">
|
||||
设置
|
||||
</Button>
|
||||
</Link>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
62
src/app/(dashboard)/dashboard/settings/page.tsx
Normal file
62
src/app/(dashboard)/dashboard/settings/page.tsx
Normal file
@ -0,0 +1,62 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { getCurrentUser } from "@/lib/session";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card";
|
||||
|
||||
export default async function SettingsPage() {
|
||||
const user = await getCurrentUser();
|
||||
if (!user) {
|
||||
redirect("/sign-in");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>个人资料</CardTitle>
|
||||
<CardDescription>查看和管理您的个人信息</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="grid gap-1">
|
||||
<p className="text-sm font-medium">用户名</p>
|
||||
<p className="text-sm text-muted-foreground">{user.username}</p>
|
||||
</div>
|
||||
<div className="grid gap-1">
|
||||
<p className="text-sm font-medium">邮箱</p>
|
||||
<p className="text-sm text-muted-foreground">{user.email}</p>
|
||||
</div>
|
||||
<div className="grid gap-1">
|
||||
<p className="text-sm font-medium">昵称</p>
|
||||
<p className="text-sm text-muted-foreground">{user.name || "-"}</p>
|
||||
</div>
|
||||
<div className="grid gap-1">
|
||||
<p className="text-sm font-medium">角色</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{user.role === "ADMIN" ? "管理员" : "普通用户"}
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid gap-1">
|
||||
<p className="text-sm font-medium">论坛版主</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{user.moderator ? "是" : "否"}
|
||||
</p>
|
||||
</div>
|
||||
{user.groups && user.groups.length > 0 && (
|
||||
<div className="grid gap-1">
|
||||
<p className="text-sm font-medium">用户组</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{user.groups.join(", ")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
4
src/types/next-auth.d.ts
vendored
4
src/types/next-auth.d.ts
vendored
@ -6,6 +6,8 @@ export type ExtendedUser = User & {
|
||||
username?: string;
|
||||
avatarUrl?: string;
|
||||
role: UserRole;
|
||||
moderator: boolean;
|
||||
groups: string[];
|
||||
};
|
||||
|
||||
declare module "next-auth/jwt" {
|
||||
@ -13,6 +15,8 @@ declare module "next-auth/jwt" {
|
||||
username?: string;
|
||||
avatarUrl?: string;
|
||||
role: UserRole;
|
||||
moderator: boolean;
|
||||
groups: string[];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user