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); +} +} + +