<template>
  <v-card v-if="count > 0" class="mx-4 mb-2" color="primary" variant="tonal" rounded="lg">
    <v-card-text class="d-flex align-center py-2 flex-wrap ga-1">
      <span class="text-body-2 mr-4">已选择 {{ count }} 台服务器</span>
      <v-spacer />
      <v-btn size="small" variant="text" @click="$emit('batch-category')">修改分类</v-btn>
      <v-btn size="small" variant="text" @click="$emit('health-check')">健康检查</v-btn>
      <v-btn size="small" variant="text" @click="$emit('detect-path')">检测目标路径</v-btn>
      <v-btn size="small" variant="text" @click="$emit('install-agent')">安装Agent</v-btn>
      <v-btn size="small" variant="text" @click="$emit('upgrade-agent')">升级Agent</v-btn>
      <v-btn size="small" variant="text" color="error" @click="$emit('uninstall-agent')">卸载Agent</v-btn>
      <v-btn size="small" variant="text" color="error" @click="$emit('batch-delete')">批量删除</v-btn>
      <v-btn size="small" variant="text" @click="$emit('clear')">取消选择</v-btn>
    </v-card-text>
  </v-card>
</template>

<script setup lang="ts">
defineProps<{
  count: number
}>()

defineEmits<{
  'batch-category': []
  'health-check': []
  'detect-path': []
  'install-agent': []
  'upgrade-agent': []
  'uninstall-agent': []
  'batch-delete': []
  clear: []
}>()
</script>
