fix: 修复网页 MCP 选择顺序的问题

This commit is contained in:
Wenjie Zhang 2026-03-19 04:19:55 +08:00
parent 6a30936a49
commit 0bd6b24988
2 changed files with 13 additions and 3 deletions

View File

@ -31,6 +31,7 @@
.search-box { .search-box {
padding: 12px 12px 0; padding: 12px 12px 0;
.search-input :deep(.ant-input) { .search-input :deep(.ant-input) {
height: 28px; height: 28px;
} }
@ -93,10 +94,12 @@
} }
&.active { &.active {
.item-icon, .item-icon,
.server-icon { .server-icon {
color: var(--main-color); color: var(--main-color);
} }
.item-name { .item-name {
color: var(--gray-900); color: var(--gray-900);
} }
@ -126,8 +129,10 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: @bg-secondary; background-color: @bg-secondary;
.hint-box { .hint-box {
text-align: center; text-align: center;
p { p {
margin-top: 12px; margin-top: 12px;
color: var(--gray-400); color: var(--gray-400);
@ -167,6 +172,7 @@
padding: 0 16px; padding: 0 16px;
flex-shrink: 0; flex-shrink: 0;
border-bottom: 1px solid @border-color; border-bottom: 1px solid @border-color;
&::before { &::before {
border-bottom: none; border-bottom: none;
} }
@ -197,6 +203,7 @@
.text-muted { .text-muted {
color: var(--gray-400); color: var(--gray-400);
} }
.empty-text { .empty-text {
padding: 40px 0; padding: 40px 0;
text-align: center; text-align: center;
@ -206,9 +213,11 @@
// Spin wrapper for full height // Spin wrapper for full height
.full-height-spin { .full-height-spin {
height: 100%; height: 100%;
:deep(.ant-spin-nested-loading) { :deep(.ant-spin-nested-loading) {
height: 100%; height: 100%;
} }
:deep(.ant-spin-container) { :deep(.ant-spin-container) {
height: 100%; height: 100%;
display: flex; display: flex;
@ -240,6 +249,7 @@
0% { 0% {
left: -30%; left: -30%;
} }
100% { 100% {
left: 100%; left: 100%;
} }
@ -249,4 +259,4 @@
opacity: 0.6; opacity: 0.6;
pointer-events: none; pointer-events: none;
transition: opacity 0.2s; transition: opacity 0.2s;
} }

View File

@ -574,9 +574,9 @@ const fetchServers = async () => {
const result = await mcpApi.getMcpServers() const result = await mcpApi.getMcpServers()
if (result.success) { if (result.success) {
servers.value = result.data || [] servers.value = result.data || []
// //
if (!currentServer.value && servers.value.length > 0) { if (!currentServer.value && servers.value.length > 0) {
selectServer(servers.value[0]) selectServer(filteredServers.value[0])
} else if (currentServer.value) { } else if (currentServer.value) {
const latest = servers.value.find((s) => s.name === currentServer.value.name) const latest = servers.value.find((s) => s.name === currentServer.value.name)
if (latest) { if (latest) {