增加拖拽添加连接的功能

This commit is contained in:
锦恢 2025-05-22 16:11:16 +08:00
parent 78634e6327
commit bca49f01de
2 changed files with 2 additions and 4 deletions

View File

@ -109,7 +109,6 @@ function handleDrop(event: DragEvent) {
client.value.connectionArgs.connectionType = 'STDIO'; client.value.connectionArgs.connectionType = 'STDIO';
client.value.connectionArgs.commandString = command; client.value.connectionArgs.commandString = command;
client.value.connectionArgs.cwd = cwd; client.value.connectionArgs.cwd = cwd;
client.value.handleEnvSwitch(true);
} }
isDraging.value = false; isDraging.value = false;

View File

@ -49,7 +49,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { defineComponent, computed } from 'vue'; import { defineComponent, computed, reactive } from 'vue';
import ConnectionPanel from './connection-panel.vue'; import ConnectionPanel from './connection-panel.vue';
import { McpClient, mcpClientAdapter } from './core'; import { McpClient, mcpClientAdapter } from './core';
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
@ -61,9 +61,8 @@ function selectServer(index: number) {
mcpClientAdapter.currentClientIndex = index; mcpClientAdapter.currentClientIndex = index;
} }
function addServer() { function addServer() {
const client = new McpClient(); const client = reactive(new McpClient());
mcpClientAdapter.clients.push(client); mcpClientAdapter.clients.push(client);
mcpClientAdapter.currentClientIndex = mcpClientAdapter.clients.length - 1; mcpClientAdapter.currentClientIndex = mcpClientAdapter.clients.length - 1;