{websiteProviderName}
-- {t(($) => $['newKnowledge.providerUnavailable'])} -
- {websiteProviderName !== 'FakeCrawler' && ( - - )} -{websiteProviderName}
@@ -1462,7 +1404,7 @@ export function AddSourcePage({ onConnected={rememberConnection} onConfigureManagedProvider={() => globalThis.open( - websiteProviderIntegrationPath(websiteProviderName), + websiteProviderIntegrationPath(websiteProviderOption), '_blank', 'noopener,noreferrer', ) @@ -1470,6 +1412,7 @@ export function AddSourcePage({ onDraftChange={setConnectionDraftDirty} onReconcile={reconcileConnection} provider={provider} + providerOption={datasourceProvider} providerName={websiteProviderName} /> )} diff --git a/web/features/new-rag/connected-source-setup.tsx b/web/features/new-rag/connected-source-setup.tsx index bcd5d3d513c..25eacd3cbb2 100644 --- a/web/features/new-rag/connected-source-setup.tsx +++ b/web/features/new-rag/connected-source-setup.tsx @@ -5,13 +5,12 @@ import type { KnowledgeFsSourcePageResponse, } from '@dify/contracts/api/console/knowledge-fs/types.gen' import type { - NewKnowledgeOnlineDocumentsProvider, NewKnowledgeOnlineDocumentsSourceDraft, - NewKnowledgeOnlineDriveProvider, NewKnowledgeOnlineDriveSourceDraft, NewKnowledgeSourceDraft, } from './routes' import type { Source, SourceConnection, SourceProvider } from './source-models' +import type { InstalledSourceProviderOption, SourceProviderOption } from './source-provider-options' import type { DataSourceAuth, DataSourceCredential, @@ -39,9 +38,15 @@ import { sourceProviderListFromApi, sourceSyncPolicyFromApi, } from './source-models' +import { + discoverSourceProviderOptions, + normalizeSourceProviderName, + sourceProviderOptionForDraft, +} from './source-provider-options' import { SourceConnectionRequiredCard, SourceNameField, + SourceProviderNotInstalledCard, SourceProviderRadioGroup, SourceSyncPolicyField, } from './source-setup-fields' @@ -96,73 +101,25 @@ const CONNECTION_STATUS_PRIORITY: Record