From 6c32b64ac6cf221c26ef612a530fc173843b54e2 Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 31 Jul 2024 16:02:00 +0200 Subject: [PATCH] implementing snapshots + change ui --- dashboard/components/CVerticalNavigation.vue | 37 +++- dashboard/components/dashboard/BarsCard.vue | 179 ++++++++---------- dashboard/components/dashboard/OssBarCard.vue | 2 +- .../components/dashboard/WebsitesBarCard.vue | 4 +- dashboard/composables/useDataService.ts | 2 +- dashboard/composables/useSnapshot.ts | 14 +- dashboard/layouts/dashboard.vue | 2 +- dashboard/pages/index.vue | 1 - 8 files changed, 125 insertions(+), 116 deletions(-) diff --git a/dashboard/components/CVerticalNavigation.vue b/dashboard/components/CVerticalNavigation.vue index a7cec8b..f671e6c 100644 --- a/dashboard/components/CVerticalNavigation.vue +++ b/dashboard/components/CVerticalNavigation.vue @@ -60,10 +60,30 @@ async function deleteSnapshot(close: () => any) { }); await updateSnapshots(); snapshot.value = snapshots.value[1]; - createAlert('Snapshot deleted','Snapshot deleted successfully', 'far fa-circle-check', 5000); + createAlert('Snapshot deleted', 'Snapshot deleted successfully', 'far fa-circle-check', 5000); close(); } +async function generatePDF() { + +try { + const res = await $fetch('/api/project/generate_pdf', { + ...signHeaders(), + responseType: 'blob' + }); + + const url = URL.createObjectURL(res); + const a = document.createElement('a'); + a.href = url; + a.download = `Report.pdf`; + a.click(); + URL.revokeObjectURL(url); +} catch (ex: any) { + alert(ex.message); +} +} + +