refactor: SchedulesPageRoute.tsx, UserManagementPage.tsx, ProjectManagementPage.tsx

This commit is contained in:
tao.chen
2026-08-07 14:40:46 +08:00
parent ec57fb6c7e
commit 984894d797
8 changed files with 1831 additions and 240 deletions
@@ -1,17 +1,13 @@
import { useAuth } from "../../context/AuthContext";
import { useScriptWorkspaceStore } from "../platform/state/scriptWorkspaceStore";
import { useUiStore } from "../platform/state/uiStore";
import SchedulePage from "./SchedulePage";
export default function SchedulesPageRoute() {
const { currentWorkspace, user } = useAuth();
const setApiOnline = useScriptWorkspaceStore((s) => s.setApiOnline);
const pushToast = useUiStore((s) => s.pushToast);
return (
<SchedulePage
// 切换 workspace / 用户时强制重 mount,清空内部 state 并重新拉取
key={`${user?.user_id ?? "anon"}-${currentWorkspace?.workspace_id ?? "none"}`}
onNotify={pushToast}
onConnectionChange={setApiOnline}
/>