mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 08:58:09 +08:00
endpoints list
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
'use client'
|
||||
import { useMemo, useState } from 'react'
|
||||
import type { EndpointListItem, InstalledPlugin } from '../types'
|
||||
import { useMemo } from 'react'
|
||||
import type { InstalledPlugin } from '../types'
|
||||
import type { FilterState } from './filter-management'
|
||||
import FilterManagement from './filter-management'
|
||||
import List from './list'
|
||||
import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel'
|
||||
import { toolNotionEndpoints } from '@/app/components/plugins/plugin-detail-panel/mock'
|
||||
import { usePluginPageContext } from './context'
|
||||
import { useDebounceFn } from 'ahooks'
|
||||
|
||||
@ -13,8 +12,6 @@ const PluginsPanel = () => {
|
||||
const [filters, setFilters] = usePluginPageContext(v => [v.filters, v.setFilters])
|
||||
const pluginList = usePluginPageContext(v => v.installedPluginList) as InstalledPlugin[]
|
||||
const mutateInstalledPluginList = usePluginPageContext(v => v.mutateInstalledPluginList)
|
||||
const currentPluginDetail = usePluginPageContext(v => v.currentPluginDetail)
|
||||
const setCurrentPluginDetail = usePluginPageContext(v => v.setCurrentPluginDetail)
|
||||
|
||||
const { run: handleFilterChange } = useDebounceFn((filters: FilterState) => {
|
||||
setFilters(filters)
|
||||
@ -32,7 +29,6 @@ const PluginsPanel = () => {
|
||||
return filteredList
|
||||
}, [pluginList, filters])
|
||||
|
||||
const [currentPluginEndpoints, setCurrentEndpoints] = useState<EndpointListItem[]>(toolNotionEndpoints as any)
|
||||
return (
|
||||
<>
|
||||
<div className='flex flex-col pt-1 pb-3 px-12 justify-center items-start gap-3 self-stretch'>
|
||||
@ -46,17 +42,7 @@ const PluginsPanel = () => {
|
||||
<List pluginList={filteredList} />
|
||||
</div>
|
||||
</div>
|
||||
<PluginDetailPanel
|
||||
pluginDetail={currentPluginDetail}
|
||||
endpointList={currentPluginEndpoints}
|
||||
onHide={() => {
|
||||
setCurrentPluginDetail(undefined)
|
||||
}}
|
||||
onDelete={() => {
|
||||
setCurrentPluginDetail(undefined)
|
||||
mutateInstalledPluginList()
|
||||
}}
|
||||
/>
|
||||
<PluginDetailPanel onDelete={() => mutateInstalledPluginList()}/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user