feat: 完成模板目录导入与生命周期管理

This commit is contained in:
que01 committed 2026-10-16 16:34:24 +08:00
1 parent 553a07c4ec
commit 413413efda
25 files changed
+1313 -24

No files matched your search

+16 -1
View File
@@ -21,6 +21,7 @@ import {
FeatureMembersPage,
FeatureOverviewPage,
FeaturePublicationPage,
FeatureTemplateManagementPage,
FeatureServicesPage,
FeatureTrustContentPage,
FeatureWorkspacePage,
@@ -35,7 +36,15 @@ import { Route, Routes } from "react-router-dom";
import { AdminOverviewRedirect } from "./AdminRouter.js";
import { Suspense } from "react";
export function Dashboard({ onLogout, role }: { onLogout: () => void; role: string }) {
export function Dashboard({
onLogout,
role,
platformTemplateRole,
}: {
onLogout: () => void;
role: string;
platformTemplateRole: string;
}) {
const navigate = useNavigate();
const location = useLocation();
const brand = useQuery({
@@ -79,6 +88,9 @@ export function Dashboard({ onLogout, role }: { onLogout: () => void; role: stri
children: [
{ key: "capabilities", label: "能力插件", icon: <ThunderboltOutlined /> },
{ key: "members", label: "团队成员", icon: <TeamOutlined /> },
...(platformTemplateRole === "template_admin"
? [{ key: "templates", label: "模板管理", icon: <AppstoreOutlined /> }]
: []),
],
},
]),
@@ -143,6 +155,9 @@ export function Dashboard({ onLogout, role }: { onLogout: () => void; role: stri
<>
<Route path="capabilities" element={<FeatureCapabilitiesPage />} />
<Route path="members" element={<FeatureMembersPage />} />
{platformTemplateRole === "template_admin" ? (
<Route path="templates" element={<FeatureTemplateManagementPage />} />
) : null}
</>
)}
<Route path="*" element={<AdminOverviewRedirect />} />