| 1 | <template> |
| 2 | <n-button :size type="primary" secondary @click.stop="showForm = true"> |
| 3 | <template #icon> |
| 4 | <Icon :name="AttackIcon" /> |
| 5 | </template> |
| 6 | Simulate Attack |
| 7 | </n-button> |
| 8 | |
| 9 | <n-modal |
| 10 | v-model:show="showForm" |
| 11 | display-directive="show" |
| 12 | preset="card" |
| 13 | :style="{ maxWidth: 'min(600px, 90vw)', minHeight: 'min(250px, 90vh)', overflow: 'hidden' }" |
| 14 | :title="`${techniqueId}: Simulate Attack`" |
| 15 | :bordered="false" |
| 16 | segmented |
| 17 | content-class="p-0!" |
| 18 | > |
| 19 | <SimulatorWizard :technique-id :os-list="checkedOsList" /> |
| 20 | </n-modal> |
| 21 | </template> |
| 22 | |
| 23 | <script setup lang="ts"> |
| 24 | import type { ButtonSize } from "naive-ui" |
| 25 | import { NButton, NModal } from "naive-ui" |
| 26 | import { computed, ref } from "vue" |
| 27 | import Icon from "@/components/common/Icon.vue" |
| 28 | import SimulatorWizard from "./SimulatorWizard.vue" |
| 29 | |
| 30 | const { size, techniqueId, osList } = defineProps<{ size?: ButtonSize; techniqueId: string; osList: string[] }>() |
| 31 | |
| 32 | const AttackIcon = "mdi:target" |
| 33 | const showForm = ref(false) |
| 34 | |
| 35 | const checkedOsList = computed(() => (osList?.length ? osList.filter(o => o.toLowerCase() !== "macos") : [])) |
| 36 | </script> |