diff --git a/.gitignore b/.gitignore index cdaaa5a..86d90d1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk + +# These are build files generated by Trunk +dist/ diff --git a/Cargo.toml b/Cargo.toml index 867b2a6..2002d31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,18 +16,24 @@ dirs = "4" git-version = "0.3.5" chrono = "0.4" tracing = "0.1" # egui / eframe use tracing -tracing-subscriber = "0.3" serde = { version = "1", features = ["derive"] } serde_json = "1" csv = "1.1" jql = { version = "4", default-features = false } rfd = "0.9" -eframe = "0.19" +eframe = { version = "0.19", features = ["persistence"] } tokio = { version = "1", features = ["full"] } clap = { version = "4", features = ["derive"] } futures = "0.3" sea-orm = { version = "0.10", features = [ "runtime-tokio-rustls", "sqlx-sqlite", "macros" ] } reqwest = { version = "0.11", features = ["json"] } -[profile.dev.package."*"] -opt-level = 3 +[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +tracing-subscriber = "0.3" + +[target.'cfg(target_arch = "wasm32")'.dependencies] +console_error_panic_hook = "0.1.6" +tracing-wasm = "0.2" + +# [profile.dev.package."*"] +# opt-level = 3 diff --git a/Trunk.toml b/Trunk.toml new file mode 100644 index 0000000..bd6c484 --- /dev/null +++ b/Trunk.toml @@ -0,0 +1,2 @@ +[build] +filehash = false diff --git a/assets/favicon.ico b/assets/favicon.ico new file mode 100755 index 0000000..61ad031 Binary files /dev/null and b/assets/favicon.ico differ diff --git a/assets/icon-1024.png b/assets/icon-1024.png new file mode 100644 index 0000000..1b5868a Binary files /dev/null and b/assets/icon-1024.png differ diff --git a/assets/icon-256.png b/assets/icon-256.png new file mode 100644 index 0000000..ae72287 Binary files /dev/null and b/assets/icon-256.png differ diff --git a/assets/icon_ios_touch_192.png b/assets/icon_ios_touch_192.png new file mode 100644 index 0000000..8472802 Binary files /dev/null and b/assets/icon_ios_touch_192.png differ diff --git a/assets/manifest.json b/assets/manifest.json new file mode 100644 index 0000000..2a137fb --- /dev/null +++ b/assets/manifest.json @@ -0,0 +1,28 @@ +{ + "name": "egui Template PWA", + "short_name": "egui-template-pwa", + "icons": [ + { + "src": "./icon-256.png", + "sizes": "256x256", + "type": "image/png" + }, + { + "src": "./maskable_icon_x512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "any maskable" + }, + { + "src": "./icon-1024.png", + "sizes": "1024x1024", + "type": "image/png" + } + ], + "lang": "en-US", + "id": "/index.html", + "start_url": "./index.html", + "display": "standalone", + "background_color": "white", + "theme_color": "white" +} diff --git a/assets/maskable_icon_x512.png b/assets/maskable_icon_x512.png new file mode 100644 index 0000000..db8df3e Binary files /dev/null and b/assets/maskable_icon_x512.png differ diff --git a/assets/sw.js b/assets/sw.js new file mode 100644 index 0000000..7ecd229 --- /dev/null +++ b/assets/sw.js @@ -0,0 +1,25 @@ +var cacheName = 'egui-template-pwa'; +var filesToCache = [ + './', + './index.html', + './eframe_template.js', + './eframe_template_bg.wasm', +]; + +/* Start the service worker and cache all of the app's content */ +self.addEventListener('install', function (e) { + e.waitUntil( + caches.open(cacheName).then(function (cache) { + return cache.addAll(filesToCache); + }) + ); +}); + +/* Serve cached content when offline */ +self.addEventListener('fetch', function (e) { + e.respondWith( + caches.match(e.request).then(function (response) { + return response || fetch(e.request); + }) + ); +}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..872b4f4 --- /dev/null +++ b/index.html @@ -0,0 +1,140 @@ + + + + + + + +
+ +