mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
fix: chat page team app types (#5927)
Some checks failed
Document deploy / sync-images (push) Has been cancelled
Build FastGPT images in Personal warehouse / get-vars (push) Has been cancelled
Document deploy / generate-timestamp (push) Has been cancelled
Document deploy / build-images (map[domain:https://fastgpt.cn suffix:cn]) (push) Has been cancelled
Document deploy / build-images (map[domain:https://fastgpt.io suffix:io]) (push) Has been cancelled
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.cn kube_config:KUBE_CONFIG_CN suffix:cn]) (push) Has been cancelled
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.io kube_config:KUBE_CONFIG_IO suffix:io]) (push) Has been cancelled
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Has been cancelled
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Has been cancelled
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Has been cancelled
Some checks failed
Document deploy / sync-images (push) Has been cancelled
Build FastGPT images in Personal warehouse / get-vars (push) Has been cancelled
Document deploy / generate-timestamp (push) Has been cancelled
Document deploy / build-images (map[domain:https://fastgpt.cn suffix:cn]) (push) Has been cancelled
Document deploy / build-images (map[domain:https://fastgpt.io suffix:io]) (push) Has been cancelled
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.cn kube_config:KUBE_CONFIG_CN suffix:cn]) (push) Has been cancelled
Document deploy / update-images (map[deployment:fastgpt-docs domain:https://fastgpt.io kube_config:KUBE_CONFIG_IO suffix:io]) (push) Has been cancelled
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Has been cancelled
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Has been cancelled
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Has been cancelled
This commit is contained in:
parent
fea7c51d87
commit
18efdb5421
|
|
@ -8,7 +8,7 @@ import { useTranslation } from 'next-i18next';
|
||||||
import MyBox from '@fastgpt/web/components/common/MyBox';
|
import MyBox from '@fastgpt/web/components/common/MyBox';
|
||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
import { AppListContext } from '@/pageComponents/dashboard/agent/context';
|
import { AppListContext } from '@/pageComponents/dashboard/agent/context';
|
||||||
import { AppTypeEnum } from '@fastgpt/global/core/app/constants';
|
import { AppTypeEnum, ToolTypeList } from '@fastgpt/global/core/app/constants';
|
||||||
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
|
||||||
import AppTypeTag from '@/pageComponents/chat/ChatTeamApp/TypeTag';
|
import AppTypeTag from '@/pageComponents/chat/ChatTeamApp/TypeTag';
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ import UserBox from '@fastgpt/web/components/common/UserBox';
|
||||||
import { ChatSettingContext } from '@/web/core/chat/context/chatSettingContext';
|
import { ChatSettingContext } from '@/web/core/chat/context/chatSettingContext';
|
||||||
import { ChatSidebarPaneEnum } from '@/pageComponents/chat/constants';
|
import { ChatSidebarPaneEnum } from '@/pageComponents/chat/constants';
|
||||||
|
|
||||||
const ListItem = ({ appType }: { appType: AppTypeEnum | 'all' }) => {
|
const List = ({ appType }: { appType: AppTypeEnum | 'all' }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { isPc } = useSystem();
|
const { isPc } = useSystem();
|
||||||
|
|
@ -26,15 +26,11 @@ const ListItem = ({ appType }: { appType: AppTypeEnum | 'all' }) => {
|
||||||
const myApps = useContextSelector(AppListContext, (v) =>
|
const myApps = useContextSelector(AppListContext, (v) =>
|
||||||
v.myApps.filter(
|
v.myApps.filter(
|
||||||
(app) =>
|
(app) =>
|
||||||
appType === app.type ||
|
appType === 'all' ||
|
||||||
app.type === AppTypeEnum.folder ||
|
[
|
||||||
(appType === 'all' &&
|
appType,
|
||||||
[
|
ToolTypeList.includes(appType) ? AppTypeEnum.toolFolder : AppTypeEnum.folder
|
||||||
AppTypeEnum.folder,
|
].includes(app.type)
|
||||||
AppTypeEnum.simple,
|
|
||||||
AppTypeEnum.workflow,
|
|
||||||
AppTypeEnum.workflowTool
|
|
||||||
].includes(app.type))
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const handlePaneChange = useContextSelector(ChatSettingContext, (v) => v.handlePaneChange);
|
const handlePaneChange = useContextSelector(ChatSettingContext, (v) => v.handlePaneChange);
|
||||||
|
|
@ -150,4 +146,4 @@ const ListItem = ({ appType }: { appType: AppTypeEnum | 'all' }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default ListItem;
|
export default List;
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,9 @@ const DashboardContainer = ({
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</Box>
|
</Box>
|
||||||
<TeamPlanStatusCard />
|
<Box px={2.5}>
|
||||||
|
<TeamPlanStatusCard />
|
||||||
|
</Box>
|
||||||
</MyBox>
|
</MyBox>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,27 @@ const AppListContextProvider = ({ children }: { children: ReactNode }) => {
|
||||||
loading: isFetchingApps
|
loading: isFetchingApps
|
||||||
} = useRequest2(
|
} = useRequest2(
|
||||||
() => {
|
() => {
|
||||||
const isAgent = router.pathname.includes('/agent');
|
const formatType = (() => {
|
||||||
const formatType = isAgent
|
// chat page show all apps
|
||||||
? !type || type === 'all'
|
if (router.pathname.includes('/chat')) {
|
||||||
? [AppTypeEnum.folder, AppTypeEnum.simple, AppTypeEnum.workflow]
|
return [
|
||||||
: [AppTypeEnum.folder, type]
|
AppTypeEnum.folder,
|
||||||
: !type || type === 'all'
|
AppTypeEnum.toolFolder,
|
||||||
|
AppTypeEnum.simple,
|
||||||
|
AppTypeEnum.workflow,
|
||||||
|
AppTypeEnum.workflowTool
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// agent page
|
||||||
|
if (router.pathname.includes('/agent')) {
|
||||||
|
return !type || type === 'all'
|
||||||
|
? [AppTypeEnum.folder, AppTypeEnum.simple, AppTypeEnum.workflow]
|
||||||
|
: [AppTypeEnum.folder, type];
|
||||||
|
}
|
||||||
|
|
||||||
|
// tool page
|
||||||
|
return !type || type === 'all'
|
||||||
? [
|
? [
|
||||||
AppTypeEnum.toolFolder,
|
AppTypeEnum.toolFolder,
|
||||||
AppTypeEnum.workflowTool,
|
AppTypeEnum.workflowTool,
|
||||||
|
|
@ -85,6 +100,8 @@ const AppListContextProvider = ({ children }: { children: ReactNode }) => {
|
||||||
AppTypeEnum.httpToolSet
|
AppTypeEnum.httpToolSet
|
||||||
]
|
]
|
||||||
: [AppTypeEnum.toolFolder, type];
|
: [AppTypeEnum.toolFolder, type];
|
||||||
|
})();
|
||||||
|
|
||||||
return getMyApps({ parentId, type: formatType, searchKey });
|
return getMyApps({ parentId, type: formatType, searchKey });
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue