-
-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15ba95e
commit bf0d6e0
Showing
3 changed files
with
120 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,6 @@ jupyter_execute | |
builtdocs/ | ||
.doit.db | ||
|
||
lite/ | ||
.jupyterlite.doit.db | ||
|
||
# jetbrains settings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The contents of Panelite are updated on every release, however Jupyterlite caches old edits to files. If you want to reset the storage and **delete all modifications you made to the contents** then run the code below and click the button `Clear JupyterLite local storage` button." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/html": [ | ||
"\n", | ||
"<button type=\"button\" id=\"button_for_indexeddb\">Clear JupyterLite local storage</button>\n", | ||
"<div id=\"clear-storage-message\"></div>\n", | ||
"<script>\n", | ||
"window.button_for_indexeddb.onclick = function(e) {\n", | ||
" message = document.getElementById(\"clear-storage-message\")\n", | ||
" message.innerText=\"Running\"\n", | ||
" window.indexedDB.open('JupyterLite Storage').onsuccess = function(e) {\n", | ||
" // There are also other tables that I'm not clearing:\n", | ||
" // \"counters\", \"settings\", \"local-storage-detect-blob-support\"\n", | ||
" let tables = [\"checkpoints\", \"files\"];\n", | ||
"\n", | ||
" let db = e.target.result;\n", | ||
" let t = db.transaction(tables, \"readwrite\");\n", | ||
"\n", | ||
" function clearTable(tablename) {\n", | ||
" let st = t.objectStore(tablename);\n", | ||
" st.count().onsuccess = function(e) {\n", | ||
" console.log(\"Deleting \" + e.target.result + \" entries from \" + tablename + \"...\");\n", | ||
" st.clear().onsuccess = function(e) {\n", | ||
" console.log(tablename + \" is cleared!\");\n", | ||
" }\n", | ||
" }\n", | ||
" }\n", | ||
"\n", | ||
" for (let tablename of tables) {\n", | ||
" clearTable(tablename);\n", | ||
" }\n", | ||
" }\n", | ||
" message.innerText=\"JupyterLite local storage has successfully been reset\"\n", | ||
"};\n", | ||
"</script>\n" | ||
], | ||
"text/plain": [ | ||
"<IPython.core.display.HTML object>" | ||
] | ||
}, | ||
"metadata": {}, | ||
"output_type": "display_data" | ||
} | ||
], | ||
"source": [ | ||
"from IPython.display import display, HTML\n", | ||
"display(HTML(\"\"\"\n", | ||
"<button type=\"button\" id=\"button_for_indexeddb\">Clear JupyterLite local storage</button>\n", | ||
"<div id=\"clear-storage-message\"></div>\n", | ||
"<script>\n", | ||
"window.button_for_indexeddb.onclick = function(e) {\n", | ||
" message = document.getElementById(\"clear-storage-message\")\n", | ||
" message.innerText=\"Running\"\n", | ||
" window.indexedDB.open('JupyterLite Storaage').onsuccess = function(e) {\n", | ||
" // There are also other tables that I'm not clearing:\n", | ||
" // \"counters\", \"settings\", \"local-storage-detect-blob-support\"\n", | ||
" let tables = [\"checkpoints\", \"files\"];\n", | ||
"\n", | ||
" let db = e.target.result;\n", | ||
" let t = db.transaction(tables, \"readwrite\");\n", | ||
"\n", | ||
" function clearTable(tablename) {\n", | ||
" let st = t.objectStore(tablename);\n", | ||
" st.count().onsuccess = function(e) {\n", | ||
" console.log(\"Deleting \" + e.target.result + \" entries from \" + tablename + \"...\");\n", | ||
" st.clear().onsuccess = function(e) {\n", | ||
" console.log(tablename + \" is cleared!\");\n", | ||
" }\n", | ||
" }\n", | ||
" }\n", | ||
"\n", | ||
" for (let tablename of tables) {\n", | ||
" clearTable(tablename);\n", | ||
" }\n", | ||
" }\n", | ||
" message.innerText=\"JupyterLite local storage has successfully been reset\"\n", | ||
"};\n", | ||
"</script>\n", | ||
"\"\"\"))" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".venv", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
}, | ||
"orig_nbformat": 4 | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |