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
|
|
@ -130,6 +130,12 @@ export const ActiveConnectorsTab: FC<ActiveConnectorsTabProps> = ({
|
|||
(c) => !oauthConnectorTypes.has(c.connector_type) && c.connector_type !== "MCP_CONNECTOR"
|
||||
);
|
||||
|
||||
// Calculate total number of MCP servers across all MCP connectors
|
||||
const totalMCPServers = mcpConnectors.reduce((total, connector) => {
|
||||
const serverConfigs = connector.config?.server_configs;
|
||||
return total + (Array.isArray(serverConfigs) ? serverConfigs.length : 0);
|
||||
}, 0);
|
||||
|
||||
// Group OAuth connectors by type
|
||||
const oauthConnectorsByType = oauthConnectors.reduce(
|
||||
(acc, connector) => {
|
||||
|
|
@ -305,7 +311,7 @@ export const ActiveConnectorsTab: FC<ActiveConnectorsTabProps> = ({
|
|||
Active
|
||||
</p>
|
||||
<p className="text-[10px] text-muted-foreground mt-0.5">
|
||||
{mcpConnectors.length} {mcpConnectors.length === 1 ? "Server" : "Servers"}
|
||||
{totalMCPServers} {totalMCPServers === 1 ? "Server" : "Servers"}
|
||||
</p>
|
||||
</div>
|
||||
<Button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue