mirror of
https://github.com/langgenius/dify.git
synced 2026-03-31 02:48:49 +08:00
app list filter
This commit is contained in:
@ -40,7 +40,7 @@ const AppPicker: FC<Props> = ({
|
||||
const [searchText, setSearchText] = useState('')
|
||||
const { data: appList } = useAppFullList()
|
||||
const filteredAppList = useMemo(() => {
|
||||
return (appList || []).filter(app => app.name.toLowerCase().includes(searchText.toLowerCase()))
|
||||
return (appList?.data || []).filter(app => app.name.toLowerCase().includes(searchText.toLowerCase())).filter(app => (app.mode !== 'advanced-chat' && app.mode !== 'workflow') || !!app.workflow)
|
||||
}, [appList, searchText])
|
||||
const getAppType = (app: App) => {
|
||||
switch (app.mode) {
|
||||
@ -81,7 +81,6 @@ const AppPicker: FC<Props> = ({
|
||||
<Input
|
||||
showLeftIcon
|
||||
showClearIcon
|
||||
// wrapperClassName='w-[200px]'
|
||||
value={searchText}
|
||||
onChange={e => setSearchText(e.target.value)}
|
||||
onClear={() => setSearchText('')}
|
||||
|
||||
@ -26,6 +26,7 @@ const AppTrigger = ({
|
||||
)}>
|
||||
{appDetail && (
|
||||
<AppIcon
|
||||
className='mr-2'
|
||||
size='xs'
|
||||
iconType={appDetail.icon_type}
|
||||
icon={appDetail.icon}
|
||||
|
||||
@ -48,7 +48,7 @@ const AppSelector: FC<Props> = ({
|
||||
onShowChange(true)
|
||||
}
|
||||
|
||||
const { data: currentApp } = useAppDetail(value?.app_id || '')
|
||||
const { data: currentApp } = useAppDetail(value?.app_id || 'empty')
|
||||
const [isShowChooseApp, setIsShowChooseApp] = useState(false)
|
||||
const handleSelectApp = (app: App) => {
|
||||
const appValue = {
|
||||
@ -74,7 +74,7 @@ const AppSelector: FC<Props> = ({
|
||||
>
|
||||
<AppTrigger
|
||||
open={isShow}
|
||||
appDetail={undefined}
|
||||
appDetail={currentApp}
|
||||
/>
|
||||
</PortalToFollowElemTrigger>
|
||||
<PortalToFollowElemContent className='z-[1000]'>
|
||||
@ -87,7 +87,7 @@ const AppSelector: FC<Props> = ({
|
||||
trigger={
|
||||
<AppTrigger
|
||||
open={isShowChooseApp}
|
||||
appDetail={undefined}
|
||||
appDetail={currentApp}
|
||||
/>
|
||||
}
|
||||
isShow={isShowChooseApp}
|
||||
|
||||
@ -73,7 +73,7 @@ const EndpointModal: FC<Props> = ({
|
||||
isEditMode={true}
|
||||
showOnVariableMap={{}}
|
||||
validating={false}
|
||||
inputClassName='bg-components-input-bg-normal hover:bg-state-base-hover-alt'
|
||||
inputClassName='bg-components-input-bg-normal hover:bg-components-input-bg-hover'
|
||||
fieldMoreInfo={item => item.url
|
||||
? (<a
|
||||
href={item.url}
|
||||
|
||||
@ -67,7 +67,7 @@ const ToolCredentialForm: FC<Props> = ({
|
||||
isEditMode={true}
|
||||
showOnVariableMap={{}}
|
||||
validating={false}
|
||||
inputClassName='bg-components-input-bg-normal hover:bg-state-base-hover-alt'
|
||||
inputClassName='bg-components-input-bg-normal hover:bg-components-input-bg-hover'
|
||||
fieldMoreInfo={item => item.url
|
||||
? (<a
|
||||
href={item.url}
|
||||
|
||||
Reference in New Issue
Block a user