mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix: clear stale OAuth fields when switching to non-OAuth preset, show expected tools on empty spec
This commit is contained in:
parent
c96f62d9f4
commit
36829d02ef
2 changed files with 22 additions and 7 deletions
|
|
@ -37,6 +37,11 @@ const OpenAPIFormSection: React.FC<OpenAPIFormSectionProps> = ({
|
|||
updates.auth_type = AUTH_TYPE.OAUTH2;
|
||||
updates.authorization_url = entry.oauth.authorization_url;
|
||||
updates.token_url = entry.oauth.token_url;
|
||||
} else {
|
||||
// Clear stale OAuth config from previous preset selection
|
||||
updates.auth_type = undefined;
|
||||
updates.authorization_url = undefined;
|
||||
updates.token_url = undefined;
|
||||
}
|
||||
form.setFieldsValue(updates);
|
||||
onValuesChange(updates);
|
||||
|
|
|
|||
|
|
@ -396,13 +396,23 @@ const MCPToolConfiguration: React.FC<MCPToolConfigurationProps> = ({
|
|||
)}
|
||||
|
||||
{/* No tools state */}
|
||||
{!isLoadingTools && !toolsError && tools.length === 0 && canFetchTools && (!keyTools || keyTools.length === 0) && (
|
||||
<div className="text-center py-6 text-gray-400 border rounded-lg border-dashed">
|
||||
<ToolOutlined className="text-2xl mb-2" />
|
||||
<Text>No tools available for configuration</Text>
|
||||
<br />
|
||||
<Text className="text-sm">Connect to an MCP server with tools to configure them</Text>
|
||||
</div>
|
||||
{!isLoadingTools && !toolsError && tools.length === 0 && canFetchTools && (
|
||||
keyTools && keyTools.length > 0 ? (
|
||||
<div className="text-center py-4 text-gray-400 border rounded-lg border-dashed">
|
||||
<ToolOutlined className="text-2xl mb-2" />
|
||||
<Text>No tools loaded from spec</Text>
|
||||
<Text className="text-sm block mt-1">
|
||||
Expected tools: {keyTools.map((t) => t.name).join(", ")}
|
||||
</Text>
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-center py-6 text-gray-400 border rounded-lg border-dashed">
|
||||
<ToolOutlined className="text-2xl mb-2" />
|
||||
<Text>No tools available for configuration</Text>
|
||||
<br />
|
||||
<Text className="text-sm">Connect to an MCP server with tools to configure them</Text>
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
|
||||
{/* Incomplete form state */}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue