/ src / renderer / components / pages / McpConfigPage.vue
McpConfigPage.vue
 1  <script setup lang="ts">
 2  import { computed } from 'vue'
 3  import { useMcpStore } from '@/renderer/store/mcp'
 4  
 5  import ConfigStdioCard from '../common/ConfigStdioCard.vue'
 6  import ConfigDxtCard from '../common/ConfigDxtCard.vue'
 7  const mcpStore = useMcpStore()
 8  
 9  const configString = computed(() => mcpStore.getSelected.method)
10  const configJson = computed(() => JSON.parse(configString.value))
11  
12  const configObject = computed(() => ({
13    string: configString.value,
14    json: configJson.value
15  }))
16  </script>
17  
18  <template>
19    <ConfigStdioCard
20      v-if="configObject.json.type === 'metadata__stdio_config'"
21      :model-value="configObject.json"
22    ></ConfigStdioCard>
23    <ConfigDxtCard
24      v-else-if="configObject.json.type === 'metadata__mcpb_manifest'"
25      :model-value="configObject.json"
26    ></ConfigDxtCard>
27    <div v-else>{{ configObject }}</div>
28  </template>