AgentSideDrawer.vue
1 <script setup lang="ts"> 2 import { useAgentStore } from '@/renderer/store/agent' 3 import { useMcpStore } from '@/renderer/store/mcp' 4 const mcpStore = useMcpStore() 5 const agentStore = useAgentStore() 6 7 function handleDelete(index: number, event: MouseEvent) { 8 event.stopPropagation() 9 agentStore.agents.splice(index, 1) 10 } 11 </script> 12 13 <template> 14 <v-list :key="mcpStore.version" v-model:selected="agentStore.revised" nav mandatory> 15 <v-list-item 16 v-for="(item, index) in agentStore.agents" 17 :key="index" 18 slim 19 :value="index" 20 link 21 :ripple="false" 22 :title="item.name" 23 @click="console.log(agentStore.getRevised?.selectedNode)" 24 > 25 <template #prepend> 26 <v-badge 27 class="mr-n3" 28 :color="agentStore.hasTools ? 'primary' : 'grey'" 29 :content="item.selectedNode.length" 30 inline 31 :max="99" 32 ></v-badge> 33 </template> 34 <template #append> 35 <v-list-item-action> 36 <v-icon-btn 37 class="mr-1" 38 color="error" 39 variant="plain" 40 icon="mdi-delete-outline" 41 rounded="lg" 42 size="small" 43 @click="handleDelete(index, $event)" 44 > 45 </v-icon-btn> 46 </v-list-item-action> 47 </template> 48 </v-list-item> 49 </v-list> 50 </template> 51 52 <style></style>