diff --git a/packages/builder/src/pages/builder/portal/account/auditLogs/index.svelte b/packages/builder/src/pages/builder/portal/account/auditLogs/index.svelte index 4459eb12a5..125a67a03d 100644 --- a/packages/builder/src/pages/builder/portal/account/auditLogs/index.svelte +++ b/packages/builder/src/pages/builder/portal/account/auditLogs/index.svelte @@ -21,6 +21,7 @@ import UserRenderer from "./_components/UserRenderer.svelte" import TimeRenderer from "./_components/TimeRenderer.svelte" import AppColumnRenderer from "./_components/AppColumnRenderer.svelte" + import download from "downloadjs" const schema = { date: { width: "0.8fr" }, @@ -167,16 +168,29 @@ selectedLog = detail sidePanelVisible = true } + async function exportView() { + try { + const data = await API.exportView({ + viewName: view, + format: exportFormat, + }) + } catch (error) { + notifications.error(`Unable to export ${exportFormat.toUpperCase()} data`) + } + } const downloadLogs = async () => { try { - await auditLogs.download({ + let response = await auditLogs.downloadLogs({ startDate, endDate, - metadataSearch: logSearchTerm, + fullSearch: logSearchTerm, userIds: selectedUsers, appIds: selectedApps, + events: selectedEvents, }) + + // DO SOMETHING HERE??????????? } catch (error) { notifications.error(`Error downloading logs: ` + error.message) } @@ -193,6 +207,7 @@ onMount(async () => { await auditLogs.getEventDefinitions() + await licensing.init() }) @@ -214,7 +229,6 @@ range={true} label="Date Range" on:change={e => { - console.log(e) if (e.detail[0]?.length === 1) { startDate = e.detail[0][0].toISOString() } else if (e.detail[0]?.length > 1) { @@ -263,8 +277,11 @@ /> -