MCPcopy Index your code
hub / github.com/apache/caldera / downloadObjectAsJson

Function downloadObjectAsJson

static/js/shared.js:233–243  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

231
232function downloadReport(endpoint, filename, data = {}, jsonifyData = false) {
233 function downloadObjectAsJson(data) {
234 stream('Downloading report: ' + filename);
235 const parsedData = jsonifyData ? JSON.stringify(data, null, 2) : data;
236 let dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(parsedData);
237 let downloadAnchorNode = document.createElement('a');
238 downloadAnchorNode.setAttribute("href", dataStr);
239 downloadAnchorNode.setAttribute("download", filename + ".json");
240 document.body.appendChild(downloadAnchorNode);
241 downloadAnchorNode.click();
242 downloadAnchorNode.remove();
243 }
244
245 restRequest('POST', data, downloadObjectAsJson, endpoint);
246}

Callers

nothing calls this directly

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected