| 1 | <template> |
| 2 | <div class="page page-wrapped page-without-footer flex flex-col gap-5"> |
| 3 | <ReportWizard |
| 4 | v-if="licenseResponse" |
| 5 | hide-panels-select |
| 6 | class="animate-fade" |
| 7 | @timerange="timerange = $event" |
| 8 | @organization="org = $event" |
| 9 | @dashboard="dashboard = $event" |
| 10 | @panels="panels = $event" |
| 11 | /> |
| 12 | |
| 13 | <ReportPanels v-if="licenseResponse" :timerange :org :dashboard :panels class="animate-fade" /> |
| 14 | |
| 15 | <div v-if="licenseResponse" class="over-layer mobile-layer"> |
| 16 | <n-alert> |
| 17 | <template #icon> |
| 18 | <Icon :name="AlertIcon" :size="18" /> |
| 19 | </template> |
| 20 | This function is available only for desktop devices |
| 21 | </n-alert> |
| 22 | </div> |
| 23 | |
| 24 | <LicenseFeatureCheck |
| 25 | feature="REPORTING" |
| 26 | feedback="overlay" |
| 27 | @response="licenseResponse = $event" |
| 28 | @start-loading="licenseChecking = true" |
| 29 | @stop-loading="licenseChecking = false" |
| 30 | /> |
| 31 | |
| 32 | <n-spin v-if="licenseChecking" class="min-h-52"></n-spin> |
| 33 | </div> |
| 34 | </template> |
| 35 | |
| 36 | <script setup lang="ts"> |
| 37 | import type { ReportTimeRange } from "@/api/endpoints/reporting" |
| 38 | import type { Dashboard, Org, Panel } from "@/types/reporting.d" |
| 39 | import { NAlert, NSpin } from "naive-ui" |
| 40 | import { ref } from "vue" |
| 41 | import Icon from "@/components/common/Icon.vue" |
| 42 | import LicenseFeatureCheck from "@/components/license/LicenseFeatureCheck.vue" |
| 43 | import ReportPanels from "@/components/reportCreation/Panels.vue" |
| 44 | import ReportWizard from "@/components/reportCreation/Wizard.vue" |
| 45 | |
| 46 | const AlertIcon = "mdi:alert-outline" |
| 47 | const timerange = ref<ReportTimeRange | null>(null) |
| 48 | const org = ref<Org | null>(null) |
| 49 | const dashboard = ref<Dashboard | null>(null) |
| 50 | const panels = ref<Panel[]>([]) |
| 51 | const licenseChecking = ref(false) |
| 52 | const licenseResponse = ref(false) |
| 53 | </script> |
| 54 | |
| 55 | <style lang="scss" scoped> |
| 56 | @import "../app-layouts/VerticalNav/_variables.scss"; |
| 57 | |
| 58 | .page { |
| 59 | overflow: hidden; |
| 60 | position: relative; |
| 61 | |
| 62 | .mobile-layer { |
| 63 | display: none; |
| 64 | @media (max-width: $sidebar-bp) { |
| 65 | display: flex; |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | </style> |