|
@@ -5,7 +5,7 @@ import { useBoolean } from 'ahooks'
|
|
|
import { useContext } from 'use-context-selector'
|
|
|
import { useRouter } from 'next/navigation'
|
|
|
import DatasetDetailContext from '@/context/dataset-detail'
|
|
|
-import type { FullDocumentDetail } from '@/models/datasets'
|
|
|
+import type { CrawlOptions, CustomFile, FullDocumentDetail } from '@/models/datasets'
|
|
|
import type { MetadataType } from '@/service/datasets'
|
|
|
import { fetchDocumentDetail } from '@/service/datasets'
|
|
|
|
|
@@ -15,6 +15,7 @@ import AccountSetting from '@/app/components/header/account-setting'
|
|
|
import AppUnavailable from '@/app/components/base/app-unavailable'
|
|
|
import { useDefaultModel } from '@/app/components/header/account-setting/model-provider-page/hooks'
|
|
|
import { ModelTypeEnum } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
|
|
+import type { NotionPage } from '@/models/common'
|
|
|
|
|
|
type DocumentSettingsProps = {
|
|
|
datasetId: string
|
|
@@ -40,7 +41,7 @@ const DocumentSettings = ({ datasetId, documentId }: DocumentSettingsProps) => {
|
|
|
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,
|
|
|
+ type: documentDetail?.data_source_type,
|
|
|
}
|
|
|
}, [documentDetail])
|
|
|
useEffect(() => {
|
|
@@ -72,7 +73,7 @@ const DocumentSettings = ({ datasetId, documentId }: DocumentSettingsProps) => {
|
|
|
onSetting={showSetAPIKey}
|
|
|
datasetId={datasetId}
|
|
|
dataSourceType={documentDetail.data_source_type}
|
|
|
- notionPages={[currentPage]}
|
|
|
+ notionPages={[currentPage as unknown as NotionPage]}
|
|
|
websitePages={[
|
|
|
{
|
|
|
title: documentDetail.name,
|
|
@@ -81,12 +82,13 @@ const DocumentSettings = ({ datasetId, documentId }: DocumentSettingsProps) => {
|
|
|
description: '',
|
|
|
},
|
|
|
]}
|
|
|
- fireCrawlJobId={documentDetail.data_source_info?.job_id}
|
|
|
- crawlOptions={documentDetail.data_source_info}
|
|
|
+ websiteCrawlProvider={documentDetail.data_source_info?.provider}
|
|
|
+ websiteCrawlJobId={documentDetail.data_source_info?.job_id}
|
|
|
+ crawlOptions={documentDetail.data_source_info as unknown as CrawlOptions}
|
|
|
indexingType={indexingTechnique || ''}
|
|
|
isSetting
|
|
|
documentDetail={documentDetail}
|
|
|
- files={[documentDetail.data_source_info.upload_file]}
|
|
|
+ files={[documentDetail.data_source_info.upload_file as CustomFile]}
|
|
|
onSave={saveHandler}
|
|
|
onCancel={cancelHandler}
|
|
|
/>
|