Skip to content

Commit

Permalink
feat: 控制台和设置页面
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed Apr 7, 2024
1 parent 7c6cb63 commit 76d83c8
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function AdminLayout({
<aside className="hidden w-[200px] flex-col sm:flex">
<BaseSide/>
</aside>
<main className="flex w-full flex-1 flex-col overflow-hidden p-2">
<main className="flex w-full h-full flex-1 flex-col overflow-hidden p-2">
{children}
</main>
</div>
Expand Down
35 changes: 24 additions & 11 deletions app/admin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
import { getCurrentUser } from '~/server/lib/user'
import { Card, CardBody } from '@nextui-org/card'

export default async function Admin() {
const user = await getCurrentUser()

return (
<>
{ user ?
<div>
<p>控制台(已登录)</p>
<p>{JSON.stringify(user)}</p>
</div>
:
'控制台(未登录)'
}
</>
)
<div className="flex flex-col space-y-2 h-full flex-1">
<Card>
<CardBody>
<p>
{user ?
<div>
<p>控制台(已登录)</p>
</div>
:
'控制台(未登录)'
}
</p>
</CardBody>
</Card>
<Card className="flex-1">
<CardBody>
<p>
<p>{JSON.stringify(user)}</p>
</p>
</CardBody>
</Card>
</div>
)
}
35 changes: 31 additions & 4 deletions app/admin/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
export default async function Admin() {
'use client'

import React from 'react'
import {Tabs, Tab, Card, CardBody} from '@nextui-org/react'

export default async function Settings() {
return (
<>
系统设置
</>
<div className="flex flex-col space-y-2 h-full flex-1">
<Tabs aria-label="设置选项卡" radius="md" variant="light">
<Tab key="system" title="系统">
<Card>
<CardBody>
系统设置
</CardBody>
</Card>
</Tab>
<Tab key="s3" title="S3">
<Card>
<CardBody>
S3 设置
</CardBody>
</Card>
</Tab>
<Tab key="alist" title="AList">
<Card>
<CardBody>
AList 设置
</CardBody>
</Card>
</Tab>
</Tabs>
</div>
)
}
1 change: 1 addition & 0 deletions components/DropMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const DropMenu = () => {
<Dropdown>
<DropdownTrigger>
<Avatar
className="cursor-pointer"
size="sm"
isBordered
src={session?.user?.image || ''}
Expand Down

0 comments on commit 76d83c8

Please sign in to comment.