main
vue 59 lines 1.75 KB
Raw
1 <template>
2 <div>
3 <CardEntity embedded clickable hoverable size="small" @click="showDetails = true">
4 <template #header>
5 <div class="flex items-start justify-between gap-4">
6 <div>
7 {{ entity.technique_id }}
8 <span class="text-default">{{ entity.technique_name }}</span>
9 </div>
10
11 <div class="flex items-center gap-2 whitespace-nowrap">
12 <n-tooltip>
13 <template #trigger>
14 <Icon name="carbon:time" :size="16" />
15 </template>
16 <div class="flex flex-wrap gap-2 text-xs">
17 <span class="text-secondary">last seen:</span>
18 <span>{{ formatDate(entity.last_seen, dFormats.datetimesec) }}</span>
19 </div>
20 </n-tooltip>
21 <code>
22 {{ entity.count }}
23 </code>
24 </div>
25 </div>
26 </template>
27 </CardEntity>
28 <n-modal
29 v-model:show="showDetails"
30 display-directive="show"
31 preset="card"
32 content-class="p-0!"
33 :style="{ maxWidth: 'min(900px, 90vw)', minHeight: 'min(600px, 90vh)', overflow: 'hidden' }"
34 :title="`${entity.technique_id} • ${entity.technique_name}`"
35 :bordered="false"
36 segmented
37 >
38 <TechniqueAlertOverview :external-id="entity.technique_id" />
39 </n-modal>
40 </div>
41 </template>
42
43 <script setup lang="ts">
44 import type { MitreTechnique } from "@/types/mitre.d"
45 import { NModal, NTooltip } from "naive-ui"
46 import { ref } from "vue"
47 import CardEntity from "@/components/common/cards/CardEntity.vue"
48 import Icon from "@/components/common/Icon.vue"
49 import { useSettingsStore } from "@/stores/settings"
50 import { formatDate } from "@/utils/format"
51 import TechniqueAlertOverview from "./TechniqueAlertOverview.vue"
52
53 const { entity } = defineProps<{
54 entity: MitreTechnique
55 }>()
56
57 const dFormats = useSettingsStore().dateFormat
58 const showDetails = ref(false)
59 </script>