mirror of
https://github.com/YFGaia/dify-plus.git
synced 2026-06-14 20:41:21 +08:00
fix: 升级依赖并修复相关问题
- 升级web依赖到最新版本 - 修复1.11.4版本兼容性问题 - 解决google字体dockerfile访问问题 - 恢复丢失的相关文件 - 添加多语言支持 - 调整docker版本及worker镜像配置
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
'use client'
|
||||
|
||||
import type { CreateAppModalProps } from '@/app/components/explore/create-app-modal'
|
||||
import type { App } from '@/models/explore'
|
||||
import { useDebounceFn } from 'ahooks'
|
||||
import { useQueryState } from 'nuqs'
|
||||
@@ -10,7 +9,6 @@ import { useCallback, useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Loading from '@/app/components/base/loading'
|
||||
import Category from '@/app/components/explore/category'
|
||||
import { fetchAppDetail } from '@/service/explore'
|
||||
import { useInstalledAppList } from '@/service/use-explore'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import s from './style.module.css'
|
||||
@@ -65,7 +63,7 @@ const Apps = ({
|
||||
const filteredListExtend = useMemo(() => {
|
||||
if (!data)
|
||||
return []
|
||||
|
||||
|
||||
let result = data.allList
|
||||
|
||||
// Apply category filter
|
||||
@@ -87,7 +85,17 @@ const Apps = ({
|
||||
)
|
||||
}
|
||||
|
||||
return result
|
||||
// Deduplicate by app_id (same app may appear multiple times due to multiple tags)
|
||||
const seenAppIds = new Set<string>()
|
||||
const deduplicatedResult: App[] = []
|
||||
for (const item of result) {
|
||||
if (!seenAppIds.has(item.app_id)) {
|
||||
seenAppIds.add(item.app_id)
|
||||
deduplicatedResult.push(item)
|
||||
}
|
||||
}
|
||||
|
||||
return deduplicatedResult
|
||||
}, [data, currCategory, allCategoriesEn, tagFilterValue, keywordsValue])
|
||||
// Extend: stop Filtered list with search and tag filter
|
||||
|
||||
@@ -120,11 +128,6 @@ const Apps = ({
|
||||
'flex h-full flex-col border-l-[0.5px] border-divider-regular',
|
||||
)}
|
||||
>
|
||||
<div className="shrink-0 px-12 pt-6">
|
||||
<div className={`mb-1 ${s.textGradient} text-xl font-semibold`}>{t('apps.title', { ns: 'explore' })}</div>
|
||||
<div className="text-sm text-text-tertiary">{t('apps.description', { ns: 'explore' })}</div>
|
||||
</div>
|
||||
|
||||
<div className={cn(
|
||||
'mt-6 flex items-center justify-between px-12',
|
||||
)}
|
||||
@@ -154,7 +157,7 @@ const Apps = ({
|
||||
>
|
||||
{filteredListExtend.map(app => (
|
||||
<AppCard
|
||||
key={app.app_id}
|
||||
key={app.installed_id}
|
||||
isExplore
|
||||
app={app}
|
||||
// Extend: start Create new conversation for installed app
|
||||
|
||||
@@ -117,15 +117,11 @@ const Apps = ({
|
||||
|
||||
return result
|
||||
}, [data, currCategory, allCategoriesEn, tagFilterValue, keywordsValue])
|
||||
// Extend: stop Filtered list with search and tag filter
|
||||
|
||||
const handleTagsChange = (value: string[]) => {
|
||||
setTagFilterValue(value)
|
||||
}
|
||||
|
||||
const handleKeywordsChange = (value: string) => {
|
||||
setKeywordsValue(value)
|
||||
}
|
||||
// Extend: stop Filtered list with search and tag filter
|
||||
|
||||
const [currApp, setCurrApp] = React.useState<App | null>(null)
|
||||
const [isShowCreateModal, setIsShowCreateModal] = React.useState(false)
|
||||
@@ -227,15 +223,6 @@ const Apps = ({
|
||||
{/* Extend: stop Explore Add Search */}
|
||||
</div>
|
||||
|
||||
<div className="mt-2 px-12">
|
||||
<Category
|
||||
list={categories}
|
||||
value={currCategory}
|
||||
onChange={setCurrCategory}
|
||||
allCategoriesEn={allCategoriesEn}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={cn(
|
||||
'relative mt-4 flex flex-1 shrink-0 grow flex-col overflow-auto pb-6',
|
||||
)}
|
||||
|
||||
@@ -122,7 +122,7 @@ const SideBar: FC<IExploreSideBarProps> = ({
|
||||
style={isDiscoverySelected ? { boxShadow: '0px 1px 2px rgba(16, 24, 40, 0.05)' } : {}}
|
||||
>
|
||||
{isDiscoverySelected ? <SelectedDiscoveryIcon /> : <DiscoveryIcon />}
|
||||
{!isMobile && <div className='text-sm'>{t('sidebar.discovery', { ns: 'explore' })}</div>}
|
||||
{!isMobile && <div className='text-sm'>{t('sidebar.discovery', { ns: 'extend' })}</div>}
|
||||
</Link>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -22,7 +22,7 @@ const ExploreNav = ({
|
||||
|
||||
return (
|
||||
<Link
|
||||
href="/explore/apps"
|
||||
href="/explore/apps-center-extend"
|
||||
className={cn(className, 'group', activated && 'bg-components-main-nav-nav-button-bg-active shadow-md', activated ? 'text-components-main-nav-nav-button-text-active' : 'text-components-main-nav-nav-button-text hover:bg-components-main-nav-nav-button-bg-hover')}
|
||||
>
|
||||
{
|
||||
|
||||
@@ -74,6 +74,7 @@ export type IMainProps = {
|
||||
|
||||
const TextGeneration: FC<IMainProps> = ({
|
||||
isInstalledApp = false,
|
||||
installedAppInfo,
|
||||
isWorkflow = false,
|
||||
}) => {
|
||||
const { notify } = Toast
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,93 @@
|
||||
Copyright 2022 The Instrument Serif Project Authors (https://github.com/Instrument/instrument-serif)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
+17
-6
@@ -1,7 +1,8 @@
|
||||
import type { Viewport } from 'next'
|
||||
import { Provider as JotaiProvider } from 'jotai'
|
||||
import { ThemeProvider } from 'next-themes'
|
||||
import { Instrument_Serif } from 'next/font/google'
|
||||
// extend: dockefile 构建访问不到google,改成本地
|
||||
import localFont from 'next/font/local'
|
||||
import { NuqsAdapter } from 'nuqs/adapters/next/app'
|
||||
import GlobalPublicStoreProvider from '@/context/global-public-context'
|
||||
import { TanstackQueryInitializer } from '@/context/query-client'
|
||||
@@ -25,13 +26,23 @@ export const viewport: Viewport = {
|
||||
viewportFit: 'cover',
|
||||
userScalable: false,
|
||||
}
|
||||
|
||||
const instrumentSerif = Instrument_Serif({
|
||||
weight: ['400'],
|
||||
style: ['normal', 'italic'],
|
||||
subsets: ['latin'],
|
||||
// extend: start dockefile 构建访问不到google,改成本地
|
||||
const instrumentSerif = localFont({
|
||||
src: [
|
||||
{
|
||||
path: './fonts/InstrumentSerif-Regular.ttf',
|
||||
weight: '400',
|
||||
style: 'normal',
|
||||
},
|
||||
{
|
||||
path: './fonts/InstrumentSerif-Italic.ttf',
|
||||
weight: '400',
|
||||
style: 'italic',
|
||||
},
|
||||
],
|
||||
variable: '--font-instrument-serif',
|
||||
})
|
||||
// extend: stop dockefile 构建访问不到google,改成本地
|
||||
|
||||
const LocaleLayout = async ({
|
||||
children,
|
||||
|
||||
Reference in New Issue
Block a user