diff --git a/Demo.bin b/Demo.bin index b1cd1cf..2f192f5 100644 Binary files a/Demo.bin and b/Demo.bin differ diff --git a/Pages/Database.razor.js b/Pages/Database.razor.js index 4b28368..ea5283a 100644 --- a/Pages/Database.razor.js +++ b/Pages/Database.razor.js @@ -1,7 +1,4 @@ -const cacheName = 'Bit-Besql'; -const bookDbPath = '/data/cache/book.sqlite3'; - -export async function downloadDb(fileName) { +export async function downloadDb(cacheName, bookDbPath, fileName) { window.sqlitedb = window.sqlitedb || { init: false, @@ -39,7 +36,7 @@ export async function downloadJsonDb(fileName, contentStreamReference) { URL.revokeObjectURL(url); } -export async function uploadDatabase(blob) { +export async function uploadDatabase(cacheName, bookDbPath, blob) { window.sqlitedb = window.sqlitedb || { init: false, @@ -62,4 +59,4 @@ export async function uploadDatabase(blob) { }); await window.sqlitedb.cache.put(bookDbPath, response); -} +} \ No newline at end of file diff --git a/Shared/LoadDemoData.razor.js b/Shared/LoadDemoData.razor.js new file mode 100644 index 0000000..0e76fce --- /dev/null +++ b/Shared/LoadDemoData.razor.js @@ -0,0 +1,24 @@ +export async function uploadDemoData(cacheName, bookDbPath, blob) { + + window.sqlitedb = window.sqlitedb || { + init: false, + cache: await caches.open(cacheName) + }; + + const match = await window.sqlitedb.cache.match(bookDbPath); + + if (match && match.ok) { + + await window.sqlitedb.cache.delete(bookDbPath); + } + + const headers = new Headers({ + 'content-length': blob.size + }); + + const response = new Response(blob, { + headers + }); + + await window.sqlitedb.cache.put(bookDbPath, response); +} \ No newline at end of file diff --git a/_framework/Book.pdb.gz b/_framework/Book.pdb.gz index 8516396..b0bbae5 100644 Binary files a/_framework/Book.pdb.gz and b/_framework/Book.pdb.gz differ diff --git a/_framework/Book.wasm b/_framework/Book.wasm index b8c20a2..6760883 100644 Binary files a/_framework/Book.wasm and b/_framework/Book.wasm differ diff --git a/_framework/Book.wasm.br b/_framework/Book.wasm.br index 6a8ad66..a4c515d 100644 Binary files a/_framework/Book.wasm.br and b/_framework/Book.wasm.br differ diff --git a/_framework/Book.wasm.gz b/_framework/Book.wasm.gz index 5576da8..7842967 100644 Binary files a/_framework/Book.wasm.gz and b/_framework/Book.wasm.gz differ diff --git a/_framework/System.Net.Http.wasm b/_framework/System.Net.Http.wasm index c8af1fe..03c4a09 100644 Binary files a/_framework/System.Net.Http.wasm and b/_framework/System.Net.Http.wasm differ diff --git a/_framework/System.Net.Http.wasm.br b/_framework/System.Net.Http.wasm.br index dfe2c79..6431e2e 100644 Binary files a/_framework/System.Net.Http.wasm.br and b/_framework/System.Net.Http.wasm.br differ diff --git a/_framework/System.Net.Http.wasm.gz b/_framework/System.Net.Http.wasm.gz index 500c2cd..5b089f7 100644 Binary files a/_framework/System.Net.Http.wasm.gz and b/_framework/System.Net.Http.wasm.gz differ diff --git a/_framework/blazor.boot.json b/_framework/blazor.boot.json index 30602f7..2fe5c0e 100644 --- a/_framework/blazor.boot.json +++ b/_framework/blazor.boot.json @@ -1,7 +1,7 @@ { "mainAssemblyName": "Book", "resources": { - "hash": "sha256-Tjf9bC4yBvqMPRjYoBLEQU4O0jHfMoOTvnvsX7wa250=", + "hash": "sha256-50KmqgtcvZocw0XQk+GyAsPpVjwB9q+oR9XPvv0lM8U=", "jsModuleNative": { "dotnet.native.8.0.5.wkyh9oo3kb.js": "sha256-lkFc2fKj8dqoAHuxc/Unl13t2HadhodNXoP+8xTnWK0=" }, @@ -17,7 +17,7 @@ "assembly": { "Bit.Besql.wasm": "sha256-8NehqPmV4vKdwcxXnnNZIYebo9MZa3/g6tiwrkEX9R0=", "Blazor-ApexCharts.wasm": "sha256-YAnmqRuT0V9DVItiMpEhe37Cnwl6FBW685qEx2VbpPo=", - "Book.wasm": "sha256-URVgQk6DJBk3Ccsj+Pf8BFZ1AkQ2ipGDcREl+4P74mw=", + "Book.wasm": "sha256-GCTQOIMckv36Ww78mBeDeDfyVZG30qRcm6wk0lnnuzw=", "FluentValidation.wasm": "sha256-1akWVGgQZ9ojnoh8cEfeVZK+gNpDt7EOzVVPLa0T/iQ=", "Microsoft.AspNetCore.Components.Forms.wasm": "sha256-F/b8c141U/fiV6IhZVK1pfQSniboFMGKF1gJ+LPZ6BY=", "Microsoft.AspNetCore.Components.wasm": "sha256-sF1s8domwlT1Zh2j+ThfKXs0NcSFvhX+Gyhc4HJGFBg=", @@ -71,7 +71,7 @@ "System.Linq.Queryable.wasm": "sha256-r+2et4mFTbEC4+3GNd5vafpeKP4EYMh9pdJu9KBSHKw=", "System.Linq.wasm": "sha256-xjpe7Q6ssNby/C5Vu5szxHHbBceZRWruRXbjoCFXmj0=", "System.Memory.wasm": "sha256-i1KkC2j1Li9lqMx/dCotKQc/gntITZ5gd/ixr7HBfEk=", - "System.Net.Http.wasm": "sha256-aS8BNlDawDNSPGPbLKqSn1bpOHNOOB6cEIGyymmNh2c=", + "System.Net.Http.wasm": "sha256-zL097SnjkaNrNNU7LwepiiqtbI7RwGGGrGh0XmaZoBY=", "System.Net.NetworkInformation.wasm": "sha256-W+sLnKWrfb50zwfGAOlk0GK7XmkcBMMPyC/jq4/1l1c=", "System.Net.Primitives.wasm": "sha256-GeZdfwkPVasXFTz9vCUKORacc+jgJQSs5m/Z+5IR7/k=", "System.ObjectModel.wasm": "sha256-K4qjxqFqPjAy665Zz8uWLCZ64wktZBpIBaiD5of0XtI=", @@ -104,7 +104,7 @@ }, "satelliteResources": { "fr": { - "Book.resources.wasm": "sha256-lWk1vrM1VafPQYzi62O12nXRUj0JUAqLW7IExAFANNc=" + "Book.resources.wasm": "sha256-Qm26+Ia5HceavPadNR79yQJpWdroSyOm+giEbOSOIJQ=" } } }, diff --git a/_framework/blazor.boot.json.br b/_framework/blazor.boot.json.br index dee574a..6619393 100644 Binary files a/_framework/blazor.boot.json.br and b/_framework/blazor.boot.json.br differ diff --git a/_framework/blazor.boot.json.gz b/_framework/blazor.boot.json.gz index 85dee21..25389df 100644 Binary files a/_framework/blazor.boot.json.gz and b/_framework/blazor.boot.json.gz differ diff --git a/_framework/fr/Book.resources.wasm b/_framework/fr/Book.resources.wasm index 8265192..f3f6bb8 100644 Binary files a/_framework/fr/Book.resources.wasm and b/_framework/fr/Book.resources.wasm differ diff --git a/_framework/fr/Book.resources.wasm.br b/_framework/fr/Book.resources.wasm.br index a4731ef..566d85c 100644 Binary files a/_framework/fr/Book.resources.wasm.br and b/_framework/fr/Book.resources.wasm.br differ diff --git a/_framework/fr/Book.resources.wasm.gz b/_framework/fr/Book.resources.wasm.gz index fc6ca03..e3ac60a 100644 Binary files a/_framework/fr/Book.resources.wasm.gz and b/_framework/fr/Book.resources.wasm.gz differ diff --git a/service-worker-assets.js b/service-worker-assets.js index c090384..5aefc02 100644 --- a/service-worker-assets.js +++ b/service-worker-assets.js @@ -17,7 +17,7 @@ "url": "_framework\/icudt.dat" }, { - "hash": "sha256-0xoimNJOI97Din4TFbJ8NEMMxj3+JupLo1GTzpvaPpU=", + "hash": "sha256-sXbHv9Sp69IIk5uqyWCiEE+0CQtw+iBGzLSmiBIxzxA=", "url": "_framework\/blazor.boot.json" }, { @@ -37,7 +37,7 @@ "url": "_framework\/Blazor-ApexCharts.wasm" }, { - "hash": "sha256-URVgQk6DJBk3Ccsj+Pf8BFZ1AkQ2ipGDcREl+4P74mw=", + "hash": "sha256-GCTQOIMckv36Ww78mBeDeDfyVZG30qRcm6wk0lnnuzw=", "url": "_framework\/Book.wasm" }, { @@ -253,7 +253,7 @@ "url": "_framework\/System.Memory.wasm" }, { - "hash": "sha256-aS8BNlDawDNSPGPbLKqSn1bpOHNOOB6cEIGyymmNh2c=", + "hash": "sha256-zL097SnjkaNrNNU7LwepiiqtbI7RwGGGrGh0XmaZoBY=", "url": "_framework\/System.Net.Http.wasm" }, { @@ -373,7 +373,7 @@ "url": "_framework\/System.Xml.XDocument.wasm" }, { - "hash": "sha256-lWk1vrM1VafPQYzi62O12nXRUj0JUAqLW7IExAFANNc=", + "hash": "sha256-Qm26+Ia5HceavPadNR79yQJpWdroSyOm+giEbOSOIJQ=", "url": "_framework\/fr\/Book.resources.wasm" }, { @@ -381,9 +381,13 @@ "url": "Book.styles.css" }, { - "hash": "sha256-n6tCuix\/\/ZoGjw1l+P9xnw2zj0XSURLu5AU4BpWgsj0=", + "hash": "sha256-4el0B6b+HmiKsRKY8eLDjnLtoNjlyH5SLUx25dK2hyQ=", "url": "Pages\/Database.razor.js" }, + { + "hash": "sha256-FPk+\/Ifpa6nHsjo8bUp+GsTPnPMbTYSZMbAiVrwxeFA=", + "url": "Shared\/LoadDemoData.razor.js" + }, { "hash": "sha256-OHUlLyXuua1SwLOz5u\/T0SQCHI9Oo24Z\/lAhIHhGXao=", "url": "404.html" @@ -393,7 +397,7 @@ "url": "css\/app.css" }, { - "hash": "sha256-g4bn\/U7UtM5HsVuf7Oxmw5872MVIeahdx1YX4HZ1JXk=", + "hash": "sha256-fojLUmXCodWgvPfAgqlhIb64YPoY7lbZzr+zK6LD5ck=", "url": "Demo.bin" }, { @@ -477,5 +481,5 @@ "url": "_content\/MudBlazor\/MudBlazor.min.js" } ], - "version": "Ddh4W5K9" + "version": "xyXyN9WU" }; diff --git a/service-worker.js b/service-worker.js index cf1721d..9b6dfb1 100644 --- a/service-worker.js +++ b/service-worker.js @@ -53,4 +53,4 @@ async function onFetch(event) { return cachedResponse || fetch(event.request); } -/* Manifest version: Ddh4W5K9 */ +/* Manifest version: xyXyN9WU */