sync update from LAN repo (source master @ ca48c4ec)
This commit is contained in:
1 parent
8bc8b0e082
commit
ea9dcff9c0
873 files changed
+107866
-14011
No files matched your search
@@ -9,6 +9,7 @@ import {
|
||||
GitBranch,
|
||||
Globe,
|
||||
Landmark,
|
||||
Layers,
|
||||
LoaderCircle,
|
||||
MessageSquareText,
|
||||
Network,
|
||||
@@ -34,7 +35,7 @@ import {
|
||||
MyProjectThreadIcon,
|
||||
} from "@/components/workspace/my-project-thread-indicator";
|
||||
import { useAgent, useAgents } from "@/core/agents";
|
||||
import { getAccountDisplayName } from "@/core/auth";
|
||||
import { getAccountDisplayName, getStoredAuth } from "@/core/auth";
|
||||
import {
|
||||
type ScheduledTask,
|
||||
useScheduledTaskActions,
|
||||
@@ -73,6 +74,7 @@ import MultiAgentTasksPage from "./official-multi-agent-tasks/MultiAgentTasksPag
|
||||
import TaskEditPage from "./official-multi-agent-tasks/TaskEditPage";
|
||||
import TaskAnalysisPage from "./official-task-analysis/TaskAnalysisPage";
|
||||
import TaskAnalysisDetailPage from "./official-task-analysis/TaskAnalysisDetailPage";
|
||||
import HtmlTemplatesPage from "./HtmlTemplatesPage";
|
||||
|
||||
import "./official-deerflow-entry.css";
|
||||
|
||||
@@ -88,6 +90,7 @@ type OfficialPage =
|
||||
| "multi-agent-edit"
|
||||
| "task-analysis"
|
||||
| "task-analysis-detail"
|
||||
| "html-templates"
|
||||
| "settings";
|
||||
|
||||
function pageFromPath(pathname: string): OfficialPage {
|
||||
@@ -105,6 +108,8 @@ function pageFromPath(pathname: string): OfficialPage {
|
||||
return "multi-agent-edit";
|
||||
}
|
||||
if (path.startsWith("/workspace/multi-agent-tasks")) return "multi-agent-tasks";
|
||||
// 模板管理挂在任务分析系列下,必须先于 detail 的 /:id 正则判断,否则会被当成任务详情页。
|
||||
if (path.startsWith("/workspace/task-analysis/html-templates")) return "html-templates";
|
||||
if (/^\/workspace\/task-analysis\/[^/]+/.test(path)) return "task-analysis-detail";
|
||||
if (path.startsWith("/workspace/task-analysis")) return "task-analysis";
|
||||
if (path.startsWith("/workspace/settings")) return "settings";
|
||||
@@ -807,7 +812,10 @@ export default function OfficialDeerFlowEntry() {
|
||||
{ icon: CalendarClock, label: "定时任务", path: `${OFFICIAL_DEERFLOW_ROUTE_PREFIX}/workspace/scheduled-tasks`, pages: ["scheduled"] },
|
||||
{ icon: Network, label: "多智能体定时任务", path: `${OFFICIAL_DEERFLOW_ROUTE_PREFIX}/workspace/multi-agent-tasks`, pages: ["multi-agent-tasks", "multi-agent-edit"] },
|
||||
{ icon: GitBranch, label: "任务分析定时", path: `${OFFICIAL_DEERFLOW_ROUTE_PREFIX}/workspace/task-analysis`, pages: ["task-analysis", "task-analysis-detail"] },
|
||||
// HTML 模板管理:任务分析系列的子页(/workspace/task-analysis/html-templates),仅管理员可见。
|
||||
{ icon: Layers, label: "模板管理", path: `${OFFICIAL_DEERFLOW_ROUTE_PREFIX}/workspace/task-analysis/html-templates`, pages: ["html-templates"] },
|
||||
] as const;
|
||||
const isAdminUser = getStoredAuth()?.system_role === "admin";
|
||||
|
||||
return (
|
||||
<main className={`official-deerflow${sidebarCollapsed ? " sidebar-collapsed" : ""}`}>
|
||||
@@ -824,7 +832,9 @@ export default function OfficialDeerFlowEntry() {
|
||||
</button>
|
||||
</div>
|
||||
<nav aria-label="官方页面导航" className="official-nav">
|
||||
{nav.map((item) => (
|
||||
{nav
|
||||
.filter((item) => item.label !== "模板管理" || isAdminUser)
|
||||
.map((item) => (
|
||||
<OfficialNavItem
|
||||
active={item.pages.some((candidate) => candidate === page)}
|
||||
icon={item.icon}
|
||||
@@ -998,6 +1008,7 @@ export default function OfficialDeerFlowEntry() {
|
||||
{page === "task-analysis-detail" && (
|
||||
<TaskAnalysisDetailPage routeTaskId={taskAnalysisId} />
|
||||
)}
|
||||
{page === "html-templates" && <HtmlTemplatesPage />}
|
||||
{page === "settings" && <SettingsPage />}
|
||||
</div>
|
||||
<Toaster position="top-center" />
|
||||
|
||||
Reference in new issue
Block a user