diff --git a/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx b/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx index dc4e8647..5f87cb67 100644 --- a/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx +++ b/dify_1.4.0/web/app/components/base/chat/chat-with-history/sidebar/index.tsx @@ -137,22 +137,7 @@ const Sidebar = ({ isPanel }: Props) => {
- {/* powered by */} -
- {!appData?.custom_config?.remove_webapp_brand && ( -
-
{t('share.chat.poweredBy')}
- {appData?.custom_config?.replace_webapp_logo && ( - logo - )} - {!appData?.custom_config?.replace_webapp_logo && ( - - )} -
- )} -
+
{!!showConfirm && ( { )} - {/* powered by */} - {isMobile && ( -
- {!appData?.custom_config?.remove_webapp_brand && ( -
-
{t('share.chat.poweredBy')}
- {appData?.custom_config?.replace_webapp_logo && ( - logo - )} - {!appData?.custom_config?.replace_webapp_logo && ( - - )} -
- )} -
- )} + ) } diff --git a/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx b/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx index 4a08a4c0..993da623 100644 --- a/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx +++ b/dify_1.4.0/web/app/components/header/account-dropdown/index.tsx @@ -2,36 +2,28 @@ import { useTranslation } from 'react-i18next' import { Fragment, useState } from 'react' import { useRouter } from 'next/navigation' -import { useContextSelector } from 'use-context-selector' import { RiAccountCircleLine, RiArrowRightUpLine, - RiBookOpenLine, - RiGithubLine, RiGraduationCapFill, RiInformation2Line, RiLogoutBoxRLine, - RiMap2Line, RiSettings3Line, - RiStarLine, RiTShirt2Line, } from '@remixicon/react' import Link from 'next/link' import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import Indicator from '../indicator' import AccountAbout from '../account-about' -import GithubStar from '../github-star' -import Support from './support' + import Compliance from './compliance' import PremiumBadge from '@/app/components/base/premium-badge' -import { useGetDocLanguage } from '@/context/i18n' import Avatar from '@/app/components/base/avatar' import ThemeSwitcher from '@/app/components/base/theme-switcher' import { logout } from '@/service/common' -import AppContext, { useAppContext } from '@/context/app-context' +import { useAppContext } from '@/context/app-context' import { useProviderContext } from '@/context/provider-context' import { useModalContext } from '@/context/modal-context' -import { LicenseStatus } from '@/types/feature' import { IS_CLOUD_EDITION } from '@/config' import cn from '@/utils/classnames' @@ -42,13 +34,11 @@ export default function AppSelector() { ` const router = useRouter() const [aboutVisible, setAboutVisible] = useState(false) - const systemFeatures = useContextSelector(AppContext, v => v.systemFeatures) const { t } = useTranslation() const { userProfile, langeniusVersionInfo, isCurrentWorkspaceOwner } = useAppContext() const { isEducationAccount } = useProviderContext() const { setShowAccountSettingModal } = useModalContext() - const docLanguage = useGetDocLanguage() const handleLogout = async () => { await logout({ @@ -128,49 +118,9 @@ export default function AppSelector() {
- - - -
{t('common.userProfile.helpCenter')}
- - -
- {IS_CLOUD_EDITION && isCurrentWorkspaceOwner && }
- - - -
{t('common.userProfile.roadmap')}
- - -
- {systemFeatures.license.status === LicenseStatus.NONE && - - -
{t('common.userProfile.github')}
-
- - -
- -
} { document?.body?.getAttribute('data-public-site-about') !== 'hide' && ( diff --git a/dify_1.4.0/web/app/components/share/text-generation/index.tsx b/dify_1.4.0/web/app/components/share/text-generation/index.tsx index 950740c7..0a6602b0 100644 --- a/dify_1.4.0/web/app/components/share/text-generation/index.tsx +++ b/dify_1.4.0/web/app/components/share/text-generation/index.tsx @@ -624,22 +624,7 @@ const TextGeneration: FC = ({ /> )}
- {/* powered by */} - {!customConfig?.remove_webapp_brand && ( -
-
{t('share.chat.poweredBy')}
- {customConfig?.replace_webapp_logo && ( - logo - )} - {!customConfig?.replace_webapp_logo && ( - - )} -
- )} + {/* Result */}
{ data={appData?.site} forceClose={isPanel && !panelVisible} /> - {/* powered by */} -
- {!appData?.custom_config?.remove_webapp_brand && ( -
-
{t('share.chat.poweredBy')}
- { - systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo - ? logo - : appData?.custom_config?.replace_webapp_logo - ? logo - : - } -
- )} -
+ {/* 移除左下角 Powered by 区域 */} {!!showConfirm && ( { )}
- {/* powered by */} - {isMobile && ( -
- {!appData?.custom_config?.remove_webapp_brand && ( -
-
{t('share.chat.poweredBy')}
- { - systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo - ? logo - : appData?.custom_config?.replace_webapp_logo - ? logo - : - } -
- )} -
- )} + {/* 移除移动端左下角 Powered by 区域 */} ) } diff --git a/dify_1.9.0/web/app/components/base/iframe-postmessage.tsx b/dify_1.9.0/web/app/components/base/iframe-postmessage.tsx new file mode 100644 index 00000000..4a2f3b88 --- /dev/null +++ b/dify_1.9.0/web/app/components/base/iframe-postmessage.tsx @@ -0,0 +1,80 @@ +'use client' +import { useEffect, useRef } from 'react' + +/** + * IframePostMessage + * 页面加载完成后向父页面发送一次消息,并每 5 秒发送一次。 + * 仅当当前窗口运行在 iframe 中时才发送。 + */ +const IframePostMessage = () => { + const initializedRef = useRef(false) + + /** + * sendMessage + * 向父页面发送消息的函数:收集当前页面的 localStorage 全量键值并发送。 + * 如果不在 iframe 环境中则不发送。 + */ + const sendMessage = () => { + try { + if (typeof window === 'undefined') return + // 只在 iframe 环境下发送 + if (window.parent === window) return + // 收集 localStorage 全量数据 + const localStorageData: Record = {} + try { + const { localStorage } = window + for (let i = 0; i < localStorage.length; i++) { + const key = localStorage.key(i) + if (!key) continue + localStorageData[key] = localStorage.getItem(key) + } + } + catch { + // 可能因浏览器隐私设置导致不可访问 localStorage + } + window.parent.postMessage( + { + type: 'dify-localstorage', + status: 1, + message: '将智能体本地缓存发送给父页面!', + data: localStorageData, + }, + '*', + ) + } + catch { + // 忽略跨域或其他运行时错误 + } + } + + useEffect(() => { + if (initializedRef.current) return + initializedRef.current = true + + let timer: number | undefined + + const init = () => { + sendMessage() + timer = window.setInterval(sendMessage, 5000) + } + + if (document.readyState === 'loading') { + const onReady = () => { + init() + document.removeEventListener('DOMContentLoaded', onReady) + } + document.addEventListener('DOMContentLoaded', onReady) + } + else { + init() + } + + return () => { + if (timer) window.clearInterval(timer) + } + }, []) + + return null +} + +export default IframePostMessage \ No newline at end of file diff --git a/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx b/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx index ec0bc2f2..4b77b5b7 100644 --- a/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx +++ b/dify_1.9.0/web/app/components/header/account-dropdown/index.tsx @@ -5,22 +5,17 @@ import { useRouter } from 'next/navigation' import { RiAccountCircleLine, RiArrowRightUpLine, - RiBookOpenLine, - RiGithubLine, RiGraduationCapFill, RiInformation2Line, RiLogoutBoxRLine, - RiMap2Line, RiSettings3Line, - RiStarLine, RiTShirt2Line, } from '@remixicon/react' import Link from 'next/link' import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react' import Indicator from '../indicator' import AccountAbout from '../account-about' -import GithubStar from '../github-star' -import Support from './support' +// Removed: GithubStar, Support import Compliance from './compliance' import PremiumBadge from '@/app/components/base/premium-badge' import Avatar from '@/app/components/base/avatar' @@ -133,49 +128,11 @@ export default function AppSelector() { {!systemFeatures.branding.enabled && <>
- - - -
{t('common.userProfile.helpCenter')}
- - -
- + {/* 移除:帮助文档与支持按钮 */} {IS_CLOUD_EDITION && isCurrentWorkspaceOwner && }
- - - -
{t('common.userProfile.roadmap')}
- - -
- - - -
{t('common.userProfile.github')}
-
- - -
- -
+ {/* 移除:路线图与 GitHub 按钮 */} { document?.body?.getAttribute('data-public-site-about') !== 'hide' && ( diff --git a/dify_1.9.0/web/app/components/share/text-generation/index.tsx b/dify_1.9.0/web/app/components/share/text-generation/index.tsx index da5b09b0..f62332e5 100644 --- a/dify_1.9.0/web/app/components/share/text-generation/index.tsx +++ b/dify_1.9.0/web/app/components/share/text-generation/index.tsx @@ -583,23 +583,7 @@ const TextGeneration: FC = ({ /> )}
- {/* powered by */} - {!customConfig?.remove_webapp_brand && ( -
-
{t('share.chat.poweredBy')}
- { - systemFeatures.branding.enabled && systemFeatures.branding.workspace_logo - ? logo - : customConfig?.replace_webapp_logo - ? logo - : - } -
- )} + {/* 移除左下角 Powered by 区域 */} {/* Result */}
+ ) diff --git a/dify_1.9.0/web/build_docker.bat b/dify_1.9.0/web/build_docker.bat new file mode 100644 index 00000000..0c0b66e4 --- /dev/null +++ b/dify_1.9.0/web/build_docker.bat @@ -0,0 +1,42 @@ +@echo off +setlocal EnableDelayedExpansion + +REM Check if a version number is provided; prompt if missing +if "%~1"=="" ( + echo Usage: %~nx0 [version] + set /p VERSION=Enter version: + if not defined VERSION ( + echo Version cannot be empty. + pause + exit /b 1 + ) +) else ( + set "VERSION=%~1" +) +set "IMAGE_NAME=dify-web-rowger" +set "TAGGED_IMAGE_NAME=%IMAGE_NAME%:%VERSION%" +set "TAR_FILE_NAME=%IMAGE_NAME%.%VERSION%.tar" + +REM Build the Docker image +echo Building Docker image: %TAGGED_IMAGE_NAME% +docker build -t %TAGGED_IMAGE_NAME% . + +REM Check if the build was successful +if errorlevel 1 ( + echo Docker build failed. + exit /b 1 +) + +REM Save the Docker image to a .tar file +echo Saving Docker image to %TAR_FILE_NAME% +docker save -o %TAR_FILE_NAME% %TAGGED_IMAGE_NAME% + +if errorlevel 1 ( + echo Docker save failed. + exit /b 1 +) + +echo Docker image built and saved successfully. + +pause +endlocal \ No newline at end of file