Skip to content

Commit b8b033d

Browse files
authored
Merge pull request #2373 from heatonk/VIRTS-3055-@2329-Issue
Fix event_logs download functionality
2 parents 4364df7 + b2bce54 commit b8b033d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

templates/operations.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,11 +1421,12 @@ <h2 class="is-size-7 has-text-weight-normal mb-5 mt-0">Decisions</h2>
14211421
},
14221422

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

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

14781480
const elem = document.createElement('a');

0 commit comments

Comments
 (0)