| 1 | <template> |
| 2 | <div> |
| 3 | <CardEntity hoverable clickable :embedded class="@container" @click.stop="showDetails = true"> |
| 4 | <template #headerMain>#{{ entity.technique_id }}</template> |
| 5 | <template #headerExtra> |
| 6 | test count: |
| 7 | <code>{{ entity.test_count }}</code> |
| 8 | </template> |
| 9 | <template #default>{{ entity.technique_name }}</template> |
| 10 | <template #footerMain> |
| 11 | <div class="flex flex-wrap items-center gap-3"> |
| 12 | <Badge v-if="entity.has_prerequisites" color="primary" type="splitted"> |
| 13 | <template #label>has prerequisites</template> |
| 14 | </Badge> |
| 15 | |
| 16 | <Badge v-for="cat of entity.categories" :key="cat" color="primary"> |
| 17 | <template #iconLeft><Icon :name="iconFromOs(cat)" :size="14" /></template> |
| 18 | <template #value>{{ cat }}</template> |
| 19 | </Badge> |
| 20 | </div> |
| 21 | </template> |
| 22 | <template #footerExtra> |
| 23 | <SimulatorButton :technique-id="entity.technique_id" size="small" :os-list="entity.categories" /> |
| 24 | </template> |
| 25 | </CardEntity> |
| 26 | |
| 27 | <n-modal |
| 28 | v-model:show="showDetails" |
| 29 | preset="card" |
| 30 | :style="{ maxWidth: 'min(800px, 90vw)', minHeight: 'min(600px, 90vh)', overflow: 'hidden' }" |
| 31 | :title="`Technique: ${entity.technique_name}`" |
| 32 | :bordered="false" |
| 33 | segmented |
| 34 | > |
| 35 | <TechniqueCardContent :technique-id="entity.technique_id" /> |
| 36 | </n-modal> |
| 37 | </div> |
| 38 | </template> |
| 39 | |
| 40 | <script setup lang="ts"> |
| 41 | import type { MitreAtomicTest } from "@/types/mitre.d" |
| 42 | import { NModal } from "naive-ui" |
| 43 | import { ref } from "vue" |
| 44 | import Badge from "@/components/common/Badge.vue" |
| 45 | import CardEntity from "@/components/common/cards/CardEntity.vue" |
| 46 | import Icon from "@/components/common/Icon.vue" |
| 47 | import { iconFromOs } from "@/utils" |
| 48 | import SimulatorButton from "../AttackSimulator/SimulatorButton.vue" |
| 49 | import TechniqueCardContent from "./TechniqueCardContent.vue" |
| 50 | |
| 51 | const { entity } = defineProps<{ entity: MitreAtomicTest; embedded?: boolean }>() |
| 52 | |
| 53 | const showDetails = ref(false) |
| 54 | </script> |