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
c6918fbc
Commit
c6918fbc
authored
Jun 14, 2023
by
jyong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/feat/dataset-notion-import' into feat/dataset-notion-import
parents
110b5b01
10b96886
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
8 deletions
+16
-8
index.tsx
web/app/components/datasets/create/step-two/index.tsx
+1
-4
index.tsx
...p/components/datasets/documents/detail/settings/index.tsx
+12
-1
datasets.ts
web/service/datasets.ts
+3
-3
No files found.
web/app/components/datasets/create/step-two/index.tsx
View file @
c6918fbc
...
@@ -310,10 +310,7 @@ const StepTwo = ({
...
@@ -310,10 +310,7 @@ const StepTwo = ({
body
:
params
,
body
:
params
,
})
})
updateIndexingTypeCache
&&
updateIndexingTypeCache
(
indexType
)
updateIndexingTypeCache
&&
updateIndexingTypeCache
(
indexType
)
updateResultCache
&&
updateResultCache
({
updateResultCache
&&
updateResultCache
(
res
)
batch
:
res
.
batch
,
documents
:
[
res
],
})
}
}
onStepChange
&&
onStepChange
(
+
1
)
onStepChange
&&
onStepChange
(
+
1
)
isSetting
&&
onSave
&&
onSave
()
isSetting
&&
onSave
&&
onSave
()
...
...
web/app/components/datasets/documents/detail/settings/index.tsx
View file @
c6918fbc
'use client'
'use client'
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
,
{
useEffect
,
use
Memo
,
use
State
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
import
{
useBoolean
}
from
'ahooks'
import
{
useBoolean
}
from
'ahooks'
import
{
useContext
}
from
'use-context-selector'
import
{
useContext
}
from
'use-context-selector'
...
@@ -43,6 +43,15 @@ const DocumentSettings = ({ datasetId, documentId }: DocumentSettingsProps) => {
...
@@ -43,6 +43,15 @@ const DocumentSettings = ({ datasetId, documentId }: DocumentSettingsProps) => {
},
[])
},
[])
const
[
documentDetail
,
setDocumentDetail
]
=
useState
<
FullDocumentDetail
|
null
>
(
null
)
const
[
documentDetail
,
setDocumentDetail
]
=
useState
<
FullDocumentDetail
|
null
>
(
null
)
const
currentPage
=
useMemo
(()
=>
{
return
{
workspace_id
:
documentDetail
?.
data_source_info
.
notion_workspace_id
,
page_id
:
documentDetail
?.
data_source_info
.
notion_page_id
,
page_name
:
documentDetail
?.
name
,
page_icon
:
documentDetail
?.
data_source_info
.
notion_page_icon
,
type
:
documentDetail
?.
data_source_info
.
type
,
}
},
[
documentDetail
])
useEffect
(()
=>
{
useEffect
(()
=>
{
(
async
()
=>
{
(
async
()
=>
{
try
{
try
{
...
@@ -71,6 +80,8 @@ const DocumentSettings = ({ datasetId, documentId }: DocumentSettingsProps) => {
...
@@ -71,6 +80,8 @@ const DocumentSettings = ({ datasetId, documentId }: DocumentSettingsProps) => {
hasSetAPIKEY=
{
hasSetAPIKEY
}
hasSetAPIKEY=
{
hasSetAPIKEY
}
onSetting=
{
showSetAPIKey
}
onSetting=
{
showSetAPIKey
}
datasetId=
{
datasetId
}
datasetId=
{
datasetId
}
dataSourceType=
{
documentDetail
.
data_source_type
}
notionPages=
{
[
currentPage
]
}
indexingType=
{
indexingTechnique
||
''
}
indexingType=
{
indexingTechnique
||
''
}
isSetting
isSetting
documentDetail=
{
documentDetail
}
documentDetail=
{
documentDetail
}
...
...
web/service/datasets.ts
View file @
c6918fbc
import
type
{
Fetcher
}
from
'swr'
import
type
{
Fetcher
}
from
'swr'
import
qs
from
'qs'
import
qs
from
'qs'
import
{
del
,
get
,
patch
,
post
,
put
}
from
'./base'
import
{
del
,
get
,
patch
,
post
,
put
}
from
'./base'
import
type
{
CreateDocumentReq
,
DataSet
,
DataSetListResponse
,
DocumentDetailResponse
,
DocumentListResponse
,
FileIndexingEstimateResponse
,
HitTestingRecordsResponse
,
HitTestingResponse
,
IndexingEstimateResponse
,
IndexingStatusBatchResponse
,
IndexingStatusResponse
,
InitialDocumentDetail
,
ProcessRuleResponse
,
RelatedAppResponse
,
SegmentsQuery
,
SegmentsResponse
,
createDocumentResponse
}
from
'@/models/datasets'
import
type
{
CreateDocumentReq
,
DataSet
,
DataSetListResponse
,
DocumentDetailResponse
,
DocumentListResponse
,
FileIndexingEstimateResponse
,
HitTestingRecordsResponse
,
HitTestingResponse
,
IndexingEstimateResponse
,
IndexingStatusBatchResponse
,
IndexingStatusResponse
,
ProcessRuleResponse
,
RelatedAppResponse
,
SegmentsQuery
,
SegmentsResponse
,
createDocumentResponse
}
from
'@/models/datasets'
import
type
{
CommonResponse
,
DataSourceNotionWorkspace
}
from
'@/models/common'
import
type
{
CommonResponse
,
DataSourceNotionWorkspace
}
from
'@/models/common'
// apis for documents in a dataset
// apis for documents in a dataset
...
@@ -60,8 +60,8 @@ export const createFirstDocument: Fetcher<createDocumentResponse, { body: Create
...
@@ -60,8 +60,8 @@ export const createFirstDocument: Fetcher<createDocumentResponse, { body: Create
return
post
(
'/datasets/init'
,
{
body
})
as
Promise
<
createDocumentResponse
>
return
post
(
'/datasets/init'
,
{
body
})
as
Promise
<
createDocumentResponse
>
}
}
export
const
createDocument
:
Fetcher
<
InitialDocumentDetail
,
{
datasetId
:
string
;
body
:
CreateDocumentReq
}
>
=
({
datasetId
,
body
})
=>
{
export
const
createDocument
:
Fetcher
<
createDocumentResponse
,
{
datasetId
:
string
;
body
:
CreateDocumentReq
}
>
=
({
datasetId
,
body
})
=>
{
return
post
(
`/datasets/
${
datasetId
}
/documents`
,
{
body
})
as
Promise
<
InitialDocumentDetail
>
return
post
(
`/datasets/
${
datasetId
}
/documents`
,
{
body
})
as
Promise
<
createDocumentResponse
>
}
}
export
const
fetchIndexingEstimate
:
Fetcher
<
IndexingEstimateResponse
,
CommonDocReq
>
=
({
datasetId
,
documentId
})
=>
{
export
const
fetchIndexingEstimate
:
Fetcher
<
IndexingEstimateResponse
,
CommonDocReq
>
=
({
datasetId
,
documentId
})
=>
{
...
...
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