@lobehub/lobehub 2.0.0-next.72 → 2.0.0-next.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/desktop-pr-build.yml +7 -3
- package/CHANGELOG.md +50 -0
- package/apps/desktop/package.json +1 -0
- package/apps/desktop/src/main/controllers/LocalFileCtr.ts +55 -11
- package/apps/desktop/src/main/controllers/__tests__/LocalFileCtr.test.ts +153 -0
- package/changelog/v1.json +18 -0
- package/locales/en-US/tool.json +12 -1
- package/locales/zh-CN/tool.json +12 -1
- package/next.config.ts +5 -5
- package/package.json +2 -1
- package/packages/electron-client-ipc/src/types/localSystem.ts +4 -0
- package/scripts/prebuild.mts +16 -6
- package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +6 -6
- package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +7 -4
- package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +4 -4
- package/src/app/[variants]/(main)/(mobile)/me/(home)/features/UserBanner.tsx +5 -6
- package/src/app/[variants]/(main)/(mobile)/me/(home)/features/useCategory.tsx +5 -8
- package/src/app/[variants]/(main)/(mobile)/me/(home)/index.tsx +25 -0
- package/src/app/[variants]/(main)/(mobile)/me/(home)/layout.tsx +13 -16
- package/src/app/[variants]/(main)/(mobile)/me/profile/features/Category.tsx +6 -6
- package/src/app/[variants]/(main)/(mobile)/me/profile/features/Header.tsx +3 -3
- package/src/app/[variants]/(main)/(mobile)/me/profile/index.tsx +16 -0
- package/src/app/[variants]/(main)/(mobile)/me/profile/layout.tsx +9 -11
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/Header.tsx +3 -3
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +3 -4
- package/src/app/[variants]/(main)/(mobile)/me/settings/index.tsx +16 -0
- package/src/app/[variants]/(main)/(mobile)/me/settings/layout.tsx +15 -13
- package/src/app/[variants]/(main)/changelog/_layout/Desktop/index.tsx +6 -5
- package/src/app/[variants]/(main)/changelog/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/changelog/_layout/Mobile/index.tsx +5 -5
- package/src/app/[variants]/(main)/changelog/features/Post.tsx +7 -4
- package/src/app/[variants]/(main)/changelog/index.tsx +55 -0
- package/src/app/[variants]/(main)/chat/_layout/Desktop/index.tsx +6 -7
- package/src/app/[variants]/(main)/chat/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/chat/components/WorkspaceLayout.tsx +1 -14
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatHydration/index.tsx +2 -2
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/MessageFromUrl.tsx +11 -13
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/index.tsx +0 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ThreadHydration.tsx +2 -2
- package/src/app/[variants]/(main)/chat/components/topic/features/Topic/TopicListContent/TopicItem/TopicContent.tsx +20 -11
- package/src/app/[variants]/(main)/chat/features/PageTitle/index.tsx +1 -2
- package/src/app/[variants]/(main)/chat/index.tsx +29 -0
- package/src/app/[variants]/(main)/chat/session/features/SessionHydration.tsx +8 -6
- package/src/app/[variants]/(main)/chat/session/features/SessionListContent/Inbox/index.tsx +2 -4
- package/src/app/[variants]/(main)/chat/session/features/SessionListContent/List/index.tsx +1 -1
- package/src/app/[variants]/(main)/chat/session/layout/Mobile/SessionHeader.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/_layout/Desktop/Header.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/features/PublishResultModal/index.tsx +3 -3
- package/src/app/[variants]/(main)/chat/{components/SettingsPage.tsx → settings/index.tsx} +6 -35
- package/src/app/[variants]/(main)/components/Link.tsx +21 -0
- package/src/app/[variants]/(main)/discover/(detail)/_layout/{Desktop.tsx → Desktop/index.tsx} +15 -7
- package/src/app/[variants]/(main)/discover/(detail)/_layout/Mobile/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Block.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Versions/index.tsx +4 -4
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Header.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/AddAgent.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/TocList/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/StatusPage/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{AssistantDetailPage.tsx → index.tsx} +18 -11
- package/src/app/[variants]/(main)/discover/(detail)/features/Breadcrumb.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Versions/index.tsx +5 -5
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ServerConfig.tsx +4 -4
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/TocList/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{McpDetailPage.tsx → index.tsx} +15 -7
- package/src/app/[variants]/(main)/discover/(detail)/mcp/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/ParameterItem.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Header.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/ChatWithModel.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{ModelDetailPage.tsx → index.tsx} +17 -10
- package/src/app/[variants]/(main)/discover/(detail)/model/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/ProviderConfig.tsx +5 -4
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{ProviderDetailPage.tsx → index.tsx} +17 -10
- package/src/app/[variants]/(main)/discover/(detail)/provider/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(list)/(home)/{HomePage.tsx → index.tsx} +14 -0
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/Nav.tsx +2 -3
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/index.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/Nav.tsx +3 -4
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/index.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Desktop.tsx +3 -4
- package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/Item.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(list)/assistant/{AssistantPage.tsx → index.tsx} +18 -4
- package/src/app/[variants]/(main)/discover/(list)/features/SortButton/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Desktop.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/mcp/{McpPage.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/(list)/model/_layout/Desktop.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/model/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/model/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/model/{ModelPage.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/(list)/provider/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/provider/{Client.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/_layout/Desktop/index.tsx +4 -4
- package/src/app/[variants]/(main)/discover/_layout/Mobile/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/components/Title.tsx +1 -1
- package/src/app/[variants]/(main)/discover/features/Search.tsx +2 -2
- package/src/app/[variants]/(main)/discover/features/useNav.tsx +11 -12
- package/src/app/[variants]/(main)/hooks/useActiveTabKey.ts +40 -0
- package/src/app/[variants]/(main)/hooks/usePathname.ts +10 -0
- package/src/app/[variants]/(main)/hooks/useQuery.ts +12 -0
- package/src/app/[variants]/(main)/hooks/useRouter.ts +22 -0
- package/src/app/[variants]/(main)/hooks/useSearchParams.ts +11 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect/index.tsx +5 -5
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicUrlSync.tsx +1 -1
- package/src/app/[variants]/(main)/image/ComingSoon.tsx +15 -0
- package/src/app/[variants]/(main)/image/_layout/Desktop/index.tsx +5 -2
- package/src/app/[variants]/(main)/image/_layout/DesktopWrapper.tsx +15 -0
- package/src/app/[variants]/(main)/image/_layout/Mobile/index.tsx +3 -1
- package/src/app/[variants]/(main)/image/features/ImageWorkspace/index.tsx +1 -2
- package/src/app/[variants]/(main)/image/index.tsx +18 -0
- package/src/app/[variants]/(main)/knowledge/_layout/Desktop.tsx +17 -0
- package/src/app/[variants]/(main)/knowledge/_layout/Mobile.tsx +17 -0
- package/src/app/[variants]/(main)/knowledge/components/KnowledgeBaseItem/index.tsx +1 -1
- package/src/app/[variants]/(main)/knowledge/components/modal/ModalPageClient.tsx +4 -4
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/index.tsx +5 -8
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/menu/Head.tsx +1 -1
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/CategoryMenu.tsx +2 -2
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/KnowledgeBase.tsx +1 -1
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/DesktopLayoutContainer.tsx +3 -2
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/BottomActions.tsx +4 -4
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/TopActions.test.tsx +9 -9
- package/src/app/[variants]/(main)/layouts/desktop/SideBar/TopActions.tsx +117 -0
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/index.tsx +9 -4
- package/src/app/[variants]/(main)/layouts/index.tsx +11 -0
- package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/NavBar.tsx +5 -5
- package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/index.tsx +10 -7
- package/src/app/[variants]/(main)/profile/(home)/desktop.tsx +26 -0
- package/src/app/[variants]/(main)/profile/(home)/index.tsx +26 -0
- package/src/app/[variants]/(main)/profile/@category/features/CategoryContent.tsx +5 -7
- package/src/app/[variants]/(main)/profile/_layout/Desktop/index.tsx +3 -2
- package/src/app/[variants]/(main)/profile/_layout/DesktopWrapper.tsx +14 -0
- package/src/app/[variants]/(main)/profile/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/profile/_layout/Mobile/index.tsx +4 -3
- package/src/app/[variants]/(main)/profile/apikey/index.tsx +18 -0
- package/src/app/[variants]/(main)/profile/hooks/useCategory.tsx +6 -6
- package/src/app/[variants]/(main)/profile/security/index.tsx +29 -0
- package/src/app/[variants]/(main)/profile/stats/features/AssistantsRank.tsx +4 -4
- package/src/app/[variants]/(main)/profile/stats/features/TopicsRank.tsx +4 -4
- package/src/app/[variants]/(main)/profile/stats/index.tsx +20 -0
- package/src/app/[variants]/(main)/profile/usage/features/UsageTable.tsx +7 -9
- package/src/app/[variants]/(main)/profile/usage/index.tsx +13 -0
- package/src/app/[variants]/(main)/settings/_layout/Desktop/Header.tsx +2 -2
- package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +2 -2
- package/src/app/[variants]/(main)/settings/_layout/DesktopWrapper.tsx +23 -0
- package/src/app/[variants]/(main)/settings/_layout/Mobile/Header.tsx +8 -7
- package/src/app/[variants]/(main)/settings/_layout/Mobile/index.tsx +2 -5
- package/src/app/[variants]/(main)/settings/_layout/MobileWrapper.tsx +23 -0
- package/src/app/[variants]/(main)/settings/agent/AgentMenu/Menu.tsx +2 -4
- package/src/app/[variants]/(main)/settings/agent/index.tsx +2 -4
- package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +2 -3
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/All.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx +38 -37
- package/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx +3 -3
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx +3 -3
- package/src/app/[variants]/DesktopRouter.tsx +40 -0
- package/src/app/[variants]/MobileRouter.tsx +41 -0
- package/src/app/[variants]/desktopRouter.config.tsx +364 -0
- package/src/app/[variants]/layout.tsx +1 -3
- package/src/app/[variants]/loaders/routeParams.ts +45 -0
- package/src/app/[variants]/loading/Server/Redirect.tsx +1 -1
- package/src/app/[variants]/mobileRouter.config.tsx +396 -0
- package/src/app/[variants]/page.tsx +17 -6
- package/src/app/desktop/devtools/page.tsx +1 -1
- package/src/app/desktop/layout.tsx +1 -1
- package/src/components/BootErrorBoundary/index.tsx +129 -0
- package/src/components/mdx/constants.ts +1 -0
- package/src/features/ChangelogModal/index.tsx +3 -3
- package/src/features/Conversation/Messages/Group/Tool/Inspector/index.tsx +23 -4
- package/src/features/KnowledgeManager/FileExplorer/index.tsx +4 -4
- package/src/features/KnowledgeManager/Header/FilesSearchBar.tsx +1 -1
- package/src/features/User/UserPanel/PanelContent.tsx +4 -3
- package/src/features/User/UserPanel/useMenu.tsx +20 -14
- package/src/features/User/__tests__/PanelContent.test.tsx +13 -7
- package/src/hooks/useDiscoverTab.ts +2 -2
- package/src/hooks/useInterceptingRoutes.test.ts +23 -26
- package/src/hooks/useInterceptingRoutes.ts +5 -4
- package/src/hooks/usePinnedAgentState.ts +6 -6
- package/src/hooks/useQuery.ts +5 -0
- package/src/hooks/useQueryParam.ts +322 -0
- package/src/hooks/useQueryRoute.test.ts +2 -12
- package/src/hooks/useQueryRoute.ts +5 -5
- package/src/hooks/useShowMobileWorkspace.ts +1 -1
- package/src/hooks/useSwitchSession.ts +4 -3
- package/src/layout/GlobalProvider/ImportSettings.tsx +22 -9
- package/src/layout/GlobalProvider/StoreInitialization.tsx +9 -1
- package/src/locales/default/tool.ts +11 -0
- package/src/proxy.ts +13 -1
- package/src/services/message/index.ts +11 -2
- package/src/store/chat/agents/createAgentExecutors.ts +31 -16
- package/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts +218 -0
- package/src/store/chat/slices/aiChat/actions/conversationControl.ts +4 -0
- package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +9 -3
- package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +142 -61
- package/src/store/chat/slices/builtinTool/actions/__tests__/localSystem.test.ts +5 -6
- package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +204 -10
- package/src/store/chat/slices/builtinTool/actions/localSystem.ts +45 -182
- package/src/store/chat/slices/builtinTool/actions/search.ts +51 -26
- package/src/store/chat/slices/message/action.test.ts +182 -33
- package/src/store/chat/slices/message/actions/optimisticUpdate.ts +79 -36
- package/src/store/chat/slices/message/actions/query.ts +7 -5
- package/src/store/chat/slices/message/selectors/dbMessage.ts +11 -4
- package/src/store/chat/slices/plugin/action.test.ts +257 -54
- package/src/store/chat/slices/plugin/actions/optimisticUpdate.ts +63 -26
- package/src/store/chat/slices/plugin/actions/pluginTypes.ts +52 -19
- package/src/store/chat/slices/plugin/actions/publicApi.ts +6 -1
- package/src/store/chat/slices/plugin/actions/workflow.ts +17 -6
- package/src/store/chat/slices/thread/action.ts +2 -0
- package/src/store/global/action.test.ts +3 -3
- package/src/store/global/actions/workspacePane.ts +2 -1
- package/src/store/global/initialState.ts +10 -2
- package/src/store/user/slices/common/action.ts +4 -0
- package/src/tools/executionRuntimes.ts +3 -0
- package/src/tools/local-system/ExecutionRuntime/index.ts +407 -0
- package/src/tools/local-system/Intervention/EditLocalFile/index.tsx +89 -0
- package/src/tools/local-system/Intervention/WriteFile/index.tsx +72 -0
- package/src/tools/local-system/Intervention/index.ts +4 -0
- package/src/tools/local-system/Render/EditLocalFile/index.tsx +67 -0
- package/src/tools/local-system/Render/ReadLocalFile/ReadFileView.tsx +53 -78
- package/src/tools/local-system/Render/index.ts +2 -0
- package/src/tools/local-system/index.ts +1 -0
- package/src/tools/local-system/type.ts +4 -3
- package/src/app/[variants]/(main)/(mobile)/me/(home)/loading.tsx +0 -38
- package/src/app/[variants]/(main)/(mobile)/me/(home)/page.tsx +0 -40
- package/src/app/[variants]/(main)/(mobile)/me/profile/loading.tsx +0 -5
- package/src/app/[variants]/(main)/(mobile)/me/profile/page.tsx +0 -30
- package/src/app/[variants]/(main)/(mobile)/me/settings/loading.tsx +0 -5
- package/src/app/[variants]/(main)/(mobile)/me/settings/page.tsx +0 -30
- package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +0 -106
- package/src/app/[variants]/(main)/changelog/layout.tsx +0 -10
- package/src/app/[variants]/(main)/changelog/modal/page.tsx +0 -23
- package/src/app/[variants]/(main)/changelog/page.tsx +0 -78
- package/src/app/[variants]/(main)/chat/ChatRouter.tsx +0 -83
- package/src/app/[variants]/(main)/chat/_layout/ChatLayout.tsx +0 -22
- package/src/app/[variants]/(main)/chat/components/MainChatPage.tsx +0 -25
- package/src/app/[variants]/(main)/chat/error.tsx +0 -3
- package/src/app/[variants]/(main)/chat/layout.tsx +0 -10
- package/src/app/[variants]/(main)/chat/loading.tsx +0 -3
- package/src/app/[variants]/(main)/chat/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/chat/page.tsx +0 -12
- package/src/app/[variants]/(main)/chat/settings/error.tsx +0 -3
- package/src/app/[variants]/(main)/chat/settings/loading.tsx +0 -3
- package/src/app/[variants]/(main)/chat/settings/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/_layout/DetailLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/Client.tsx +0 -51
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/Client.tsx +0 -43
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/Client.tsx +0 -40
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/Client.tsx +0 -40
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(list)/_layout/ListLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/(list)/assistant/AssistantLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/mcp/Client.tsx +0 -44
- package/src/app/[variants]/(main)/discover/(list)/mcp/McpLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/model/Client.tsx +0 -44
- package/src/app/[variants]/(main)/discover/(list)/model/ModelLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/provider/ProviderPage.tsx +0 -43
- package/src/app/[variants]/(main)/discover/DiscoverRouter.tsx +0 -170
- package/src/app/[variants]/(main)/discover/[[...path]]/page.tsx +0 -12
- package/src/app/[variants]/(main)/discover/_layout/DiscoverLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/error.tsx +0 -3
- package/src/app/[variants]/(main)/discover/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/error.tsx +0 -3
- package/src/app/[variants]/(main)/image/layout.tsx +0 -15
- package/src/app/[variants]/(main)/image/page.tsx +0 -45
- package/src/app/[variants]/(main)/knowledge/KnowledgeRouter.tsx +0 -74
- package/src/app/[variants]/(main)/knowledge/[[...path]]/page.tsx +0 -12
- package/src/app/[variants]/(main)/knowledge/components/modal/page.tsx +0 -13
- package/src/app/[variants]/(main)/knowledge/layout.tsx +0 -12
- package/src/app/[variants]/(main)/layout.tsx +0 -10
- package/src/app/[variants]/(main)/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/profile/apikey/page.tsx +0 -32
- package/src/app/[variants]/(main)/profile/error.tsx +0 -3
- package/src/app/[variants]/(main)/profile/layout.tsx +0 -11
- package/src/app/[variants]/(main)/profile/loading.tsx +0 -3
- package/src/app/[variants]/(main)/profile/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/profile/security/page.tsx +0 -28
- package/src/app/[variants]/(main)/profile/stats/page.tsx +0 -23
- package/src/app/[variants]/(main)/profile/usage/page.tsx +0 -23
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Cover.tsx +0 -48
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Hero.tsx +0 -29
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Post.tsx +0 -57
- package/src/app/[variants]/@modal/(.)changelog/modal/features/PublishedTime.tsx +0 -50
- package/src/app/[variants]/@modal/(.)changelog/modal/features/ReadDetail.tsx +0 -72
- package/src/app/[variants]/@modal/(.)changelog/modal/features/VersionTag.tsx +0 -26
- package/src/app/[variants]/@modal/(.)changelog/modal/layout.tsx +0 -41
- package/src/app/[variants]/@modal/(.)changelog/modal/loading.tsx +0 -10
- package/src/app/[variants]/@modal/(.)changelog/modal/page.tsx +0 -38
- package/src/app/[variants]/@modal/_layout/ModalLayout.tsx +0 -63
- package/src/app/[variants]/@modal/_layout/SettingModalLayout.tsx +0 -71
- package/src/app/[variants]/@modal/default.tsx +0 -3
- package/src/app/[variants]/@modal/error.tsx +0 -3
- package/src/app/[variants]/@modal/layout.tsx +0 -7
- package/src/app/[variants]/@modal/loading.tsx +0 -5
- /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/Pagination.tsx +0 -0
- /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/UpdateChangelogStatus.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Knowledge.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/KnowledgeItem.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/PluginItem.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Plugins.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/TagList.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/TagList.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Summary/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/loading.tsx → loading.tsx} +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ActionButton/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ConnectionTypeAlert.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/ProviderList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Guide/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/ModelList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Header.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/labs/{page.tsx → index.tsx} +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/RegisterHotkeys.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.test.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/PinList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/index.tsx +0 -0
|
@@ -9,7 +9,6 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
9
9
|
import { useNavigate } from 'react-router-dom';
|
|
10
10
|
|
|
11
11
|
import Menu from '@/components/Menu';
|
|
12
|
-
import { withSuspense } from '@/components/withSuspense';
|
|
13
12
|
import { DiscoverTab } from '@/types/discover';
|
|
14
13
|
|
|
15
14
|
import { useNav } from '../../../features/useNav';
|
|
@@ -78,9 +77,9 @@ const Nav = memo(() => {
|
|
|
78
77
|
items={items}
|
|
79
78
|
onClick={({ key }) => {
|
|
80
79
|
if (key === DiscoverTab.Home) {
|
|
81
|
-
navigate('/');
|
|
80
|
+
navigate('/discover');
|
|
82
81
|
} else {
|
|
83
|
-
navigate(
|
|
82
|
+
navigate(`/discover/${key}`);
|
|
84
83
|
}
|
|
85
84
|
}}
|
|
86
85
|
selectable
|
|
@@ -91,4 +90,4 @@ const Nav = memo(() => {
|
|
|
91
90
|
);
|
|
92
91
|
});
|
|
93
92
|
|
|
94
|
-
export default
|
|
93
|
+
export default Nav;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
1
|
|
|
3
2
|
import MobileContentLayout from '@/components/server/MobileNavLayout';
|
|
4
3
|
import Footer from '@/features/Setting/Footer';
|
|
5
4
|
|
|
6
5
|
import { SCROLL_PARENT_ID } from '../../../features/const';
|
|
7
6
|
import Header from './Header';
|
|
7
|
+
import { Outlet } from 'react-router-dom';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
const Layout = () => {
|
|
10
11
|
return (
|
|
11
12
|
<MobileContentLayout
|
|
12
13
|
gap={16}
|
|
@@ -15,7 +16,7 @@ const Layout = ({ children }: PropsWithChildren) => {
|
|
|
15
16
|
style={{ paddingInline: 16, paddingTop: 8 }}
|
|
16
17
|
withNav
|
|
17
18
|
>
|
|
18
|
-
|
|
19
|
+
<Outlet />
|
|
19
20
|
<div />
|
|
20
21
|
<Footer />
|
|
21
22
|
</MobileContentLayout>
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
1
|
import { Flexbox } from 'react-layout-kit';
|
|
3
|
-
|
|
2
|
+
import { Outlet } from 'react-router-dom';
|
|
4
3
|
import CategoryContainer from '../../../components/CategoryContainer';
|
|
5
4
|
import Category from '../features/Category';
|
|
6
5
|
|
|
7
|
-
const Layout = (
|
|
6
|
+
const Layout = () => {
|
|
8
7
|
return (
|
|
9
8
|
<Flexbox gap={24} horizontal style={{ position: 'relative' }} width={'100%'}>
|
|
10
9
|
<CategoryContainer>
|
|
11
10
|
<Category />
|
|
12
11
|
</CategoryContainer>
|
|
13
12
|
<Flexbox flex={1} gap={16}>
|
|
14
|
-
|
|
13
|
+
<Outlet />
|
|
15
14
|
</Flexbox>
|
|
16
15
|
</Flexbox>
|
|
17
16
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Outlet } from 'react-router-dom';
|
|
2
2
|
|
|
3
|
-
const Layout = (
|
|
4
|
-
return
|
|
3
|
+
const Layout = () => {
|
|
4
|
+
return <Outlet />;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
Layout.displayName = 'MobileDiscoverAssistantsLayout';
|
|
@@ -64,17 +64,17 @@ const AssistantItem = memo<DiscoverAssistantItem>(
|
|
|
64
64
|
backgroundColor,
|
|
65
65
|
}) => {
|
|
66
66
|
|
|
67
|
-
console.log("author",author)
|
|
68
67
|
const { styles, theme } = useStyles();
|
|
69
68
|
const navigate = useNavigate();
|
|
70
69
|
const { source } = useQuery() as { source?: AssistantMarketSource };
|
|
71
70
|
const link = qs.stringifyUrl(
|
|
72
71
|
{
|
|
73
72
|
query: { source },
|
|
74
|
-
url: urlJoin('/assistant', identifier),
|
|
73
|
+
url: urlJoin('/discover/assistant', identifier),
|
|
75
74
|
},
|
|
76
75
|
{ skipNull: true },
|
|
77
76
|
);
|
|
77
|
+
|
|
78
78
|
const { t } = useTranslation('discover');
|
|
79
79
|
|
|
80
80
|
return (
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import { withSuspense } from '@/components/withSuspense';
|
|
7
6
|
import { useQuery } from '@/hooks/useQuery';
|
|
8
7
|
import { useDiscoverStore } from '@/store/discover';
|
|
9
8
|
import { AssistantQueryParams, DiscoverTab } from '@/types/discover';
|
|
@@ -25,8 +24,6 @@ const AssistantPage = memo<{ mobile?: boolean }>(() => {
|
|
|
25
24
|
source,
|
|
26
25
|
});
|
|
27
26
|
|
|
28
|
-
console.log("data",data)
|
|
29
|
-
|
|
30
27
|
if (isLoading || !data) return <Loading />;
|
|
31
28
|
|
|
32
29
|
const { items, currentPage, pageSize, totalCount } = data;
|
|
@@ -44,4 +41,21 @@ const AssistantPage = memo<{ mobile?: boolean }>(() => {
|
|
|
44
41
|
);
|
|
45
42
|
});
|
|
46
43
|
|
|
47
|
-
|
|
44
|
+
const MobileAssistantPage = memo<{ mobile?: boolean }>(() => {
|
|
45
|
+
return (
|
|
46
|
+
<AssistantPage mobile={true} />
|
|
47
|
+
);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const DesktopAssistantPage = memo<{ mobile?: boolean }>(() => {
|
|
51
|
+
return (
|
|
52
|
+
<AssistantPage mobile={false} />
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
MobileAssistantPage.displayName = 'MobileAssistantPage';
|
|
57
|
+
|
|
58
|
+
DesktopAssistantPage.displayName = 'DesktopAssistantPage';
|
|
59
|
+
|
|
60
|
+
export { DesktopAssistantPage, MobileAssistantPage };
|
|
61
|
+
export default AssistantPage;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Dropdown, DropdownMenuItemType, Icon } from '@lobehub/ui';
|
|
2
2
|
import { Button } from 'antd';
|
|
3
3
|
import { ArrowDownWideNarrow, ChevronDown } from 'lucide-react';
|
|
4
|
-
import { usePathname } from 'next/navigation';
|
|
5
4
|
import { memo, useMemo } from 'react';
|
|
6
5
|
import { useTranslation } from 'react-i18next';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { usePathname } from '@/app/[variants]/(main)/hooks/usePathname';
|
|
8
|
+
import { useQuery } from '@/app/[variants]/(main)/hooks/useQuery';
|
|
9
9
|
import { useQueryRoute } from '@/hooks/useQueryRoute';
|
|
10
10
|
import { useMarketAuth } from '@/layout/AuthProvider/MarketAuth';
|
|
11
11
|
import {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
1
|
import { Flexbox } from 'react-layout-kit';
|
|
3
2
|
|
|
4
3
|
import CategoryContainer from '../../../components/CategoryContainer';
|
|
5
4
|
import Category from '../features/Category';
|
|
5
|
+
import { Outlet } from 'react-router-dom';
|
|
6
6
|
|
|
7
|
-
const Layout = (
|
|
7
|
+
const Layout = () => {
|
|
8
8
|
return (
|
|
9
9
|
<Flexbox gap={24} horizontal style={{ position: 'relative' }} width={'100%'}>
|
|
10
10
|
<CategoryContainer>
|
|
11
11
|
<Category />
|
|
12
12
|
</CategoryContainer>
|
|
13
13
|
<Flexbox flex={1} gap={16}>
|
|
14
|
-
|
|
14
|
+
<Outlet />
|
|
15
15
|
</Flexbox>
|
|
16
16
|
</Flexbox>
|
|
17
17
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Outlet } from 'react-router-dom';
|
|
2
2
|
|
|
3
|
-
const Layout = (
|
|
4
|
-
return
|
|
3
|
+
const Layout = () => {
|
|
4
|
+
return <Outlet />;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
Layout.displayName = 'MobileDiscoverToolsLayout';
|
|
@@ -78,7 +78,7 @@ const McpItem = memo<DiscoverMcpItem>(
|
|
|
78
78
|
const { t } = useTranslation('discover');
|
|
79
79
|
const { styles, theme } = useStyles();
|
|
80
80
|
const navigate = useNavigate();
|
|
81
|
-
const link = urlJoin('/mcp', identifier);
|
|
81
|
+
const link = urlJoin('/discover/mcp', identifier);
|
|
82
82
|
return (
|
|
83
83
|
<Block
|
|
84
84
|
clickable
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import { withSuspense } from '@/components/withSuspense';
|
|
7
6
|
import { useQuery } from '@/hooks/useQuery';
|
|
8
7
|
import { useDiscoverStore } from '@/store/discover';
|
|
9
8
|
import { DiscoverTab, McpQueryParams } from '@/types/discover';
|
|
@@ -41,4 +40,12 @@ const McpPage = memo<{ mobile?: boolean }>(() => {
|
|
|
41
40
|
);
|
|
42
41
|
});
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
const DesktopMcpPage = memo<{ mobile?: boolean }>(() => {
|
|
44
|
+
return <McpPage mobile={false} />;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const MobileMcpPage = memo<{ mobile?: boolean }>(() => {
|
|
48
|
+
return <McpPage mobile={true} />;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export { DesktopMcpPage, MobileMcpPage };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
1
|
import { Flexbox } from 'react-layout-kit';
|
|
2
|
+
import { Outlet } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
import CategoryContainer from '../../../components/CategoryContainer';
|
|
5
5
|
import Category from '../features/Category';
|
|
6
6
|
|
|
7
|
-
const Layout = (
|
|
7
|
+
const Layout = () => {
|
|
8
8
|
return (
|
|
9
9
|
<Flexbox gap={24} horizontal style={{ position: 'relative' }} width={'100%'}>
|
|
10
10
|
<CategoryContainer>
|
|
11
11
|
<Category />
|
|
12
12
|
</CategoryContainer>
|
|
13
13
|
<Flexbox flex={1} gap={16}>
|
|
14
|
-
{
|
|
14
|
+
{<Outlet />}
|
|
15
15
|
</Flexbox>
|
|
16
16
|
</Flexbox>
|
|
17
17
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Outlet } from 'react-router-dom';
|
|
2
2
|
|
|
3
|
-
const Layout = (
|
|
4
|
-
return
|
|
3
|
+
const Layout = () => {
|
|
4
|
+
return <Outlet />;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
Layout.displayName = 'MobileDiscoverModelsLayout';
|
|
@@ -57,7 +57,7 @@ const ModelItem = memo<DiscoverModelItem>(
|
|
|
57
57
|
const { t } = useTranslation(['models', 'discover']);
|
|
58
58
|
const { styles } = useStyles();
|
|
59
59
|
const navigate = useNavigate();
|
|
60
|
-
const link = urlJoin('/model', identifier);
|
|
60
|
+
const link = urlJoin('/discover/model', identifier);
|
|
61
61
|
return (
|
|
62
62
|
<Block
|
|
63
63
|
clickable
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import { withSuspense } from '@/components/withSuspense';
|
|
7
6
|
import { useQuery } from '@/hooks/useQuery';
|
|
8
7
|
import { useDiscoverStore } from '@/store/discover';
|
|
9
8
|
import { DiscoverTab, ModelQueryParams } from '@/types/discover';
|
|
@@ -41,4 +40,12 @@ const ModelPage = memo<{ mobile?: boolean }>(() => {
|
|
|
41
40
|
);
|
|
42
41
|
});
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
const DesktopModelPage = memo<{ mobile?: boolean }>(() => {
|
|
44
|
+
return <ModelPage mobile={false} />;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const MobileModelPage = memo<{ mobile?: boolean }>(() => {
|
|
48
|
+
return <ModelPage mobile={true} />;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export { DesktopModelPage, MobileModelPage };
|
|
@@ -48,7 +48,7 @@ const ProviderItem = memo<DiscoverProviderItem>(
|
|
|
48
48
|
({ url, name, description, identifier, models }) => {
|
|
49
49
|
const { styles, theme } = useStyles();
|
|
50
50
|
const navigate = useNavigate();
|
|
51
|
-
const link = urlJoin('/provider', identifier);
|
|
51
|
+
const link = urlJoin('/discover/provider', identifier);
|
|
52
52
|
const { t } = useTranslation(['discover', 'providers']);
|
|
53
53
|
|
|
54
54
|
return (
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import { Flexbox } from 'react-layout-kit';
|
|
5
5
|
|
|
6
|
-
import { withSuspense } from '@/components/withSuspense';
|
|
7
6
|
import { useQuery } from '@/hooks/useQuery';
|
|
8
7
|
import { useDiscoverStore } from '@/store/discover';
|
|
9
8
|
import { DiscoverTab, ProviderQueryParams } from '@/types/discover';
|
|
@@ -40,4 +39,12 @@ const Client = memo<{ mobile?: boolean }>(() => {
|
|
|
40
39
|
);
|
|
41
40
|
});
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
const DesktopProviderPage = memo<{ mobile?: boolean }>(() => {
|
|
43
|
+
return <Client mobile={false} />;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const MobileProviderPage = memo<{ mobile?: boolean }>(() => {
|
|
47
|
+
return <Client mobile={true} />;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export { DesktopProviderPage, MobileProviderPage };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
1
|
|
|
3
2
|
import NProgress from '@/components/NProgress';
|
|
4
3
|
|
|
5
4
|
import Container from './Container';
|
|
6
|
-
import Header from './Header';
|
|
5
|
+
import Header from './Header';
|
|
6
|
+
import { Outlet } from 'react-router-dom';
|
|
7
7
|
|
|
8
|
-
const Layout = (
|
|
8
|
+
const Layout = () => {
|
|
9
9
|
return (
|
|
10
10
|
<>
|
|
11
11
|
<NProgress />
|
|
12
12
|
<Container>
|
|
13
13
|
<Header />
|
|
14
|
-
|
|
14
|
+
<Outlet />
|
|
15
15
|
</Container>
|
|
16
16
|
{/* ↓ cloud slot ↓ */}
|
|
17
17
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
1
|
|
|
3
2
|
import NProgress from '@/components/NProgress';
|
|
3
|
+
import { Outlet } from 'react-router-dom';
|
|
4
4
|
|
|
5
|
-
const Layout = (
|
|
5
|
+
const Layout = () => {
|
|
6
6
|
return (
|
|
7
7
|
<>
|
|
8
8
|
<NProgress />
|
|
9
|
-
|
|
9
|
+
<Outlet />
|
|
10
10
|
</>
|
|
11
11
|
);
|
|
12
12
|
};
|
|
@@ -59,7 +59,7 @@ const Title = memo<TitleProps>(({ tag, children, moreLink, more }) => {
|
|
|
59
59
|
title
|
|
60
60
|
)}
|
|
61
61
|
{moreLink && (
|
|
62
|
-
<Link target={moreLink.startsWith('http') ? '_blank' : undefined} to={moreLink}>
|
|
62
|
+
<Link target={moreLink.startsWith('http') ? '_blank' : undefined} to={`/discover${moreLink}`}>
|
|
63
63
|
<Button className={styles.more} style={{ paddingInline: 6 }} type={'text'}>
|
|
64
64
|
<span>{more}</span>
|
|
65
65
|
<Icon icon={ChevronRight} />
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { SearchBar, SearchBarProps } from '@lobehub/ui';
|
|
4
4
|
import { createStyles } from 'antd-style';
|
|
5
|
-
import { usePathname } from 'next/navigation';
|
|
6
5
|
import { memo, useState } from 'react';
|
|
7
6
|
import { useTranslation } from 'react-i18next';
|
|
8
7
|
import urlJoin from 'url-join';
|
|
9
8
|
|
|
9
|
+
import { usePathname } from '@/app/[variants]/(main)/hooks/usePathname';
|
|
10
|
+
import { useQuery } from '@/app/[variants]/(main)/hooks/useQuery';
|
|
10
11
|
import { withSuspense } from '@/components/withSuspense';
|
|
11
|
-
import { useQuery } from '@/hooks/useQuery';
|
|
12
12
|
import { useQueryRoute } from '@/hooks/useQueryRoute';
|
|
13
13
|
|
|
14
14
|
export const useStyles = createStyles(({ css, prefixCls, token }) => ({
|
|
@@ -3,7 +3,7 @@ import { Icon } from '@lobehub/ui';
|
|
|
3
3
|
import { Bot, Brain, BrainCircuit, House } from 'lucide-react';
|
|
4
4
|
import { ReactNode, useMemo } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import {
|
|
6
|
+
import { useLocation } from 'react-router-dom';
|
|
7
7
|
|
|
8
8
|
import type { MenuProps } from '@/components/Menu';
|
|
9
9
|
import { DiscoverTab } from '@/types/discover';
|
|
@@ -13,7 +13,6 @@ const ICON_SIZE = 16;
|
|
|
13
13
|
export const useNav = () => {
|
|
14
14
|
const location = useLocation();
|
|
15
15
|
const { t } = useTranslation('discover');
|
|
16
|
-
|
|
17
16
|
const activeKey = useMemo(() => {
|
|
18
17
|
const pathname = location.pathname;
|
|
19
18
|
for (const value of Object.values(DiscoverTab)) {
|
|
@@ -32,45 +31,45 @@ export const useNav = () => {
|
|
|
32
31
|
icon: <Icon icon={House} size={ICON_SIZE} />,
|
|
33
32
|
key: DiscoverTab.Home,
|
|
34
33
|
label: (
|
|
35
|
-
<
|
|
34
|
+
<div style={{ color: 'inherit', display: 'inline' }}>
|
|
36
35
|
{t('tab.home')}
|
|
37
|
-
</
|
|
36
|
+
</div>
|
|
38
37
|
),
|
|
39
38
|
},
|
|
40
39
|
{
|
|
41
40
|
icon: <Icon icon={Bot} size={ICON_SIZE} />,
|
|
42
41
|
key: DiscoverTab.Assistants,
|
|
43
42
|
label: (
|
|
44
|
-
<
|
|
43
|
+
<div style={{ color: 'inherit', display: 'inline' }} >
|
|
45
44
|
{t('tab.assistant')}
|
|
46
|
-
</
|
|
45
|
+
</div>
|
|
47
46
|
),
|
|
48
47
|
},
|
|
49
48
|
{
|
|
50
49
|
icon: <MCP className={'anticon'} size={ICON_SIZE} />,
|
|
51
50
|
key: DiscoverTab.Mcp,
|
|
52
51
|
label: (
|
|
53
|
-
<
|
|
52
|
+
<div style={{ color: 'inherit', display: 'inline' }} >
|
|
54
53
|
{`MCP ${t('tab.plugin')}`}
|
|
55
|
-
</
|
|
54
|
+
</div>
|
|
56
55
|
),
|
|
57
56
|
},
|
|
58
57
|
{
|
|
59
58
|
icon: <Icon icon={Brain} size={ICON_SIZE} />,
|
|
60
59
|
key: DiscoverTab.Models,
|
|
61
60
|
label: (
|
|
62
|
-
<
|
|
61
|
+
<div style={{ color: 'inherit', display: 'inline' }} >
|
|
63
62
|
{t('tab.model')}
|
|
64
|
-
</
|
|
63
|
+
</div>
|
|
65
64
|
),
|
|
66
65
|
},
|
|
67
66
|
{
|
|
68
67
|
icon: <Icon icon={BrainCircuit} size={ICON_SIZE} />,
|
|
69
68
|
key: DiscoverTab.Providers,
|
|
70
69
|
label: (
|
|
71
|
-
<
|
|
70
|
+
<div style={{ color: 'inherit', display: 'inline' }} >
|
|
72
71
|
{t('tab.provider')}
|
|
73
|
-
</
|
|
72
|
+
</div>
|
|
74
73
|
),
|
|
75
74
|
},
|
|
76
75
|
],
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useLocation, useSearchParams } from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
import { ProfileTabs, SettingsTabs, SidebarTabKey } from '@/store/global/initialState';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the active tab key (chat/discover/settings/...)
|
|
7
|
+
* React Router version for (main) directory
|
|
8
|
+
*/
|
|
9
|
+
export const useActiveTabKey = () => {
|
|
10
|
+
const location = useLocation();
|
|
11
|
+
const pathname = location.pathname;
|
|
12
|
+
|
|
13
|
+
return pathname.split('/').find(Boolean) as SidebarTabKey;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns the active setting page key (?active=common/sync/agent/...)
|
|
18
|
+
* React Router version for (main) directory
|
|
19
|
+
*/
|
|
20
|
+
export const useActiveSettingsKey = () => {
|
|
21
|
+
const [searchParams] = useSearchParams();
|
|
22
|
+
const tabs = searchParams.get('active');
|
|
23
|
+
if (!tabs) return SettingsTabs.Common;
|
|
24
|
+
return tabs as SettingsTabs;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Returns the active profile page key (profile/security/stats/...)
|
|
29
|
+
* React Router version for (main) directory
|
|
30
|
+
*/
|
|
31
|
+
export const useActiveProfileKey = () => {
|
|
32
|
+
const location = useLocation();
|
|
33
|
+
const pathname = location.pathname;
|
|
34
|
+
|
|
35
|
+
const tabs = pathname.split('/').findLast(Boolean);
|
|
36
|
+
|
|
37
|
+
if (tabs === 'profile') return ProfileTabs.Profile;
|
|
38
|
+
|
|
39
|
+
return tabs as ProfileTabs;
|
|
40
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import qs from 'query-string';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { useSearchParams } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hook to get query parameters
|
|
7
|
+
* React Router version for (main) directory
|
|
8
|
+
*/
|
|
9
|
+
export const useQuery = () => {
|
|
10
|
+
const [searchParams] = useSearchParams();
|
|
11
|
+
return useMemo(() => qs.parse(searchParams.toString()), [searchParams]);
|
|
12
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useNavigate } from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook to get router navigation functions
|
|
5
|
+
* React Router version for (main) directory
|
|
6
|
+
*
|
|
7
|
+
* Provides a Next.js-like API using React Router
|
|
8
|
+
*/
|
|
9
|
+
export const useRouter = () => {
|
|
10
|
+
const navigate = useNavigate();
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
back: () => navigate(-1),
|
|
14
|
+
forward: () => navigate(1),
|
|
15
|
+
// Note: prefetch is not supported in React Router
|
|
16
|
+
prefetch: () => {},
|
|
17
|
+
|
|
18
|
+
push: (href: string) => navigate(href),
|
|
19
|
+
|
|
20
|
+
replace: (href: string) => navigate(href, { replace: true }),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useSearchParams as useReactRouterSearchParams } from 'react-router-dom';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook to get search params
|
|
5
|
+
* React Router version for (main) directory
|
|
6
|
+
*
|
|
7
|
+
* Returns [searchParams, setSearchParams] tuple similar to React Router
|
|
8
|
+
*/
|
|
9
|
+
export const useSearchParams = () => {
|
|
10
|
+
return useReactRouterSearchParams();
|
|
11
|
+
};
|
package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect/index.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import { ActionIcon, Icon, Select, type SelectProps } from '@lobehub/ui';
|
|
|
3
3
|
import { createStyles, useTheme } from 'antd-style';
|
|
4
4
|
import { LucideArrowRight, LucideBolt } from 'lucide-react';
|
|
5
5
|
import Link from 'next/link';
|
|
6
|
-
import { useRouter } from 'next/navigation';
|
|
7
6
|
import { memo, useMemo } from 'react';
|
|
8
7
|
import { useTranslation } from 'react-i18next';
|
|
9
8
|
import { Flexbox } from 'react-layout-kit';
|
|
9
|
+
import { useNavigate } from 'react-router-dom';
|
|
10
10
|
|
|
11
11
|
import { ProviderItemRender } from '@/components/ModelSelect';
|
|
12
12
|
import { useAiInfraStore } from '@/store/aiInfra';
|
|
@@ -34,7 +34,7 @@ const ModelSelect = memo(() => {
|
|
|
34
34
|
const { styles } = useStyles();
|
|
35
35
|
const { t } = useTranslation('components');
|
|
36
36
|
const theme = useTheme();
|
|
37
|
-
const
|
|
37
|
+
const navigate = useNavigate();
|
|
38
38
|
|
|
39
39
|
const [currentModel, currentProvider] = useImageStore((s) => [
|
|
40
40
|
imageGenerationConfigSelectors.model(s),
|
|
@@ -64,7 +64,7 @@ const ModelSelect = memo(() => {
|
|
|
64
64
|
</Flexbox>
|
|
65
65
|
),
|
|
66
66
|
onClick: () => {
|
|
67
|
-
|
|
67
|
+
navigate(`/settings?active=provider&provider=${provider.id}`);
|
|
68
68
|
},
|
|
69
69
|
value: `${provider.id}/empty`,
|
|
70
70
|
},
|
|
@@ -86,7 +86,7 @@ const ModelSelect = memo(() => {
|
|
|
86
86
|
</Flexbox>
|
|
87
87
|
),
|
|
88
88
|
onClick: () => {
|
|
89
|
-
|
|
89
|
+
navigate('/settings?active=provider');
|
|
90
90
|
},
|
|
91
91
|
value: 'no-provider',
|
|
92
92
|
},
|
|
@@ -118,7 +118,7 @@ const ModelSelect = memo(() => {
|
|
|
118
118
|
),
|
|
119
119
|
options: getImageModels(provider),
|
|
120
120
|
}));
|
|
121
|
-
}, [enabledImageModelList, t, theme.colorTextTertiary,
|
|
121
|
+
}, [enabledImageModelList, t, theme.colorTextTertiary, navigate]);
|
|
122
122
|
|
|
123
123
|
const labelRender: SelectProps['labelRender'] = (props) => {
|
|
124
124
|
const modelInfo = enabledImageModelList
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useQueryState } from 'nuqs';
|
|
4
3
|
import { useLayoutEffect } from 'react';
|
|
5
4
|
import { createStoreUpdater } from 'zustand-utils';
|
|
6
5
|
|
|
6
|
+
import { useQueryState } from '@/hooks/useQueryParam';
|
|
7
7
|
import { useImageStore } from '@/store/image';
|
|
8
8
|
|
|
9
9
|
/**
|