fix: tighten workspace controls
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Table } from "@/components/ui/table";
|
||||
import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
import { hasPermission } from "@/modules/core/server/permissions";
|
||||
import { readData } from "@/modules/core/server/store";
|
||||
import { TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { TablePagination, TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { getPage, getPageCount, getSearchParam, paginate, type SearchParams } from "@/modules/settings/lib/pagination";
|
||||
|
||||
type AuditPageProps = {
|
||||
@@ -39,10 +38,8 @@ export default async function AuditPage({ searchParams }: AuditPageProps): Promi
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
<section>
|
||||
<Badge variant="success">Audit</Badge>
|
||||
<h2 className="mt-3 text-xl font-semibold">审计日志</h2>
|
||||
<p className="mt-1 text-sm text-muted-foreground">关键操作、拒绝访问和故障处理留痕。</p>
|
||||
<section className="border-b pb-4">
|
||||
<h2 className="text-xl font-semibold">审计日志</h2>
|
||||
</section>
|
||||
|
||||
<Card>
|
||||
@@ -51,8 +48,6 @@ export default async function AuditPage({ searchParams }: AuditPageProps): Promi
|
||||
</CardHeader>
|
||||
<CardContent className="p-0">
|
||||
<TableToolbar
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/audit"
|
||||
query={query}
|
||||
searchPlaceholder="搜索操作者、动作、对象、结果"
|
||||
@@ -94,6 +89,13 @@ export default async function AuditPage({ searchParams }: AuditPageProps): Promi
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
<TablePagination
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/audit"
|
||||
query={query}
|
||||
total={filteredLogs.length}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import Link from "next/link";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Table } from "@/components/ui/table";
|
||||
import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
@@ -11,7 +10,7 @@ import {
|
||||
OrganizationManagementClient,
|
||||
OrganizationRowActions,
|
||||
} from "@/modules/settings/components/OrganizationManagementClient";
|
||||
import { TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { TablePagination, TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { getPage, getPageCount, getSearchParam, paginate, type SearchParams } from "@/modules/settings/lib/pagination";
|
||||
|
||||
type OrganizationsPageProps = {
|
||||
@@ -52,12 +51,8 @@ export default async function OrganizationsPage({ searchParams }: OrganizationsP
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
<section className="flex flex-col gap-4 border-b pb-5 lg:flex-row lg:items-end lg:justify-between">
|
||||
<div>
|
||||
<Badge variant="success">Organizations</Badge>
|
||||
<h2 className="mt-3 text-xl font-semibold">机构管理</h2>
|
||||
<p className="mt-1 text-sm text-muted-foreground">多机构租户、启停状态、成员邀请和机构角色初始化。</p>
|
||||
</div>
|
||||
<section className="flex flex-col gap-3 border-b pb-4 lg:flex-row lg:items-center lg:justify-between">
|
||||
<h2 className="text-xl font-semibold">机构管理</h2>
|
||||
{canManageOrganizations ? <OrganizationManagementClient /> : null}
|
||||
</section>
|
||||
|
||||
@@ -67,8 +62,6 @@ export default async function OrganizationsPage({ searchParams }: OrganizationsP
|
||||
</CardHeader>
|
||||
<CardContent className="p-0">
|
||||
<TableToolbar
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/organizations"
|
||||
query={query}
|
||||
searchPlaceholder="搜索机构名称、标识、状态"
|
||||
@@ -120,6 +113,13 @@ export default async function OrganizationsPage({ searchParams }: OrganizationsP
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
<TablePagination
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/organizations"
|
||||
query={query}
|
||||
total={filteredOrganizations.length}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Table } from "@/components/ui/table";
|
||||
import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
import { getRoleDefinitions, hasPermission, PERMISSION_DEFINITIONS } from "@/modules/core/server/permissions";
|
||||
import { RoleManagementClient, RoleRowActions } from "@/modules/settings/components/RoleManagementClient";
|
||||
import { TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { TablePagination, TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { getPage, getPageCount, getSearchParam, paginate, type SearchParams } from "@/modules/settings/lib/pagination";
|
||||
|
||||
type RolesPageProps = {
|
||||
@@ -37,12 +36,8 @@ export default async function RolesPage({ searchParams }: RolesPageProps): Promi
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
<section className="flex flex-col gap-4 border-b pb-5 lg:flex-row lg:items-end lg:justify-between">
|
||||
<div>
|
||||
<Badge variant="success">RBAC</Badge>
|
||||
<h2 className="mt-3 text-xl font-semibold">角色权限</h2>
|
||||
<p className="mt-1 text-sm text-muted-foreground">系统权限点、内置角色和机构自定义角色。</p>
|
||||
</div>
|
||||
<section className="flex flex-col gap-3 border-b pb-4 lg:flex-row lg:items-center lg:justify-between">
|
||||
<h2 className="text-xl font-semibold">角色权限</h2>
|
||||
{canManageRoles ? <RoleManagementClient permissions={PERMISSION_DEFINITIONS} /> : null}
|
||||
</section>
|
||||
|
||||
@@ -52,8 +47,6 @@ export default async function RolesPage({ searchParams }: RolesPageProps): Promi
|
||||
</CardHeader>
|
||||
<CardContent className="p-0">
|
||||
<TableToolbar
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/roles"
|
||||
query={query}
|
||||
searchPlaceholder="搜索角色、权限、说明"
|
||||
@@ -97,6 +90,13 @@ export default async function RolesPage({ searchParams }: RolesPageProps): Promi
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
<TablePagination
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/roles"
|
||||
query={query}
|
||||
total={filteredRoles.length}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@ import { getCurrentAuthContext } from "@/modules/core/server/auth";
|
||||
import { hasPermission } from "@/modules/core/server/permissions";
|
||||
import { readData } from "@/modules/core/server/store";
|
||||
import { IncidentStatusActions } from "@/modules/settings/components/IncidentStatusActions";
|
||||
import { TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { TablePagination, TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { getPage, getPageCount, getSearchParam, paginate, type SearchParams } from "@/modules/settings/lib/pagination";
|
||||
|
||||
type StatusPageProps = {
|
||||
@@ -42,10 +42,12 @@ export default async function StatusPage({ searchParams }: StatusPageProps): Pro
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
<section>
|
||||
<section className="flex flex-col gap-3 border-b pb-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 className="text-xl font-semibold">运行状态</h2>
|
||||
<p className="mt-1 text-sm text-muted-foreground">{databaseHealth.reason}</p>
|
||||
</div>
|
||||
<Badge variant={databaseHealth.ok ? "success" : "danger"}>{databaseHealth.ok ? "Healthy" : "Degraded"}</Badge>
|
||||
<h2 className="mt-3 text-xl font-semibold">运行状态</h2>
|
||||
<p className="mt-1 text-sm text-muted-foreground">{databaseHealth.reason}</p>
|
||||
</section>
|
||||
|
||||
<section className="grid gap-4 md:grid-cols-4">
|
||||
@@ -81,8 +83,6 @@ export default async function StatusPage({ searchParams }: StatusPageProps): Pro
|
||||
</CardHeader>
|
||||
<CardContent className="p-0">
|
||||
<TableToolbar
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/status"
|
||||
query={query}
|
||||
searchPlaceholder="搜索故障标题、来源、状态"
|
||||
@@ -132,6 +132,13 @@ export default async function StatusPage({ searchParams }: StatusPageProps): Pro
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
<TablePagination
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/status"
|
||||
query={query}
|
||||
total={filteredIncidents.length}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@ import { getRoleDefinitions, hasPermission } from "@/modules/core/server/permiss
|
||||
import { readData } from "@/modules/core/server/store";
|
||||
import { ROLE_LABELS } from "@/modules/core/types";
|
||||
import type { RoleId } from "@/modules/core/types";
|
||||
import { TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { TablePagination, TableToolbar } from "@/modules/settings/components/TableToolbar";
|
||||
import { UserAccountActions, UserManagementClient } from "@/modules/settings/components/UserManagementClient";
|
||||
import { getPage, getPageCount, getSearchParam, paginate, type SearchParams } from "@/modules/settings/lib/pagination";
|
||||
import { UserAvatar } from "@/modules/shared/components/UserAvatar";
|
||||
@@ -65,10 +65,8 @@ export default async function UsersPage({ searchParams }: UsersPageProps): Promi
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
<section>
|
||||
<Badge variant="success">Accounts</Badge>
|
||||
<h2 className="mt-3 text-xl font-semibold">用户管理</h2>
|
||||
<p className="mt-1 text-sm text-muted-foreground">账号创建、机构加入审批、角色分配和账号列表。</p>
|
||||
<section className="border-b pb-4">
|
||||
<h2 className="text-xl font-semibold">用户管理</h2>
|
||||
</section>
|
||||
|
||||
<UserManagementClient
|
||||
@@ -84,8 +82,6 @@ export default async function UsersPage({ searchParams }: UsersPageProps): Promi
|
||||
</CardHeader>
|
||||
<CardContent className="p-0">
|
||||
<TableToolbar
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/users"
|
||||
query={query}
|
||||
searchPlaceholder="搜索姓名、邮箱、角色、状态"
|
||||
@@ -145,6 +141,13 @@ export default async function UsersPage({ searchParams }: UsersPageProps): Promi
|
||||
</Table.Body>
|
||||
</Table>
|
||||
</div>
|
||||
<TablePagination
|
||||
page={Math.min(page, pageCount)}
|
||||
pageCount={pageCount}
|
||||
pathname="/app/settings/users"
|
||||
query={query}
|
||||
total={filteredAccounts.length}
|
||||
/>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user