mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(editor): Add "Download" button if JSON data is to large (#6850)
* feat(editor): Add "Download" button if JSON data is to large * ⚡ Some code improvements + change button style --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -284,6 +284,12 @@
|
||||
:label="$locale.baseText('ndv.output.tooMuchData.showDataAnyway')"
|
||||
@click="showTooMuchData"
|
||||
/>
|
||||
|
||||
<n8n-button
|
||||
size="small"
|
||||
:label="$locale.baseText('runData.downloadBinaryData')"
|
||||
@click="downloadJsonData()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -1290,6 +1296,14 @@ export default defineComponent({
|
||||
saveAs(blob, fileName);
|
||||
}
|
||||
},
|
||||
async downloadJsonData() {
|
||||
const inputData = this.getNodeInputData(this.node, this.runIndex, this.currentOutputIndex);
|
||||
|
||||
const fileName = this.node!.name.replace(/[^\w\d]/g, '_');
|
||||
const blob = new Blob([JSON.stringify(inputData, null, 2)], { type: 'application/json' });
|
||||
|
||||
saveAs(blob, `${fileName}.json`);
|
||||
},
|
||||
displayBinaryData(index: number, key: string) {
|
||||
this.binaryDataDisplayVisible = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user