Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event_logs download functionality #2373

Merged
merged 12 commits into from
Dec 2, 2021
12 changes: 7 additions & 5 deletions templates/operations.html
Original file line number Diff line number Diff line change
Expand Up @@ -1421,11 +1421,12 @@ <h2 class="is-size-7 has-text-weight-normal mb-5 mt-0">Decisions</h2>
},

downloadInfo(formatType) {
apiV2('POST', `${this.ENDPOINT}/${this.selectedOperationID}/report`, { enable_agent_output: this.isAgentOutputSelected })
.then((res) => {
this.createDownloadReport(res, `${this.selectedOperation.name}_${formatType}`);
})
.catch(() => toast('Error generating operation report.'));
const endpoint = formatType === 'full-report' ? 'report' : formatType;
apiV2('POST', `${this.ENDPOINT}/${this.selectedOperationID}/${endpoint}`, { enable_agent_output: this.isAgentOutputSelected })
.then((res) => {
this.createDownloadReport(res, `${this.selectedOperation.name}_${formatType}`);
})
.catch(() => toast(`Error generating operation ${formatType.replace('-', ' ')}`));
},

downloadCSV() {
Expand Down Expand Up @@ -1473,6 +1474,7 @@ <h2 class="is-size-7 has-text-weight-normal mb-5 mt-0">Decisions</h2>
fileName += '.json';
} else {
dataURL = window.URL.createObjectURL(data);
fileName += '.csv';
}

const elem = document.createElement('a');
Expand Down