diff --git a/web/app/components/app/chat/answer/index.tsx b/web/app/components/app/chat/answer/index.tsx index ef3a8824aaf03b..396e22a3aa0aa2 100644 --- a/web/app/components/app/chat/answer/index.tsx +++ b/web/app/components/app/chat/answer/index.tsx @@ -1,5 +1,5 @@ 'use client' -import type { FC } from 'react' +import type { FC, ReactNode } from 'react' import React, { useState } from 'react' import { useTranslation } from 'react-i18next' import { useContext } from 'use-context-selector' @@ -44,7 +44,7 @@ export type IAnswerProps = { onSubmitAnnotation?: SubmitAnnotationFunc displayScene: DisplayScene isResponsing?: boolean - answerIconClassName?: string + answerIcon?: ReactNode thoughts?: ThoughtItem[] citation?: CitationItem[] isThinking?: boolean @@ -53,7 +53,7 @@ export type IAnswerProps = { isShowCitationHitInfo?: boolean } // The component needs to maintain its own state to control whether to display input component -const Answer: FC = ({ item, feedbackDisabled = false, isHideFeedbackEdit = false, onFeedback, onSubmitAnnotation, displayScene = 'web', isResponsing, answerIconClassName, thoughts, citation, isThinking, dataSets, isShowCitation, isShowCitationHitInfo = false }) => { +const Answer: FC = ({ item, feedbackDisabled = false, isHideFeedbackEdit = false, onFeedback, onSubmitAnnotation, displayScene = 'web', isResponsing, answerIcon, thoughts, citation, isThinking, dataSets, isShowCitation, isShowCitationHitInfo = false }) => { const { id, content, more, feedback, adminFeedback, annotation: initAnnotation } = item const [showEdit, setShowEdit] = useState(false) const [loading, setLoading] = useState(false) @@ -168,13 +168,17 @@ const Answer: FC = ({ item, feedbackDisabled = false, isHideFeedba return (
-
- {isResponsing - &&
- + { + answerIcon || ( +
+ {isResponsing + &&
+ +
+ }
- } -
+ ) + }
diff --git a/web/app/components/app/chat/index.tsx b/web/app/components/app/chat/index.tsx index 67a2586585060e..fe8ff5fa43f82f 100644 --- a/web/app/components/app/chat/index.tsx +++ b/web/app/components/app/chat/index.tsx @@ -1,5 +1,5 @@ 'use client' -import type { FC } from 'react' +import type { FC, ReactNode } from 'react' import React, { useEffect, useLayoutEffect, useRef, useState } from 'react' import { useContext } from 'use-context-selector' import cn from 'classnames' @@ -49,7 +49,7 @@ export type IChatProps = { suggestionList?: string[] isShowSpeechToText?: boolean isShowCitation?: boolean - answerIconClassName?: string + answerIcon?: ReactNode isShowConfigElem?: boolean dataSets?: DataSet[] isShowCitationHitInfo?: boolean @@ -78,7 +78,7 @@ const Chat: FC = ({ suggestionList, isShowSpeechToText, isShowCitation, - answerIconClassName, + answerIcon, isShowConfigElem, dataSets, isShowCitationHitInfo, @@ -179,7 +179,7 @@ const Chat: FC = ({ onSubmitAnnotation={onSubmitAnnotation} displayScene={displayScene ?? 'web'} isResponsing={isResponsing && isLast} - answerIconClassName={answerIconClassName} + answerIcon={answerIcon} thoughts={thoughts} citation={citation} isThinking={isThinking} diff --git a/web/app/components/base/logo/logo-embeded-chat-avatar.tsx b/web/app/components/base/logo/logo-embeded-chat-avatar.tsx new file mode 100644 index 00000000000000..c5880e7bf6743b --- /dev/null +++ b/web/app/components/base/logo/logo-embeded-chat-avatar.tsx @@ -0,0 +1,18 @@ +import type { FC } from 'react' + +type LogoEmbededChatAvatarProps = { + className?: string +} +const LogoEmbededChatAvatar: FC = ({ + className, +}) => { + return ( + logo + ) +} + +export default LogoEmbededChatAvatar diff --git a/web/app/components/base/logo/logo-embeded-chat-header.tsx b/web/app/components/base/logo/logo-embeded-chat-header.tsx new file mode 100644 index 00000000000000..f979d501c20a8d --- /dev/null +++ b/web/app/components/base/logo/logo-embeded-chat-header.tsx @@ -0,0 +1,18 @@ +import type { FC } from 'react' + +type LogoEmbededChatHeaderProps = { + className?: string +} +const LogoEmbededChatHeader: FC = ({ + className, +}) => { + return ( + logo + ) +} + +export default LogoEmbededChatHeader diff --git a/web/app/components/base/logo/logo-site.tsx b/web/app/components/base/logo/logo-site.tsx new file mode 100644 index 00000000000000..9d9bccfaf845ff --- /dev/null +++ b/web/app/components/base/logo/logo-site.tsx @@ -0,0 +1,18 @@ +import type { FC } from 'react' + +type LogoSiteProps = { + className?: string +} +const LogoSite: FC = ({ + className, +}) => { + return ( + logo + ) +} + +export default LogoSite diff --git a/web/app/components/header/account-about/index.module.css b/web/app/components/header/account-about/index.module.css index f7bed837ab6b15..108a02936901fb 100644 --- a/web/app/components/header/account-about/index.module.css +++ b/web/app/components/header/account-about/index.module.css @@ -1,16 +1,3 @@ -.logo-icon { - background: url(../assets/logo-icon.png) center center no-repeat; - background-size: 32px; - box-shadow: 0px 2px 4px -2px rgba(0, 0, 0, 0.05), 0px 4px 6px -1px rgba(0, 0, 0, 0.05); -} - -.logo-text { - width: 74.09px; - height: 15.32px; - background: url(../assets/logo-text.svg) center center no-repeat; - background-size: contain; -} - .modal { max-width: 480px !important; width: 480px !important; diff --git a/web/app/components/header/account-about/index.tsx b/web/app/components/header/account-about/index.tsx index 36f6c983c79789..f9887d51c25e82 100644 --- a/web/app/components/header/account-about/index.tsx +++ b/web/app/components/header/account-about/index.tsx @@ -6,10 +6,10 @@ import { useContext } from 'use-context-selector' import s from './index.module.css' import Modal from '@/app/components/base/modal' import { XClose } from '@/app/components/base/icons/src/vender/line/general' -import { Dify } from '@/app/components/base/icons/src/public/common' import type { LangGeniusVersionResponse } from '@/models/common' import { IS_CE_EDITION } from '@/config' import I18n from '@/context/i18n' +import LogoSite from '@/app/components/base/logo/logo-site' type IAccountSettingProps = { langeniusVersionInfo: LangGeniusVersionResponse @@ -33,16 +33,12 @@ export default function AccountAbout({ onClose={() => { }} className={s.modal} > -
+
-
- +
Version {langeniusVersionInfo?.current_version}
© 2023 LangGenius, Inc., Contributors.
diff --git a/web/app/components/header/account-dropdown/index.tsx b/web/app/components/header/account-dropdown/index.tsx index 9a344e215205b5..3298f0dee3fbcf 100644 --- a/web/app/components/header/account-dropdown/index.tsx +++ b/web/app/components/header/account-dropdown/index.tsx @@ -104,15 +104,19 @@ export default function AppSelector() { - -
setAboutVisible(true)}> -
{t('common.userProfile.about')}
-
-
{langeniusVersionInfo.current_version}
- -
-
-
+ { + document?.body?.getAttribute('data-public-site-about') !== 'hide' && ( + +
setAboutVisible(true)}> +
{t('common.userProfile.about')}
+
+
{langeniusVersionInfo.current_version}
+ +
+
+
+ ) + }
handleLogout()}> diff --git a/web/app/components/header/account-setting/members-page/index.module.css b/web/app/components/header/account-setting/members-page/index.module.css deleted file mode 100644 index 5b89686291bcd7..00000000000000 --- a/web/app/components/header/account-setting/members-page/index.module.css +++ /dev/null @@ -1,9 +0,0 @@ -.logo-icon { - width: 40px; - height: 40px; - background: #ffffff url(../../assets/logo-icon.png) center center no-repeat; - background-size: contain; - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); - border-radius: 8px; - border: 0.5px solid rgba(0, 0, 0, 0.05); -} \ No newline at end of file diff --git a/web/app/components/header/account-setting/members-page/index.tsx b/web/app/components/header/account-setting/members-page/index.tsx index be684a4ce06fcf..078117efed82b9 100644 --- a/web/app/components/header/account-setting/members-page/index.tsx +++ b/web/app/components/header/account-setting/members-page/index.tsx @@ -1,6 +1,5 @@ 'use client' import { useState } from 'react' -import cn from 'classnames' import useSWR from 'swr' import dayjs from 'dayjs' import 'dayjs/locale/zh-cn' @@ -8,7 +7,6 @@ import relativeTime from 'dayjs/plugin/relativeTime' import { useContext } from 'use-context-selector' import { UserPlusIcon } from '@heroicons/react/24/outline' import { useTranslation } from 'react-i18next' -import s from './index.module.css' import InviteModal from './invite-modal' import InvitedModal from './invited-modal' import Operation from './operation' @@ -40,7 +38,6 @@ const MembersPage = () => { <>
-
{currentWorkspace?.name}
{t('common.userProfile.workspace')}
diff --git a/web/app/components/header/assets/logo-icon.png b/web/app/components/header/assets/logo-icon.png deleted file mode 100644 index 76db2319cddde7..00000000000000 Binary files a/web/app/components/header/assets/logo-icon.png and /dev/null differ diff --git a/web/app/components/header/assets/logo-text.svg b/web/app/components/header/assets/logo-text.svg deleted file mode 100644 index 69d5a23be406f9..00000000000000 --- a/web/app/components/header/assets/logo-text.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/web/app/components/header/assets/logo.png b/web/app/components/header/assets/logo.png deleted file mode 100644 index ad98291826b5f0..00000000000000 Binary files a/web/app/components/header/assets/logo.png and /dev/null differ diff --git a/web/app/components/header/index.module.css b/web/app/components/header/index.module.css index 0c38c73b48002a..a95938a3ec6764 100644 --- a/web/app/components/header/index.module.css +++ b/web/app/components/header/index.module.css @@ -8,13 +8,6 @@ border-top: 4px solid #06AED4; } -.logo { - width: 96px; - height: 40px; - background: url(~@/app/components/share/chat/welcome/icons/logo.png) center center no-repeat; - background-size: contain; -} - .alpha { width: 12px; height: 12px; diff --git a/web/app/components/header/index.tsx b/web/app/components/header/index.tsx index be2c16eef661cd..0500c86aef704e 100644 --- a/web/app/components/header/index.tsx +++ b/web/app/components/header/index.tsx @@ -8,9 +8,9 @@ import EnvNav from './env-nav' import ExploreNav from './explore-nav' import GithubStar from './github-star' import PluginNav from './plugin-nav' -import s from './index.module.css' import { WorkspaceProvider } from '@/context/workspace-context' import { useAppContext } from '@/context/app-context' +import LogoSite from '@/app/components/base/logo/logo-site' const navClassName = ` flex items-center relative mr-3 px-3 h-8 rounded-xl @@ -24,9 +24,8 @@ const Header = () => { <>
-
+ - {/* @ts-expect-error Async Server Component */}
diff --git a/web/app/components/share/chat/welcome/icons/logo.png b/web/app/components/share/chat/welcome/icons/logo.png deleted file mode 100644 index ad98291826b5f0..00000000000000 Binary files a/web/app/components/share/chat/welcome/icons/logo.png and /dev/null differ diff --git a/web/app/components/share/chat/welcome/massive-component.tsx b/web/app/components/share/chat/welcome/massive-component.tsx index c803d8cb2cd2ef..9a9c2cb7f1204d 100644 --- a/web/app/components/share/chat/welcome/massive-component.tsx +++ b/web/app/components/share/chat/welcome/massive-component.tsx @@ -9,6 +9,7 @@ import { import s from './style.module.css' import type { SiteInfo } from '@/models/share' import Button from '@/app/components/base/button' +import LogoSite from '@/app/components/base/logo/logo-site' export const AppInfo: FC<{ siteInfo: SiteInfo }> = ({ siteInfo }) => { return ( @@ -69,5 +70,5 @@ export const EditBtn = ({ className, onClick }: { className?: string; onClick: ( } export const FootLogo = () => ( -
+ ) diff --git a/web/app/components/share/chat/welcome/style.module.css b/web/app/components/share/chat/welcome/style.module.css index b007bf23a01b68..458a112ca3ba65 100644 --- a/web/app/components/share/chat/welcome/style.module.css +++ b/web/app/components/share/chat/welcome/style.module.css @@ -19,11 +19,4 @@ .customBtn { width: 136px; -} - -.logo { - width: 48px; - height: 20px; - background: url(./icons/logo.png) center center no-repeat; - background-size: contain; } \ No newline at end of file diff --git a/web/app/components/share/chatbot/icons/dify-header.svg b/web/app/components/share/chatbot/icons/dify-header.svg deleted file mode 100644 index 4e4f2fa2491fe8..00000000000000 --- a/web/app/components/share/chatbot/icons/dify-header.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/app/components/share/chatbot/icons/dify.svg b/web/app/components/share/chatbot/icons/dify.svg deleted file mode 100644 index 2fc6464b432aaa..00000000000000 --- a/web/app/components/share/chatbot/icons/dify.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/web/app/components/share/chatbot/index.tsx b/web/app/components/share/chatbot/index.tsx index 7813c6afa5793c..0712795116d3f7 100644 --- a/web/app/components/share/chatbot/index.tsx +++ b/web/app/components/share/chatbot/index.tsx @@ -26,6 +26,8 @@ import { replaceStringWithValues } from '@/app/components/app/configuration/prom import { userInputsFormToPromptVariables } from '@/utils/model-config' import type { InstalledApp } from '@/models/explore' import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback' +import LogoHeader from '@/app/components/base/logo/logo-embeded-chat-header' +import LogoAvatar from '@/app/components/base/logo/logo-embeded-chat-avatar' export type IMainProps = { isInstalledApp?: boolean @@ -488,7 +490,7 @@ const Main: FC = ({ } const difyIcon = ( -
+ ) if (appUnavailable) @@ -567,7 +569,7 @@ const Main: FC = ({ suggestionList={suggestQuestions} displayScene='web' isShowSpeechToText={speechToTextConfig?.enabled} - answerIconClassName={s.difyIcon} + answerIcon={} />
) diff --git a/web/app/components/share/chatbot/style.module.css b/web/app/components/share/chatbot/style.module.css index e866feef38e13d..895860c21a18d6 100644 --- a/web/app/components/share/chatbot/style.module.css +++ b/web/app/components/share/chatbot/style.module.css @@ -1,14 +1,3 @@ .installedApp { height: calc(100vh - 74px); -} - -.difyIcon { - background-image: url(./icons/dify.svg); -} - -.difyHeader { - width: 24px; - height: 24px; - background: url(./icons/dify-header.svg) center center no-repeat; - background-size: contain; } \ No newline at end of file diff --git a/web/app/components/share/chatbot/welcome/icons/logo.png b/web/app/components/share/chatbot/welcome/icons/logo.png deleted file mode 100644 index 800a070906310b..00000000000000 Binary files a/web/app/components/share/chatbot/welcome/icons/logo.png and /dev/null differ diff --git a/web/app/components/share/chatbot/welcome/massive-component.tsx b/web/app/components/share/chatbot/welcome/massive-component.tsx index c1e4ef520301ca..87863887cfa915 100644 --- a/web/app/components/share/chatbot/welcome/massive-component.tsx +++ b/web/app/components/share/chatbot/welcome/massive-component.tsx @@ -9,6 +9,7 @@ import { import s from './style.module.css' import type { SiteInfo } from '@/models/share' import Button from '@/app/components/base/button' +import LogoSite from '@/app/components/base/logo/logo-site' export const AppInfo: FC<{ siteInfo: SiteInfo }> = ({ siteInfo }) => { const { t } = useTranslation() @@ -70,5 +71,5 @@ export const EditBtn = ({ className, onClick }: { className?: string; onClick: ( } export const FootLogo = () => ( -
+ ) diff --git a/web/app/components/share/chatbot/welcome/style.module.css b/web/app/components/share/chatbot/welcome/style.module.css index b007bf23a01b68..458a112ca3ba65 100644 --- a/web/app/components/share/chatbot/welcome/style.module.css +++ b/web/app/components/share/chatbot/welcome/style.module.css @@ -19,11 +19,4 @@ .customBtn { width: 136px; -} - -.logo { - width: 48px; - height: 20px; - background: url(./icons/logo.png) center center no-repeat; - background-size: contain; } \ No newline at end of file diff --git a/web/app/layout.tsx b/web/app/layout.tsx index f70551cbd2ecc0..adb6fd9af87247 100644 --- a/web/app/layout.tsx +++ b/web/app/layout.tsx @@ -26,6 +26,7 @@ const LocaleLayout = ({ data-public-edition={process.env.NEXT_PUBLIC_EDITION} data-public-sentry-dsn={process.env.NEXT_PUBLIC_SENTRY_DSN} data-public-maintenance-notice={process.env.NEXT_PUBLIC_MAINTENANCE_NOTICE} + data-public-site-about={process.env.NEXT_PUBLIC_SITE_ABOUT} > diff --git a/web/app/signin/_header.tsx b/web/app/signin/_header.tsx index 0d6cb3e6390fce..66643059abdc38 100644 --- a/web/app/signin/_header.tsx +++ b/web/app/signin/_header.tsx @@ -1,10 +1,10 @@ 'use client' import React from 'react' import { useContext } from 'use-context-selector' -import style from './page.module.css' import Select, { LOCALES } from '@/app/components/base/select/locale' import { type Locale } from '@/i18n' import I18n from '@/context/i18n' +import LogoSite from '@/app/components/base/logo/logo-site' const Header = () => { const { locale, setLocaleOnClient } = useContext(I18n) @@ -13,7 +13,7 @@ const Header = () => { localStorage.removeItem('console_token') return
-
+