增加网站配置

This commit is contained in:
qaq
2025-07-24 16:48:47 +08:00
parent b3135d3b0f
commit d28c04d7ba
21 changed files with 983 additions and 61 deletions
+18 -7
View File
@@ -10,6 +10,7 @@ import { Logo } from '@/components/icons';
import { ThemeSwitch } from '@/components/theme-switch';
import { updatePassword } from '@/api';
import { safeLogout } from '@/utils/logout';
import { siteConfig } from '@/config/site';
interface MenuItem {
path: string;
@@ -105,6 +106,16 @@ export default function AdminLayout({
</svg>
),
adminOnly: true
},
{
path: '/config',
label: '网站配置',
icon: (
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fillRule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clipRule="evenodd" />
</svg>
),
adminOnly: true
}
];
@@ -245,7 +256,7 @@ export default function AdminLayout({
<aside className={`
${isMobile ? 'fixed' : 'relative'}
${isMobile && !mobileMenuVisible ? '-translate-x-full' : 'translate-x-0'}
${isMobile ? 'w-64' : 'w-64'}
${isMobile ? 'w-64' : 'w-72'}
bg-white dark:bg-black
shadow-lg
border-r border-gray-200 dark:border-gray-600
@@ -255,12 +266,12 @@ export default function AdminLayout({
h-full
`}>
{/* Logo 区域 */}
<div className="px-4 py-3 h-14 flex items-center">
<div className="flex items-center gap-3">
<Logo size={28} />
<div>
<h1 className="text-base font-bold text-foreground">哆啦A梦</h1>
<p className="text-xs text-default-500">v1.0.8</p>
<div className="px-3 py-3 h-14 flex items-center">
<div className="flex items-center gap-2 w-full">
<Logo size={24} />
<div className="flex-1 min-w-0">
<h1 className="text-sm font-bold text-foreground overflow-hidden whitespace-nowrap">{siteConfig.name}</h1>
<p className="text-xs text-default-500">v{siteConfig.version}</p>
</div>
</div>
</div>
+2 -2
View File
@@ -8,9 +8,9 @@ export default function DefaultLayout({
children: React.ReactNode;
}) {
return (
<div className="relative flex flex-col h-screen">
<div className="relative flex flex-col min-h-screen bg-white dark:bg-black">
<Navbar />
<main className="container mx-auto max-w-7xl px-6 flex-grow pt-16">
<main className="container mx-auto max-w-7xl px-4 sm:px-6 flex-grow pt-4 sm:pt-16">
{children}
</main>
<footer className="w-full flex items-center justify-center py-3">