From 61f74b2f8a4681ee190c53326a3a2c9504282e2b Mon Sep 17 00:00:00 2001 From: Saood Karim Date: Tue, 8 Jul 2025 02:18:40 -0500 Subject: [PATCH] Export All (code only, no UI) --- examples/server/public_mikupad/index.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/examples/server/public_mikupad/index.html b/examples/server/public_mikupad/index.html index 8aa6ccf5..c053c006 100644 --- a/examples/server/public_mikupad/index.html +++ b/examples/server/public_mikupad/index.html @@ -1952,6 +1952,19 @@ function Sessions({ sessionStorage, disabled }) { exportText(`${sessionStorage.getProperty('name')}.json`, JSON.stringify(sessionObj)); }; + const exportAll = async () => { + alert("Warning: This can take a lot of time and space. Leave the page now if you do not want to proceed.") + const db = await sessionStorage.openDatabase(); + const sessionKeys = Object.keys(sessionStorage.sessions); + for (const sessionKey of sessionKeys) { + const processedSession = await sessionStorage.loadFromDatabase(db, sessionKey); + for (const [key, value] of Object.entries(processedSession)) { + processedSession[key] = JSON.stringify(value); + } + exportText(`${processedSession.name}.json`, JSON.stringify(processedSession)); + } + }; + const cloneSession = async () => { const sessionObj = { ...sessionStorage.sessions[sessionStorage.selectedSession] }; for (const [key, value] of Object.entries(sessionObj)) { @@ -2087,6 +2100,7 @@ function Sessions({ sessionStorage, disabled }) { + `;