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
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 Tuluobo
|
Copyright (c) 2025 Tuluobo
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -33,7 +33,7 @@ export default function IndexPage() {
|
|||||||
开始使用
|
开始使用
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="https://github.com/Tuluobo/discourse-connect">
|
<Link href="https://github.com/woodchen-ink/discourse-connect">
|
||||||
<Button
|
<Button
|
||||||
size="lg"
|
size="lg"
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@ -47,7 +47,7 @@ export default function IndexPage() {
|
|||||||
</main>
|
</main>
|
||||||
<footer className="bg-white py-8 shadow-inner dark:bg-gray-800">
|
<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">
|
<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
|
<a
|
||||||
href="https://q58.pro"
|
href="https://q58.pro"
|
||||||
className="text-[#25263A] hover:underline dark:text-[#A0A1B2]"
|
className="text-[#25263A] hover:underline dark:text-[#A0A1B2]"
|
||||||
|
@ -40,29 +40,35 @@ export default async function ClientsPage() {
|
|||||||
<Table>
|
<Table>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>应用名称</TableHead>
|
<TableHead className="w-[200px]">应用名称</TableHead>
|
||||||
<TableHead>Client ID</TableHead>
|
<TableHead className="w-[200px]">Client ID</TableHead>
|
||||||
<TableHead>Client Secret</TableHead>
|
<TableHead className="w-[200px]">Client Secret</TableHead>
|
||||||
<TableHead>回调地址</TableHead>
|
<TableHead>回调地址</TableHead>
|
||||||
<TableHead className="text-right">操作</TableHead>
|
<TableHead className="w-[140px]">操作</TableHead>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{clients.map((client) => (
|
{clients.map((client) => (
|
||||||
<TableRow key={client.id}>
|
<TableRow key={client.id}>
|
||||||
<TableCell>{client.name}</TableCell>
|
<TableCell className="font-medium">{client.name}</TableCell>
|
||||||
<TableCell className="font-mono">{client.clientId}</TableCell>
|
<TableCell className="font-mono text-sm">
|
||||||
<TableCell className="font-mono">
|
{client.clientId}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="font-mono text-sm">
|
||||||
{client.clientSecret}
|
{client.clientSecret}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>{client.redirectUri}</TableCell>
|
<TableCell className="max-w-[300px] truncate">
|
||||||
<TableCell className="text-right">
|
{client.redirectUri}
|
||||||
<Button variant="outline" size="sm" className="mr-2">
|
</TableCell>
|
||||||
编辑
|
<TableCell>
|
||||||
</Button>
|
<div className="flex items-center gap-2">
|
||||||
<Button variant="destructive" size="sm">
|
<Button variant="outline" size="sm">
|
||||||
删除
|
编辑
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button variant="destructive" size="sm">
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
))}
|
||||||
|
@ -42,9 +42,11 @@ export default function DashboardPage() {
|
|||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Button className="w-full" variant="outline">
|
<Link href="/dashboard/settings">
|
||||||
设置
|
<Button className="w-full" variant="outline">
|
||||||
</Button>
|
设置
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</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;
|
username?: string;
|
||||||
avatarUrl?: string;
|
avatarUrl?: string;
|
||||||
role: UserRole;
|
role: UserRole;
|
||||||
|
moderator: boolean;
|
||||||
|
groups: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
declare module "next-auth/jwt" {
|
declare module "next-auth/jwt" {
|
||||||
@ -13,6 +15,8 @@ declare module "next-auth/jwt" {
|
|||||||
username?: string;
|
username?: string;
|
||||||
avatarUrl?: string;
|
avatarUrl?: string;
|
||||||
role: UserRole;
|
role: UserRole;
|
||||||
|
moderator: boolean;
|
||||||
|
groups: string[];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user