diff --git a/web/app/(commonLayout)/datasets/Container.tsx b/web/app/(commonLayout)/datasets/Container.tsx index 95f8baea12..771fa7c3f9 100644 --- a/web/app/(commonLayout)/datasets/Container.tsx +++ b/web/app/(commonLayout)/datasets/Container.tsx @@ -11,7 +11,7 @@ import { useQuery } from '@tanstack/react-query' import ExternalAPIPanel from '../../components/datasets/external-api/external-api-panel' import Datasets from './Datasets' import DatasetFooter from './DatasetFooter' -import ApiServer from './ApiServer' +import ApiServer from '../../components/develop/ApiServer' import Doc from './Doc' import TabSliderNew from '@/app/components/base/tab-slider-new' import TagManagementModal from '@/app/components/base/tag-management' diff --git a/web/app/(commonLayout)/datasets/Doc.tsx b/web/app/(commonLayout)/datasets/Doc.tsx index e79adbccd5..20264ce8ad 100644 --- a/web/app/(commonLayout)/datasets/Doc.tsx +++ b/web/app/(commonLayout)/datasets/Doc.tsx @@ -9,6 +9,9 @@ import TemplateZh from './template/template.zh.mdx' import TemplateJa from './template/template.ja.mdx' import I18n from '@/context/i18n' import { LanguagesSupported } from '@/i18n/language' +import useTheme from '@/hooks/use-theme' +import { Theme } from '@/types/app' +import cn from '@/utils/classnames' type DocProps = { apiBaseUrl: string @@ -19,6 +22,7 @@ const Doc = ({ apiBaseUrl }: DocProps) => { const { t } = useTranslation() const [toc, setToc] = useState>([]) const [isTocExpanded, setIsTocExpanded] = useState(false) + const { theme } = useTheme() // Set initial TOC expanded state based on screen width useEffect(() => { @@ -83,12 +87,12 @@ const Doc = ({ apiBaseUrl }: DocProps) => {
{isTocExpanded ? ( -
diff --git a/web/app/(commonLayout)/datasets/ApiServer.tsx b/web/app/components/develop/ApiServer.tsx similarity index 65% rename from web/app/(commonLayout)/datasets/ApiServer.tsx rename to web/app/components/develop/ApiServer.tsx index 0756178e7f..4de98c6cd4 100644 --- a/web/app/(commonLayout)/datasets/ApiServer.tsx +++ b/web/app/components/develop/ApiServer.tsx @@ -4,7 +4,6 @@ import type { FC } from 'react' import { useTranslation } from 'react-i18next' import CopyFeedback from '@/app/components/base/copy-feedback' import SecretKeyButton from '@/app/components/develop/secret-key/secret-key-button' -import { randomString } from '@/utils' type ApiServerProps = { apiBaseUrl: string @@ -16,21 +15,17 @@ const ApiServer: FC = ({ return (
-
-
{t('appApi.apiServer')}
-
{apiBaseUrl}
-
- +
+
{t('appApi.apiServer')}
+
{apiBaseUrl}
+
+
{t('appApi.ok')}
) diff --git a/web/app/components/develop/doc.tsx b/web/app/components/develop/doc.tsx index d69abdf875..deda6dc8b8 100644 --- a/web/app/components/develop/doc.tsx +++ b/web/app/components/develop/doc.tsx @@ -17,6 +17,9 @@ import TemplateChatZh from './template/template_chat.zh.mdx' import TemplateChatJa from './template/template_chat.ja.mdx' import I18n from '@/context/i18n' import { LanguagesSupported } from '@/i18n/language' +import useTheme from '@/hooks/use-theme' +import { Theme } from '@/types/app' +import cn from '@/utils/classnames' type IDocProps = { appDetail: any @@ -27,6 +30,7 @@ const Doc = ({ appDetail }: IDocProps) => { const { t } = useTranslation() const [toc, setToc] = useState>([]) const [isTocExpanded, setIsTocExpanded] = useState(false) + const { theme } = useTheme() const variables = appDetail?.model_config?.configs?.prompt_variables || [] const inputs = variables.reduce((res: any, variable: any) => { @@ -83,12 +87,12 @@ const Doc = ({ appDetail }: IDocProps) => {
{isTocExpanded ? ( -