mosaicmap/app/admin/permissions/page.tsx
2025-08-17 20:28:13 +08:00

123 lines
7.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
import { IconShield, IconUsers, IconKey, IconSettings } from "@tabler/icons-react"
import { SiteHeader } from "../site-header"
import { RoleTable } from "./role-table"
import { PermissionTable } from "./permission-table"
import { UserRoleManagement } from "./user-role-management"
import { RolePermissionManagement } from "./role-permission-management"
import { ScrollArea } from "@/components/ui/scroll-area"
export default function PermissionsPage() {
return (
<>
<SiteHeader breadcrumbs={[{ label: "Home", href: "/" }, { label: "权限管理", href: "/admin/permissions" }]} />
<ScrollArea className="h-full">
<div className="flex flex-1 flex-col">
<div className="@container/main flex flex-1 flex-col gap-2 py-4">
<div className="flex flex-col gap-4 py-4 md:gap-6 md:py-6">
<div className="px-6">
<h1 className="text-2xl font-bold flex items-center gap-2">
<IconShield className="h-6 w-6" />
</h1>
<p className="text-muted-foreground mt-1">
</p>
</div>
{/* 统计卡片 */}
<div className="grid grid-cols-1 md:grid-cols-4 gap-4 px-6">
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium"></CardTitle>
<IconUsers className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">1,234</div>
<p className="text-xs text-muted-foreground">+20% </p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium"></CardTitle>
<IconShield className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">8</div>
<p className="text-xs text-muted-foreground">5</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium"></CardTitle>
<IconKey className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">45</div>
<p className="text-xs text-muted-foreground">12</p>
</CardContent>
</Card>
<Card>
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-sm font-medium">访</CardTitle>
<IconSettings className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className="text-2xl font-bold">2,847</div>
<p className="text-xs text-muted-foreground">访</p>
</CardContent>
</Card>
</div>
{/* 主要功能标签页 */}
<div className="px-6">
<Tabs defaultValue="roles" className="w-full">
<TabsList className="grid w-full grid-cols-4">
<TabsTrigger value="roles" className="flex items-center gap-2">
<IconShield className="h-4 w-4" />
</TabsTrigger>
<TabsTrigger value="permissions" className="flex items-center gap-2">
<IconKey className="h-4 w-4" />
</TabsTrigger>
<TabsTrigger value="user-roles" className="flex items-center gap-2">
<IconUsers className="h-4 w-4" />
</TabsTrigger>
<TabsTrigger value="role-permissions" className="flex items-center gap-2">
<IconSettings className="h-4 w-4" />
</TabsTrigger>
</TabsList>
<TabsContent value="roles" className="mt-6">
<RoleTable />
</TabsContent>
<TabsContent value="permissions" className="mt-6">
<PermissionTable />
</TabsContent>
<TabsContent value="user-roles" className="mt-6">
<UserRoleManagement />
</TabsContent>
<TabsContent value="role-permissions" className="mt-6">
<RolePermissionManagement />
</TabsContent>
</Tabs>
</div>
</div>
</div>
</div>
</ScrollArea>
</>
)
}