feat: role CRUD page

This commit is contained in:
tao.chen
2026-09-02 10:10:41 +08:00
committed by tao.chen
parent a65baea4d7
commit fbd4da5224
12 changed files with 891 additions and 6 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ import { Outlet, useLocation, useNavigate } from "react-router";
import { PanelLeft, ChevronRight } from "lucide-react";
import { navigation } from "./platform.navigation";
import type { ActivePage, NavigationItem } from "./platform.navigation";
import type { ActivePage, NavigationItem, SubPage } from "./platform.navigation";
import { Collapsible } from "@base-ui/react/collapsible";
import type { Route } from "./+types/platform";
@@ -70,7 +70,7 @@ function NavRow({
can: (code: string) => boolean;
activePage: ActivePage;
pathname: string;
onNavigate: (sub?: "users" | "projects") => void;
onNavigate: (sub?: SubPage) => void;
}) {
const itemIcon = <item.icon />;
const childActivePath = (child: NavigationItem) =>
@@ -208,7 +208,7 @@ function AuthenticatedLayout() {
// 原 common/Sidebar 的编辑会话守卫上移到这里:切出 /scripts 时有活动编辑
// 会话先 endEditing,回工作台时清空选中脚本;再按当前激活页导航。
function guardedNavigate(page: ActivePage, sub?: "users" | "projects") {
function guardedNavigate(page: ActivePage, sub?: SubPage) {
if (page !== "scripts" && editSessionHandle.current) {
void endEditing(true);
} else if (page === "home") {