mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-01 20:03:30 +02:00
Add front end logic for MCP connectors
This commit is contained in:
parent
792548b379
commit
c78ea98a68
8 changed files with 71 additions and 65 deletions
|
|
@ -164,20 +164,19 @@ export const MCPConnectForm: FC<ConnectFormProps> = ({ onSubmit, isSubmitting })
|
|||
|
||||
isSubmittingRef.current = true;
|
||||
try {
|
||||
// Submit all servers
|
||||
for (const config of configs) {
|
||||
await onSubmit({
|
||||
name: config.name,
|
||||
connector_type: EnumConnectorName.MCP_CONNECTOR,
|
||||
config: { server_config: config },
|
||||
is_indexable: false,
|
||||
is_active: true,
|
||||
last_indexed_at: null,
|
||||
periodic_indexing_enabled: false,
|
||||
indexing_frequency_minutes: null,
|
||||
next_scheduled_at: null,
|
||||
});
|
||||
}
|
||||
// Submit all servers as a single connector with server_configs array
|
||||
// This creates one connector instead of N connectors (one toast instead of N toasts)
|
||||
await onSubmit({
|
||||
name: configs.length === 1 ? configs[0].name : "MCPs",
|
||||
connector_type: EnumConnectorName.MCP_CONNECTOR,
|
||||
config: { server_configs: configs },
|
||||
is_indexable: false,
|
||||
is_active: true,
|
||||
last_indexed_at: null,
|
||||
periodic_indexing_enabled: false,
|
||||
indexing_frequency_minutes: null,
|
||||
next_scheduled_at: null,
|
||||
});
|
||||
} finally {
|
||||
isSubmittingRef.current = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue