添加网关列表权限
This commit is contained in:
@@ -20,6 +20,8 @@ import { Button } from "@/components/ui/button"
|
||||
import type { Gateway } from "@/models/gateway"
|
||||
import CreatePage from "./create"
|
||||
import { format } from "date-fns"
|
||||
import { ScopeProxyWrite } from "@/lib/scopes"
|
||||
import { Auth } from "@/components/auth"
|
||||
|
||||
export default function GatewayPage() {
|
||||
const [loading, setLoading] = useState(false)
|
||||
@@ -28,11 +30,13 @@ export default function GatewayPage() {
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<div className="flex justify-between items-stretch">
|
||||
<div className="flex gap-3">
|
||||
<CreatePage onSuccess={table.refresh} />
|
||||
<Auth scope={ScopeProxyWrite}>
|
||||
<div className="flex justify-between items-stretch">
|
||||
<div className="flex gap-3">
|
||||
<CreatePage onSuccess={table.refresh} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Auth>
|
||||
<Suspense>
|
||||
<DataTable<Gateway>
|
||||
{...table}
|
||||
@@ -70,7 +74,7 @@ export default function GatewayPage() {
|
||||
header: "操作",
|
||||
cell: ({ row }) => (
|
||||
<div className="flex gap-2">
|
||||
<Delete gateway={row.original} onSuccess={table.refresh} />
|
||||
<Auth scope={ScopeProxyWrite}><Delete gateway={row.original} onSuccess={table.refresh} /></Auth>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -47,6 +47,7 @@ import {
|
||||
ScopeDiscountRead,
|
||||
ScopePermissionRead,
|
||||
ScopeProductRead,
|
||||
ScopeProxyRead,
|
||||
ScopeResourceRead,
|
||||
ScopeTradeRead,
|
||||
ScopeUserRead,
|
||||
@@ -254,6 +255,7 @@ const menuSections: { title: string; items: NavItemProps[] }[] = [
|
||||
href: "/gateway",
|
||||
icon: DoorClosedIcon,
|
||||
label: "网关列表",
|
||||
requiredScope:ScopeProxyRead
|
||||
},
|
||||
{
|
||||
href: "/admin",
|
||||
|
||||
Reference in New Issue
Block a user