main
vue 140 lines 5.07 KB
Raw
1 <template>
2 <div ref="page" class="page @container">
3 <!-- Add version banner at the top -->
4 <div class="section">
5 <VersionUpdateBanner />
6 </div>
7
8 <div class="section flex justify-end gap-3 @[70rem]:justify-between">
9 <div class="left-box hidden gap-3 @[70rem]:flex">
10 <StackProvisioningButton size="small" type="primary" secondary />
11 <CloudSecurityAssessmentButton size="small" type="primary" secondary />
12 <WebVulnerabilityAssessmentButton size="small" type="primary" secondary />
13 <GitHubAuditButton size="small" type="primary" secondary />
14 </div>
15 <div class="right-box hidden gap-3 @[70rem]:flex">
16 <ActiveResponseWizardButton size="small" type="primary" secondary />
17 <ThreatIntelButton size="small" type="primary" secondary />
18 </div>
19 <div class="mobile-box block @[70rem]:hidden">
20 <n-button size="small" type="primary" secondary @click="showQuickActions = true">
21 <template #icon>
22 <Icon :name="QuickActionsIcon" />
23 </template>
24 Quick Actions
25 </n-button>
26 </div>
27 </div>
28 <div class="section">
29 <div class="grid grid-flow-row-dense grid-cols-12 gap-6">
30 <div class="xs:col-span-12 col-span-12 sm:col-span-4 min-[75rem]:col-span-2">
31 <AgentsCard class="h-full" />
32 </div>
33 <div class="xs:col-span-6 col-span-12 sm:col-span-4 min-[75rem]:col-span-2">
34 <HealthcheckCard class="h-full" />
35 </div>
36 <div class="xs:col-span-6 col-span-12 sm:col-span-4 min-[75rem]:col-span-2">
37 <CustomersCard class="h-full" />
38 </div>
39 <div class="col-span-12 sm:col-span-6 min-[75rem]:col-span-3">
40 <IncidentAlerts class="h-full" />
41 </div>
42 <div class="col-span-12 sm:col-span-6 min-[75rem]:col-span-3">
43 <IncidentCases class="h-full" />
44 </div>
45 </div>
46 </div>
47 <div class="section">
48 <IndicesMarquee @click="routeIndex($event.index).navigate()" />
49 </div>
50 <div class="section">
51 <div class="columns flex-col lg:flex-row">
52 <div class="col basis-1/2">
53 <ClusterHealth class="stretchy" />
54 </div>
55 <div class="col basis-1/2">
56 <NodeAllocation class="stretchy" />
57 </div>
58 </div>
59 </div>
60 <div class="section">
61 <PipeList @open-rule="routeGraylogPipelines($event).navigate()" />
62 </div>
63
64 <n-drawer
65 v-model:show="showQuickActions"
66 :width="300"
67 style="max-width: 90vw"
68 :trap-focus="false"
69 display-directive="show"
70 >
71 <n-drawer-content title="Quick Actions" closable :native-scrollbar="false">
72 <div class="flex flex-col gap-3">
73 <StackProvisioningButton size="small" type="primary" />
74 <CloudSecurityAssessmentButton size="small" type="primary" />
75 <WebVulnerabilityAssessmentButton size="small" type="primary" />
76 <GitHubAuditButton size="small" type="primary" />
77 <ActiveResponseWizardButton size="small" type="primary" />
78 <ThreatIntelButton size="small" type="primary" />
79 </div>
80 </n-drawer-content>
81 </n-drawer>
82 </div>
83 </template>
84
85 <script setup lang="ts">
86 import { useResizeObserver } from "@vueuse/core"
87 import { NButton, NDrawer, NDrawerContent } from "naive-ui"
88 import { defineAsyncComponent, ref } from "vue"
89 import ActiveResponseWizardButton from "@/components/activeResponse/ActiveResponseWizardButton.vue"
90 import CloudSecurityAssessmentButton from "@/components/cloudSecurityAssessment/CloudSecurityAssessmentButton.vue"
91 import Icon from "@/components/common/Icon.vue"
92 import VersionUpdateBanner from "@/components/common/VersionUpdateBanner.vue"
93 import GitHubAuditButton from "@/components/githubAudit/GitHubAuditButton.vue"
94 import PipeList from "@/components/graylog/Pipelines/PipeList.vue"
95 import ClusterHealth from "@/components/indices/ClusterHealth.vue"
96 import IndicesMarquee from "@/components/indices/Marquee.vue"
97 import NodeAllocation from "@/components/indices/NodeAllocation.vue"
98 import AgentsCard from "@/components/overview/AgentsCard.vue"
99 import CustomersCard from "@/components/overview/CustomersCard.vue"
100 import HealthcheckCard from "@/components/overview/HealthcheckCard.vue"
101 import IncidentAlerts from "@/components/overview/IncidentAlerts.vue"
102 import IncidentCases from "@/components/overview/IncidentCases.vue"
103 import StackProvisioningButton from "@/components/stackProvisioning/StackProvisioningButton.vue"
104 import WebVulnerabilityAssessmentButton from "@/components/webVulnerabilityAssessment/WebVulnerabilityAssessmentButton.vue"
105 import { useNavigation } from "@/composables/useNavigation"
106
107 const ThreatIntelButton = defineAsyncComponent(() => import("@/components/threatIntel/ThreatIntelButton.vue"))
108
109 const QuickActionsIcon = "ant-design:thunderbolt-outlined"
110 const page = ref()
111 const cardDirection = ref<"horizontal" | "vertical">("horizontal")
112 const showQuickActions = ref(false)
113 const { routeIndex, routeGraylogPipelines } = useNavigation()
114
115 useResizeObserver(page, entries => {
116 const entry = entries[0]
117 if (!entry) return
118
119 const { width } = entry.contentRect
120
121 cardDirection.value = width > 500 ? "horizontal" : "vertical"
122 })
123 </script>
124
125 <style lang="scss" scoped>
126 .page {
127 .section {
128 margin-bottom: calc(var(--spacing) * 6);
129
130 .columns {
131 display: flex;
132 gap: calc(var(--spacing) * 6);
133
134 .stretchy {
135 height: 100%;
136 }
137 }
138 }
139 }
140 </style>