diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx index 998184c0ee..314b481699 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx @@ -6,11 +6,9 @@ export type IProps = { params: { appId: string } } -const Logs = async ({ - params: { appId }, -}: IProps) => { +const Logs = async () => { return ( -
+
) } diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx index 86996969d2..c47581df87 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx @@ -80,10 +80,10 @@ const AppDetailLayout: FC = (props) => { const localeMode = localStorage.getItem('app-detail-collapse-or-expand') || 'expand' const mode = isMobile ? 'collapse' : 'expand' setAppSiderbarExpand(isMobile ? mode : localeMode) - if (appDetail.mode === 'advanced-chat' || appDetail.mode === 'workflow') + if ((appDetail.mode === 'advanced-chat' || appDetail.mode === 'workflow') && (pathname).endsWith('workflow')) setAppSiderbarExpand('collapse') } - }, [appDetail, isMobile, setAppSiderbarExpand]) + }, [appDetail, isMobile]) useEffect(() => { setAppDetail() @@ -100,7 +100,7 @@ const AppDetailLayout: FC = (props) => { setNavigation(getNavigations(appId, isCurrentWorkspaceManager, res.mode)) } }) - }, [appId, getNavigations, isCurrentWorkspaceManager, pathname, router, setAppDetail]) + }, [appId, isCurrentWorkspaceManager]) if (!appDetail) { return ( diff --git a/web/app/components/develop/index.tsx b/web/app/components/develop/index.tsx index 5034a1db7d..9b9fec8fd5 100644 --- a/web/app/components/develop/index.tsx +++ b/web/app/components/develop/index.tsx @@ -1,35 +1,42 @@ 'use client' import { useTranslation } from 'react-i18next' -import useSWR from 'swr' import s from './secret-key/style.module.css' import Doc from '@/app/components/develop/doc' +import Loading from '@/app/components/base/loading' import InputCopy from '@/app/components/develop/secret-key/input-copy' import SecretKeyButton from '@/app/components/develop/secret-key/secret-key-button' -import { fetchAppDetail } from '@/service/apps' +import { useStore as useAppStore } from '@/app/components/app/store' type IDevelopMainProps = { appId: string } const DevelopMain = ({ appId }: IDevelopMainProps) => { - const commonParams = { url: '/apps', id: appId } - const { data: appDetail } = useSWR(commonParams, fetchAppDetail) + const { appDetail } = useAppStore() const { t } = useTranslation() + if (!appDetail) { + return ( +
+ +
+ ) + } + return (
- +
{t('appApi.apiServer')}
+ text-[13px] font-normal mr-2 ${appDetail.enable_api ? 'text-green-500 bg-green-50' : 'text-yellow-500 bg-yellow-50'}`}>
{t('appApi.status')}
-
{appDetail?.enable_api ? `${t('appApi.ok')}` : `${t('appApi.disabled')}`}
+
{appDetail.enable_api ? `${t('appApi.ok')}` : `${t('appApi.disabled')}`}