From a4a170d97a51c754ded041863717a50a8f1976ae Mon Sep 17 00:00:00 2001 From: 1ilit Date: Tue, 19 Sep 2023 15:49:30 +0300 Subject: [PATCH] Export to ddb --- src/components/control_panel.jsx | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/components/control_panel.jsx b/src/components/control_panel.jsx index 989cbf3..1cff424 100644 --- a/src/components/control_panel.jsx +++ b/src/components/control_panel.jsx @@ -193,6 +193,28 @@ export default function ControlPanel(props) { }); }, }, + { + DRAWDB: () => { + const result = JSON.stringify( + { + author: "Unnamed", + project: "Untitled", + filename: "Untitled", + date: Date().toISOString(), + tables: tables, + relationships: relationships, + notes: notes, + subjectAreas: areas, + }, + null, + 2 + ); + const blob = new Blob([result], { + type: "text/plain;charset=utf-8", + }); + saveAs(blob, `${exportData.filename}.ddb`); + }, + }, ], function: () => {}, }, @@ -539,7 +561,7 @@ export default function ControlPanel(props) { ); } else if (visible === MODAL.CODE) { const blob = new Blob([exportData.data], { - type: "text/plain;charset=utf-8", + type: "application/json", }); saveAs(blob, `${exportData.filename}.${exportData.extension}`); } else if (visible === MODAL.IMPORT) {