mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 11:56:55 +08:00
refactor: improve layout-main component structure and readability
This commit is contained in:
parent
7b9a3c1084
commit
e52c905aa5
@ -149,22 +149,26 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
|
|||||||
]
|
]
|
||||||
|
|
||||||
if (datasetRes?.provider !== 'external') {
|
if (datasetRes?.provider !== 'external') {
|
||||||
baseNavigation.unshift(...[{
|
if (datasetRes?.pipeline_id) {
|
||||||
|
baseNavigation.unshift({
|
||||||
|
name: t('common.datasetMenus.pipeline'),
|
||||||
|
href: `/datasets/${datasetId}/pipeline`,
|
||||||
|
icon: PipelineLine as RemixiconComponentType,
|
||||||
|
selectedIcon: PipelineFill as RemixiconComponentType,
|
||||||
|
disabled: false,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
baseNavigation.unshift({
|
||||||
name: t('common.datasetMenus.documents'),
|
name: t('common.datasetMenus.documents'),
|
||||||
href: `/datasets/${datasetId}/documents`,
|
href: `/datasets/${datasetId}/documents`,
|
||||||
icon: RiFileTextLine,
|
icon: RiFileTextLine,
|
||||||
selectedIcon: RiFileTextFill,
|
selectedIcon: RiFileTextFill,
|
||||||
disabled: isButtonDisabledWithPipeline,
|
disabled: isButtonDisabledWithPipeline,
|
||||||
}, {
|
})
|
||||||
name: t('common.datasetMenus.pipeline'),
|
|
||||||
href: `/datasets/${datasetId}/pipeline`,
|
|
||||||
icon: PipelineLine as RemixiconComponentType,
|
|
||||||
selectedIcon: PipelineFill as RemixiconComponentType,
|
|
||||||
disabled: false,
|
|
||||||
}])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return baseNavigation
|
return baseNavigation
|
||||||
}, [t, datasetId, isButtonDisabledWithPipeline, datasetRes?.provider])
|
}, [t, datasetId, isButtonDisabledWithPipeline, datasetRes?.provider, datasetRes?.pipeline_id])
|
||||||
|
|
||||||
useDocumentTitle(datasetRes?.name || t('common.menus.datasets'))
|
useDocumentTitle(datasetRes?.name || t('common.menus.datasets'))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user