feat: enhance MCPSettings with server table and clean up NpxSearch component
- Added a debug log for MCP servers in MCPSettings. - Refactored the MCPSettings component to streamline the server table rendering. - Removed unnecessary styles from the NpxSearch component for cleaner layout.
This commit is contained in:
parent
07199d0ed6
commit
187726ae8d
@ -67,7 +67,7 @@ const NpxSearch: FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SettingGroup theme={theme} style={{ marginTop: 15 }}>
|
<SettingGroup theme={theme}>
|
||||||
<SettingTitle>{t('settings.mcp.npx_list.title')}</SettingTitle>
|
<SettingTitle>{t('settings.mcp.npx_list.title')}</SettingTitle>
|
||||||
<SettingDivider />
|
<SettingDivider />
|
||||||
<Paragraph type="secondary" style={{ margin: '0 0 10px 0' }}>
|
<Paragraph type="secondary" style={{ margin: '0 0 10px 0' }}>
|
||||||
|
|||||||
@ -19,6 +19,8 @@ const MCPSettings: FC = () => {
|
|||||||
const { Paragraph, Text } = Typography
|
const { Paragraph, Text } = Typography
|
||||||
const mcpServers = useAppSelector((state) => state.mcp.servers)
|
const mcpServers = useAppSelector((state) => state.mcp.servers)
|
||||||
|
|
||||||
|
console.debug(mcpServers)
|
||||||
|
|
||||||
const handleDelete = (serverName: string) => {
|
const handleDelete = (serverName: string) => {
|
||||||
window.modal.confirm({
|
window.modal.confirm({
|
||||||
title: t('settings.mcp.confirmDelete'),
|
title: t('settings.mcp.confirmDelete'),
|
||||||
@ -145,24 +147,18 @@ const MCPSettings: FC = () => {
|
|||||||
{t('settings.mcp.editJson')}
|
{t('settings.mcp.editJson')}
|
||||||
</Button>
|
</Button>
|
||||||
</HStack>
|
</HStack>
|
||||||
|
<Table
|
||||||
|
dataSource={mcpServers}
|
||||||
|
columns={columns}
|
||||||
|
rowKey="name"
|
||||||
|
pagination={false}
|
||||||
|
size="small"
|
||||||
|
locale={{ emptyText: t('settings.mcp.noServers') }}
|
||||||
|
rowClassName={(record) => (!record.isActive ? 'inactive-row' : '')}
|
||||||
|
onRow={(record) => ({ style: !record.isActive ? inactiveRowStyle : {} })}
|
||||||
|
style={{ marginTop: 15 }}
|
||||||
|
/>
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
<Table
|
|
||||||
dataSource={mcpServers}
|
|
||||||
columns={columns}
|
|
||||||
rowKey="name"
|
|
||||||
pagination={false}
|
|
||||||
size="small"
|
|
||||||
locale={{ emptyText: t('settings.mcp.noServers') }}
|
|
||||||
rowClassName={(record) => (!record.isActive ? 'inactive-row' : '')}
|
|
||||||
onRow={(record) => ({
|
|
||||||
style: !record.isActive ? inactiveRowStyle : {}
|
|
||||||
})}
|
|
||||||
style={{
|
|
||||||
borderRadius: '8px',
|
|
||||||
overflow: 'hidden',
|
|
||||||
border: '0.5px solid var(--color-border)'
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<NpxSearch />
|
<NpxSearch />
|
||||||
</SettingContainer>
|
</SettingContainer>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user