feat: 系统管理页面完全支持浏览器黑夜模式

- 更新背景色、容器、卡片样式支持dark模式
- 更新所有表格(素材、用户)样式支持dark模式
- 更新标签栏、标题、文本颜色支持dark模式
- 更新分类管理(使用店铺、场景类别)支持dark模式
- 更新部门管理UI支持dark模式
- 更新所有按钮、输入框、模态框支持dark模式
- 更新空状态、加载状态文本颜色

现在系统管理和系统设置页面都完全支持黑夜模式,提升用户体验!
This commit is contained in:
chenpei 2025-10-27 17:33:13 +08:00
parent 52f8b930bb
commit 0c4e61ccfc

View File

@ -583,7 +583,7 @@ export default function AdminPage() {
if (status === 'loading' || loading) {
return (
<div className="min-h-screen flex items-center justify-center">
<div className="text-xl text-gray-600">加载中...</div>
<div className="text-xl text-gray-600 dark:text-gray-400">加载中...</div>
</div>
)
}
@ -593,7 +593,7 @@ export default function AdminPage() {
}
return (
<div className="min-h-screen bg-gray-50">
<div className="min-h-screen bg-gray-50 dark:bg-gray-900">
<Header session={session} />
{/* Toast通知 */}
@ -609,7 +609,7 @@ export default function AdminPage() {
<main className="container mx-auto px-4 py-8 max-w-7xl">
<div className="flex items-center justify-between mb-8">
<h1 className="text-3xl font-bold text-gray-900">系统管理</h1>
<h1 className="text-3xl font-bold text-gray-900 dark:text-white">系统管理</h1>
<button
onClick={() => router.push('/admin/settings')}
className="btn-primary flex items-center gap-2"
@ -622,14 +622,14 @@ export default function AdminPage() {
</div>
{/* Tabs */}
<div className="flex space-x-4 border-b border-gray-200 mb-8">
<div className="flex space-x-4 border-b border-gray-200 dark:border-gray-700 mb-8">
<button
type="button"
onClick={() => setActiveTab('materials')}
className={`pb-4 px-4 font-medium transition-colors ${
activeTab === 'materials'
? 'text-gray-900 border-b-2 border-gray-900'
: 'text-gray-600 hover:text-gray-900'
? 'text-gray-900 dark:text-white border-b-2 border-gray-900 dark:border-white'
: 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white'
}`}
>
素材管理
@ -639,8 +639,8 @@ export default function AdminPage() {
onClick={() => setActiveTab('users')}
className={`pb-4 px-4 font-medium transition-colors ${
activeTab === 'users'
? 'text-gray-900 border-b-2 border-gray-900'
: 'text-gray-600 hover:text-gray-900'
? 'text-gray-900 dark:text-white border-b-2 border-gray-900 dark:border-white'
: 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white'
}`}
>
用户管理
@ -650,8 +650,8 @@ export default function AdminPage() {
onClick={() => setActiveTab('categories')}
className={`pb-4 px-4 font-medium transition-colors ${
activeTab === 'categories'
? 'text-gray-900 border-b-2 border-gray-900'
: 'text-gray-600 hover:text-gray-900'
? 'text-gray-900 dark:text-white border-b-2 border-gray-900 dark:border-white'
: 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white'
}`}
>
分类管理
@ -661,8 +661,8 @@ export default function AdminPage() {
onClick={() => setActiveTab('departments')}
className={`pb-4 px-4 font-medium transition-colors ${
activeTab === 'departments'
? 'text-gray-900 border-b-2 border-gray-900'
: 'text-gray-600 hover:text-gray-900'
? 'text-gray-900 dark:text-white border-b-2 border-gray-900 dark:border-white'
: 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white'
}`}
>
部门管理
@ -674,29 +674,29 @@ export default function AdminPage() {
<div className="card-apple overflow-hidden">
<div className="overflow-x-auto">
<table className="w-full">
<thead className="bg-gray-50 border-b border-gray-200">
<thead className="bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
预览图
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
商品型号
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
场景名称
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
作者
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
上传时间
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
操作
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
<tbody className="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
{materials.map((material) => (
<tr key={material.id}>
<td className="px-6 py-4 whitespace-nowrap">
@ -707,37 +707,37 @@ export default function AdminPage() {
/>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<div className="text-sm font-medium text-gray-900">
<div className="text-sm font-medium text-gray-900 dark:text-white">
{material.productModel}
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<div className="text-sm text-gray-900">
<div className="text-sm text-gray-900 dark:text-white">
{material.sceneName}
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<div className="text-sm text-gray-900">
<div className="text-sm text-gray-900 dark:text-white">
{material.authorName}
</div>
<div className="text-xs text-gray-500">
<div className="text-xs text-gray-500 dark:text-gray-400">
@{material.user.username}
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
{format(new Date(material.createdAt), 'yyyy-MM-dd HH:mm')}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm">
<div className="flex items-center space-x-3">
<button
onClick={() => setEditingMaterial(material)}
className="text-gray-700 hover:text-gray-900 font-medium"
className="text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white font-medium"
>
编辑
</button>
<button
onClick={() => handleDeleteMaterial(material.id)}
className="text-gray-700 hover:text-gray-900 font-medium"
className="text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white font-medium"
>
删除
</button>
@ -749,7 +749,7 @@ export default function AdminPage() {
</table>
</div>
{materials.length === 0 && (
<div className="text-center py-8 text-gray-500">
<div className="text-center py-8 text-gray-500 dark:text-gray-400">
暂无素材
</div>
)}
@ -761,50 +761,50 @@ export default function AdminPage() {
<div className="card-apple overflow-hidden">
<div className="overflow-x-auto">
<table className="w-full">
<thead className="bg-gray-50 border-b border-gray-200">
<thead className="bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
用户名
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
邮箱
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
部门
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
角色
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
状态
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
下载权限
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
素材数量
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
注册时间
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
操作
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
<tbody className="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
{users.map((user) => (
<tr key={user.id}>
<td className="px-6 py-4 whitespace-nowrap">
<div className="text-sm font-medium text-gray-900">
<div className="text-sm font-medium text-gray-900 dark:text-white">
{user.username}
</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<div className="text-sm text-gray-900">{user.email}</div>
<div className="text-sm text-gray-900 dark:text-white">{user.email}</div>
</td>
<td className="px-6 py-4 whitespace-nowrap">
<div className="text-sm text-gray-500">
<div className="text-sm text-gray-500 dark:text-gray-400">
{user.department || '-'}
</div>
</td>
@ -841,10 +841,10 @@ export default function AdminPage() {
{user.canDownload ? '允许下载' : '禁止下载'}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
{user._count.materials}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400">
{format(new Date(user.createdAt), 'yyyy-MM-dd')}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm">
@ -907,7 +907,7 @@ export default function AdminPage() {
</table>
</div>
{users.length === 0 && (
<div className="text-center py-8 text-gray-500">
<div className="text-center py-8 text-gray-500 dark:text-gray-400">
暂无用户
</div>
)}
@ -968,7 +968,7 @@ export default function AdminPage() {
</button>
<button
onClick={() => setEditingCategory(null)}
className="flex-1 px-3 py-1.5 border border-gray-300 text-gray-700 text-sm rounded-lg hover:bg-gray-50 transition-colors"
className="flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 text-sm rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"
>
取消
</button>
@ -1004,7 +1004,7 @@ export default function AdminPage() {
))}
</div>
{categories.length === 0 && (
<div className="text-center py-8 text-gray-500">
<div className="text-center py-8 text-gray-500 dark:text-gray-400">
暂无使用店铺分类
</div>
)}
@ -1062,7 +1062,7 @@ export default function AdminPage() {
</button>
<button
onClick={() => setEditingScene(null)}
className="flex-1 px-3 py-1.5 border border-gray-300 text-gray-700 text-sm rounded-lg hover:bg-gray-50 transition-colors"
className="flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 text-sm rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"
>
取消
</button>
@ -1098,7 +1098,7 @@ export default function AdminPage() {
))}
</div>
{scenes.length === 0 && (
<div className="text-center py-8 text-gray-500">
<div className="text-center py-8 text-gray-500 dark:text-gray-400">
暂无场景类别
</div>
)}