- 新增 /public/scheduled-tasks/:taskId 公开只读访问页与对应的 /api/public/scheduled-tasks 后端路由(无需登录) - 新增对话整体 / 单条消息 / Markdown 工件 "另存为 Word (.docx)" 能力 - 定时任务列表与运行列表在任务执行中自动轮询刷新,并新增"正在执行"标记 - 定时任务运行消息接口在事件存储为空时回退到 LangGraph checkpoint, 让正在执行的任务也能立即看到提示词与流式输出 - 技能详情对话框由折叠面板改为 Tab 切换(Detail / SKILL.md), 并支持 Rendered / Raw 切换、一键复制 - config.yaml 增加 database (MySQL) 与 checkpointer (SQLite) 配置块 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
66 lines
2.3 KiB
TypeScript
66 lines
2.3 KiB
TypeScript
import { useMemo } from "react";
|
|
import { Navigate, Route, Routes } from "react-router-dom";
|
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
|
|
import { QueryClientProvider } from "@/components/query-client-provider";
|
|
import { I18nProvider } from "@/core/i18n/context";
|
|
import { detectLocale } from "@/core/i18n/locale";
|
|
import { ChatProvider } from "@/contexts/ChatContext";
|
|
import { ThemeProvider } from "@/contexts/ThemeContext";
|
|
|
|
import { HashRouter, useLocation } from "react-router-dom";
|
|
|
|
import LandingPage from "./pages/LandingPage";
|
|
import LoginPage from "./pages/LoginPage";
|
|
import PageRoutes from "./pages/PageRoutes";
|
|
import PublicScheduledTaskPage from "./pages/PublicScheduledTaskPage";
|
|
import PublicSharePage from "./pages/PublicSharePage";
|
|
import { NotFoundPage } from "./pages/NotFoundPage";
|
|
|
|
function AppProviders({ children }: { children: React.ReactNode }) {
|
|
const locale = useMemo(() => detectLocale(), []);
|
|
const location = useLocation();
|
|
const forcedTheme = location.pathname === "/landing" ? "dark" : undefined;
|
|
|
|
return (
|
|
<NextThemesProvider
|
|
attribute="class"
|
|
enableSystem
|
|
disableTransitionOnChange
|
|
forcedTheme={forcedTheme}
|
|
>
|
|
<I18nProvider initialLocale={locale}>
|
|
<ThemeProvider>
|
|
<ChatProvider>
|
|
<QueryClientProvider>{children}</QueryClientProvider>
|
|
</ChatProvider>
|
|
</ThemeProvider>
|
|
</I18nProvider>
|
|
</NextThemesProvider>
|
|
);
|
|
}
|
|
|
|
export function App() {
|
|
return (
|
|
<HashRouter>
|
|
<AppProviders>
|
|
<Routes>
|
|
<Route path="/" element={<Navigate to="/login" replace />} />
|
|
<Route path="/login" element={<LoginPage />} />
|
|
<Route path="/login/:username" element={<LoginPage />} />
|
|
<Route path="/landing" element={<LandingPage />} />
|
|
{/* Public read-only conversation viewer — no authentication. */}
|
|
<Route path="/share/:shareCode" element={<PublicSharePage />} />
|
|
{/* Public read-only scheduled-task runs viewer — no authentication. */}
|
|
<Route
|
|
path="/public/scheduled-tasks/:taskId"
|
|
element={<PublicScheduledTaskPage />}
|
|
/>
|
|
<Route path="/page/*" element={<PageRoutes />} />
|
|
<Route path="*" element={<NotFoundPage />} />
|
|
</Routes>
|
|
</AppProviders>
|
|
</HashRouter>
|
|
);
|
|
}
|