Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
cf77a891
Commit
cf77a891
authored
Mar 01, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: dasetitem ui
parent
1b73632f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
dataset-item.tsx
...low/nodes/knowledge-retrieval/components/dataset-item.tsx
+36
-2
dataset-list.tsx
...low/nodes/knowledge-retrieval/components/dataset-list.tsx
+1
-1
use-config.ts
...mponents/workflow/nodes/knowledge-retrieval/use-config.ts
+0
-1
No files found.
web/app/components/workflow/nodes/knowledge-retrieval/components/dataset-item.tsx
View file @
cf77a891
...
...
@@ -2,6 +2,10 @@
import
type
{
FC
}
from
'react'
import
React
from
'react'
import
type
{
DataSet
}
from
'@/models/datasets'
import
{
DataSourceType
}
from
'@/models/datasets'
import
{
Settings01
,
Trash03
}
from
'@/app/components/base/icons/src/vender/line/general'
import
FileIcon
from
'@/app/components/base/file-icon'
import
{
Folder
}
from
'@/app/components/base/icons/src/vender/solid/files'
type
Props
=
{
payload
:
DataSet
...
...
@@ -13,8 +17,38 @@ const DatasetItem: FC<Props> = ({
onRemove
,
})
=>
{
return
(
<
div
>
{
payload
.
name
}
<
div
className=
'flex items-center h-10 justify-between rounded-xl px-2 bg-white border border-gray-200 cursor-pointer group-[dataset-item]'
>
<
div
className=
'w-0 grow flex items-center space-x-1.5'
>
{
payload
.
data_source_type
===
DataSourceType
.
FILE
&&
(
<
div
className=
'shrink-0 flex items-center justify-center w-6 h-6 bg-[#F5F8FF] rounded-md border-[0.5px] border-[#E0EAFF]'
>
<
Folder
className=
'w-4 h-4 text-[#444CE7]'
/>
</
div
>
)
}
{
payload
.
data_source_type
===
DataSourceType
.
NOTION
&&
(
<
div
className=
'shrink-0 flex items-center justify-center w-6 h-6 rounded-md border-[0.5px] border-[#EAECF5]'
>
<
FileIcon
type=
'notion'
className=
'w-4 h-4'
/>
</
div
>
)
}
<
div
className=
'w-0 grow text-[13px] font-normal text-gray-800 truncate'
>
{
payload
.
name
}
</
div
>
</
div
>
<
div
className=
'shrink-0 ml-2 flex items-center space-x-1'
>
<
div
className=
'flex items-center justify-center w-6 h-6 hover:bg-black/5 rounded-md cursor-pointer'
// onClick={() => setShowSettingsModal(true)}
>
<
Settings01
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
<
div
className=
'flex items-center justify-center w-6 h-6 hover:bg-black/5 rounded-md cursor-pointer'
onClick=
{
onRemove
}
>
<
Trash03
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
</
div
>
</
div
>
)
}
...
...
web/app/components/workflow/nodes/knowledge-retrieval/components/dataset-list.tsx
View file @
cf77a891
...
...
@@ -22,7 +22,7 @@ const DatasetList: FC<Props> = ({
}
},
[])
return
(
<
div
>
<
div
className=
'space-y-1'
>
{
list
.
map
((
item
,
index
)
=>
{
return
(
...
...
web/app/components/workflow/nodes/knowledge-retrieval/use-config.ts
View file @
cf77a891
...
...
@@ -37,7 +37,6 @@ const useConfig = (initInputs: KnowledgeRetrievalNodeType) => {
if
(
datasetIds
?.
length
>
0
)
{
const
{
data
:
dataSetsWithDetail
}
=
await
fetchDatasets
({
url
:
'/datasets'
,
params
:
{
page
:
1
,
ids
:
datasetIds
}
})
setSelectedDatasets
(
dataSetsWithDetail
)
console
.
log
(
dataSetsWithDetail
)
}
})()
},
[])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment