Skip to content

Commit

Permalink
Merge pull request #2373 from heatonk/VIRTS-3055-@2329-Issue
Browse files Browse the repository at this point in the history
Fix event_logs download functionality
  • Loading branch information
wbooth authored Dec 2, 2021
2 parents 4364df7 + b2bce54 commit b8b033d
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit b8b033d

Please sign in to comment.