diff --git a/web/app/(commonLayout)/apps/AppCard.tsx b/web/app/(commonLayout)/apps/AppCard.tsx index ff8165fc82..3f8c180c1a 100644 --- a/web/app/(commonLayout)/apps/AppCard.tsx +++ b/web/app/(commonLayout)/apps/AppCard.tsx @@ -16,6 +16,7 @@ import AppsContext, { useAppContext } from '@/context/app-context' import type { HtmlContentProps } from '@/app/components/base/popover' import CustomPopover from '@/app/components/base/popover' import Divider from '@/app/components/base/divider' +import { basePath } from '@/utils/var' import { getRedirection } from '@/utils/app-redirection' import { useProviderContext } from '@/context/provider-context' import { NEED_REFRESH_APP_LIST_KEY } from '@/config' @@ -216,7 +217,7 @@ const AppCard = ({ app, onRefresh }: AppCardProps) => { try { const { installed_apps }: any = await fetchInstalledAppList(app.id) || {} if (installed_apps?.length > 0) - window.open(`/explore/installed/${installed_apps[0].id}`, '_blank') + window.open(`${basePath}/explore/installed/${installed_apps[0].id}`, '_blank') else throw new Error('No app found in Explore') } diff --git a/web/app/(commonLayout)/datasets/NewDatasetCard.tsx b/web/app/(commonLayout)/datasets/NewDatasetCard.tsx index ed3b93f3a4..792d9904da 100644 --- a/web/app/(commonLayout)/datasets/NewDatasetCard.tsx +++ b/web/app/(commonLayout)/datasets/NewDatasetCard.tsx @@ -1,5 +1,6 @@ 'use client' import { useTranslation } from 'react-i18next' +import { basePath } from '@/utils/var' import { RiAddLine, RiArrowRightLine, @@ -17,7 +18,7 @@ const CreateAppCard = (
- +
{t('dataset.createDatasetIntro')}
- +
{t('dataset.connectDataset')}
diff --git a/web/app/components/app/app-publisher/index.tsx b/web/app/components/app/app-publisher/index.tsx index 1dc6eaf117..360741ab2e 100644 --- a/web/app/components/app/app-publisher/index.tsx +++ b/web/app/components/app/app-publisher/index.tsx @@ -24,6 +24,7 @@ import { PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' +import { basePath } from '@/utils/var' import { fetchInstalledAppList } from '@/service/explore' import EmbeddedModal from '@/app/components/app/overview/embedded' import { useStore as useAppStore } from '@/app/components/app/store' @@ -75,7 +76,7 @@ const AppPublisher = ({ const appDetail = useAppStore(state => state.appDetail) const { app_base_url: appBaseURL = '', access_token: accessToken = '' } = appDetail?.site ?? {} const appMode = (appDetail?.mode !== 'completion' && appDetail?.mode !== 'workflow') ? 'chat' : appDetail.mode - const appURL = `${appBaseURL}/${appMode}/${accessToken}` + const appURL = `${appBaseURL}/${basePath}/${appMode}/${accessToken}` const isChatApp = ['chat', 'agent-chat', 'completion'].includes(appDetail?.mode || '') const language = useGetLanguage() @@ -120,7 +121,7 @@ const AppPublisher = ({ try { const { installed_apps }: any = await fetchInstalledAppList(appDetail?.id) || {} if (installed_apps?.length > 0) - window.open(`/explore/installed/${installed_apps[0].id}`, '_blank') + window.open(`${basePath}/explore/installed/${installed_apps[0].id}`, '_blank') else throw new Error('No app found in Explore') } diff --git a/web/app/components/app/configuration/index.tsx b/web/app/components/app/configuration/index.tsx index b7b80ea080..5b8f8659f8 100644 --- a/web/app/components/app/configuration/index.tsx +++ b/web/app/components/app/configuration/index.tsx @@ -2,6 +2,7 @@ import type { FC } from 'react' import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' import useSWR from 'swr' +import { basePath } from '@/utils/var' import { useTranslation } from 'react-i18next' import { useContext } from 'use-context-selector' import { usePathname } from 'next/navigation' @@ -503,6 +504,12 @@ const Configuration: FC = () => { useEffect(() => { (async () => { const collectionList = await fetchCollectionList() + if (basePath) { + collectionList.forEach((item) => { + if (typeof item.icon == 'string' && !item.icon.includes(basePath)) + item.icon = `${basePath}${item.icon}` + }) + } setCollectionList(collectionList) fetchAppDetail({ url: '/apps', id: appId }).then(async (res: any) => { setMode(res.mode) diff --git a/web/app/components/app/create-app-modal/index.tsx b/web/app/components/app/create-app-modal/index.tsx index a8a7f0db2a..88bccc95af 100644 --- a/web/app/components/app/create-app-modal/index.tsx +++ b/web/app/components/app/create-app-modal/index.tsx @@ -14,6 +14,7 @@ import type { AppIconSelection } from '../../base/app-icon-picker' import Button from '@/app/components/base/button' import Divider from '@/app/components/base/divider' import cn from '@/utils/classnames' +import { basePath } from '@/utils/var' import AppsContext, { useAppContext } from '@/context/app-context' import { useProviderContext } from '@/context/provider-context' import { ToastContext } from '@/app/components/base/toast' @@ -352,11 +353,11 @@ function AppScreenShot({ mode, show }: { mode: AppMode; show: boolean }) { 'workflow': 'Workflow', } return - - - + + + App Screen Shot diff --git a/web/app/components/app/log/index.tsx b/web/app/components/app/log/index.tsx index 8e523b7cf8..13be294bef 100644 --- a/web/app/components/app/log/index.tsx +++ b/web/app/components/app/log/index.tsx @@ -7,6 +7,7 @@ import { usePathname } from 'next/navigation' import { useDebounce } from 'ahooks' import { omit } from 'lodash-es' import dayjs from 'dayjs' +import { basePath } from '@/utils/var' import { Trans, useTranslation } from 'react-i18next' import List from './list' import Filter, { TIME_PERIOD_MAPPING } from './filter' @@ -109,7 +110,7 @@ const Logs: FC = ({ appDetail }) => { ? : total > 0 ? - : + : } {/* Show Pagination only if the total is more than the limit */} {(total && total > APP_PAGE_LIMIT) diff --git a/web/app/components/app/overview/appCard.tsx b/web/app/components/app/overview/appCard.tsx index 04fc8f20d5..7c12f1edee 100644 --- a/web/app/components/app/overview/appCard.tsx +++ b/web/app/components/app/overview/appCard.tsx @@ -17,6 +17,7 @@ import type { ConfigParams } from './settings' import Tooltip from '@/app/components/base/tooltip' import AppBasic from '@/app/components/app-sidebar/basic' import { asyncRunSafe, randomString } from '@/utils' +import { basePath } from '@/utils/var' import Button from '@/app/components/base/button' import Switch from '@/app/components/base/switch' import Divider from '@/app/components/base/divider' @@ -88,7 +89,7 @@ function AppCard({ const runningStatus = isApp ? appInfo.enable_site : appInfo.enable_api const { app_base_url, access_token } = appInfo.site ?? {} const appMode = (appInfo.mode !== 'completion' && appInfo.mode !== 'workflow') ? 'chat' : appInfo.mode - const appUrl = `${app_base_url}/${appMode}/${access_token}` + const appUrl = `${app_base_url}${basePath}/${appMode}/${access_token}` const apiUrl = appInfo?.api_base_url const genClickFuncByName = (opName: string) => { diff --git a/web/app/components/app/overview/embedded/index.tsx b/web/app/components/app/overview/embedded/index.tsx index c515331961..37fbd5e291 100644 --- a/web/app/components/app/overview/embedded/index.tsx +++ b/web/app/components/app/overview/embedded/index.tsx @@ -13,6 +13,7 @@ import { IS_CE_EDITION } from '@/config' import type { SiteInfo } from '@/models/share' import { useThemeContext } from '@/app/components/base/chat/embedded-chatbot/theme/theme-context' import ActionButton from '@/app/components/base/action-button' +import { basePath } from '@/utils/var' import cn from '@/utils/classnames' type Props = { @@ -28,7 +29,7 @@ const OPTION_MAP = { iframe: { getContent: (url: string, token: string) => `