mirror of
https://github.com/langgenius/dify.git
synced 2026-05-02 08:28:03 +08:00
merge
This commit is contained in:
@ -43,16 +43,14 @@ const AllTools = ({
|
||||
supportAddCustomTool,
|
||||
onShowAddCustomCollectionModal,
|
||||
}: AllToolsProps) => {
|
||||
const tabs = useToolTabs()
|
||||
const language = useGetLanguage()
|
||||
const tabs = useToolTabs()
|
||||
const [activeTab, setActiveTab] = useState(ToolTypeEnum.All)
|
||||
const [activeView, setActiveView] = useState<ViewType>(ViewType.flat)
|
||||
|
||||
const hasFilter = searchText || tags.length > 0
|
||||
const isMatchingKeywords = (text: string, keywords: string) => {
|
||||
return text.toLowerCase().includes(keywords.toLowerCase())
|
||||
}
|
||||
|
||||
const hasFilter = searchText || tags.length > 0
|
||||
const tools = useMemo(() => {
|
||||
let mergedTools: ToolWithProvider[] = []
|
||||
if (activeTab === ToolTypeEnum.All)
|
||||
|
||||
@ -1,13 +1,25 @@
|
||||
import { useCallback } from 'react'
|
||||
import { useStore } from './store'
|
||||
import InstallBundle from '@/app/components/plugins/install-plugin/install-bundle'
|
||||
|
||||
const PluginDependency = () => {
|
||||
const dependencies = useStore(s => s.dependencies)
|
||||
|
||||
const handleCancelInstallBundle = useCallback(() => {
|
||||
const { setDependencies } = useStore.getState()
|
||||
setDependencies([])
|
||||
}, [])
|
||||
|
||||
if (!dependencies.length)
|
||||
return null
|
||||
|
||||
return (
|
||||
<div>a</div>
|
||||
<div>
|
||||
<InstallBundle
|
||||
fromDSLPayload={dependencies}
|
||||
onClose={handleCancelInstallBundle}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -104,17 +104,17 @@ const IterationResultPanel: FC<Props> = ({
|
||||
onClick={() => toggleIteration(index)}
|
||||
>
|
||||
<div className={cn('flex items-center gap-2 flex-grow')}>
|
||||
<div className='flex items-center justify-center w-4 h-4 rounded-[5px] border-divider-subtle bg-util-colors-cyan-cyan-500 flex-shrink-0'>
|
||||
<div className='flex items-center justify-center w-4 h-4 rounded-[5px] border-divider-subtle bg-util-colors-cyan-cyan-500 shrink-0'>
|
||||
<Iteration className='w-3 h-3 text-text-primary-on-surface' />
|
||||
</div>
|
||||
<span className='system-sm-semibold-uppercase text-text-primary flex-grow'>
|
||||
<span className='system-sm-semibold-uppercase text-text-primary grow'>
|
||||
{t(`${i18nPrefix}.iteration`)} {index + 1}
|
||||
</span>
|
||||
{iterationStatusShow(index, iteration, iterDurationMap)}
|
||||
</div>
|
||||
</div>
|
||||
{expandedIterations[index] && <div
|
||||
className="flex-grow h-px bg-divider-subtle"
|
||||
className="grow h-px bg-divider-subtle"
|
||||
></div>}
|
||||
<div className={cn(
|
||||
'overflow-hidden transition-all duration-200',
|
||||
|
||||
@ -144,7 +144,7 @@ const NodePanel: FC<Props> = ({
|
||||
className='flex items-center w-full self-stretch gap-2 px-3 py-2 bg-components-button-tertiary-bg-hover hover:bg-components-button-tertiary-bg-hover rounded-lg cursor-pointer border-none'
|
||||
onClick={handleOnShowIterationDetail}
|
||||
>
|
||||
<Iteration className='w-4 h-4 text-components-button-tertiary-text flex-shrink-0' />
|
||||
<Iteration className='w-4 h-4 text-components-button-tertiary-text shrink-0' />
|
||||
<div className='flex-1 text-left system-sm-medium text-components-button-tertiary-text'>{t('workflow.nodes.iteration.iteration', { count: getCount(nodeInfo.details?.length, nodeInfo.metadata?.iterator_length) })}{getErrorCount(nodeInfo.details) > 0 && (
|
||||
<>
|
||||
{t('workflow.nodes.iteration.comma')}
|
||||
@ -153,12 +153,12 @@ const NodePanel: FC<Props> = ({
|
||||
)}</div>
|
||||
{justShowIterationNavArrow
|
||||
? (
|
||||
<RiArrowRightSLine className='w-4 h-4 text-components-button-tertiary-text flex-shrink-0' />
|
||||
<RiArrowRightSLine className='w-4 h-4 text-components-button-tertiary-text shrink-0' />
|
||||
)
|
||||
: (
|
||||
<div className='flex items-center space-x-1 text-[#155EEF]'>
|
||||
<div className='text-[13px] font-normal '>{t('workflow.common.viewDetailInTracingPanel')}</div>
|
||||
<RiArrowRightSLine className='w-4 h-4 text-components-button-tertiary-text flex-shrink-0' />
|
||||
<RiArrowRightSLine className='w-4 h-4 text-components-button-tertiary-text shrink-0' />
|
||||
</div>
|
||||
)}
|
||||
</Button>
|
||||
|
||||
@ -57,7 +57,7 @@ function buildLogTree(nodes: NodeTracing[], t: (key: string) => string): Tracing
|
||||
levelCounts[levelKey]++
|
||||
|
||||
const parentTitle = parentId ? parallelStacks[parentId]?.parallelTitle : ''
|
||||
const levelNumber = parentTitle ? parseInt(parentTitle.split('-')[1]) + 1 : 1
|
||||
const levelNumber = parentTitle ? Number.parseInt(parentTitle.split('-')[1]) + 1 : 1
|
||||
const letter = parallelChildCounts[levelKey]?.size > 1 ? String.fromCharCode(64 + levelCounts[levelKey]) : ''
|
||||
return `${t('workflow.common.parallel')}-${levelNumber}${letter}`
|
||||
}
|
||||
@ -65,7 +65,7 @@ function buildLogTree(nodes: NodeTracing[], t: (key: string) => string): Tracing
|
||||
const getBranchTitle = (parentId: string | null, branchNum: number): string => {
|
||||
const levelKey = parentId || 'root'
|
||||
const parentTitle = parentId ? parallelStacks[parentId]?.parallelTitle : ''
|
||||
const levelNumber = parentTitle ? parseInt(parentTitle.split('-')[1]) + 1 : 1
|
||||
const levelNumber = parentTitle ? Number.parseInt(parentTitle.split('-')[1]) + 1 : 1
|
||||
const letter = parallelChildCounts[levelKey]?.size > 1 ? String.fromCharCode(64 + levelCounts[levelKey]) : ''
|
||||
const branchLetter = String.fromCharCode(64 + branchNum)
|
||||
return `${t('workflow.common.branch')}-${levelNumber}${letter}-${branchLetter}`
|
||||
@ -227,7 +227,7 @@ const TracingPanel: FC<TracingPanelProps> = ({
|
||||
<span>{node.parallelTitle}</span>
|
||||
</div>
|
||||
<div
|
||||
className="mx-2 flex-grow h-px bg-divider-subtle"
|
||||
className="mx-2 grow h-px bg-divider-subtle"
|
||||
style={{ background: 'linear-gradient(to right, rgba(16, 24, 40, 0.08), rgba(255, 255, 255, 0)' }}
|
||||
></div>
|
||||
</div>
|
||||
|
||||
@ -77,17 +77,13 @@ const UpdateDSLModal = ({
|
||||
return
|
||||
try {
|
||||
if (appDetail && fileContent) {
|
||||
const leakedData = await mutateAsync({ dslString: fileContent })
|
||||
if (leakedData?.leaked.length) {
|
||||
isCreatingRef.current = false
|
||||
return
|
||||
}
|
||||
setLoading(true)
|
||||
const {
|
||||
graph,
|
||||
features,
|
||||
hash,
|
||||
} = await updateWorkflowDraftFromDSL(appDetail.id, fileContent)
|
||||
await mutateAsync({ dslString: fileContent })
|
||||
const { nodes, edges, viewport } = graph
|
||||
const newFeatures = {
|
||||
file: {
|
||||
|
||||
Reference in New Issue
Block a user