From bd61bee7208b0e6c7a76dc98a8797691a8ca6f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Wed, 11 Oct 2023 17:22:53 +0200 Subject: [PATCH] Create rent, display rent offers --- Cargo.lock | 623 ++++++++++-------- assets/build.js | 37 +- assets/build.js.map | 8 +- assets/style.css | 4 + .../src/m20230805_000001_add_email.rs | 3 +- .../m20230919_162830_create_rent_requests.rs | 3 +- crates/oswilno-admin/Cargo.toml | 4 +- crates/oswilno-admin/src/lib.rs | 1 + crates/oswilno-contract/Cargo.toml | 5 +- crates/oswilno-contract/src/accounts.rs | 5 +- crates/oswilno-contract/src/images.rs | 5 +- crates/oswilno-contract/src/lib.rs | 5 +- .../src/parking_space_locations.rs | 2 +- .../src/parking_space_rents.rs | 2 +- crates/oswilno-contract/src/parking_spaces.rs | 5 +- crates/oswilno-contract/src/prelude.rs | 2 +- crates/oswilno-contract/src/rent_requests.rs | 2 +- .../src/sea_orm_active_enums.rs | 2 +- crates/oswilno-parking-space/src/lib.rs | 293 ++++++-- .../templates/parking-spaces/all-partial.html | 79 +-- .../parking-spaces/parking_space_actions.html | 51 ++ crates/oswilno-server/src/main.rs | 1 + crates/oswilno-session/src/lib.rs | 50 +- crates/oswilno-view/src/filters.rs | 3 +- crates/oswilno-view/src/helper_context.rs | 11 +- crates/oswilno-view/src/lang.rs | 5 +- crates/oswilno-view/src/lib.rs | 1 - crates/oswilno-view/templates/nav/search.html | 2 +- crates/web-assets/assets/app.js | 4 + .../oswilno-parking-space-location.js | 14 + .../elements/oswilno-parking-space-rent.js | 14 + .../elements/oswilno-parking-space-rents.js | 23 + .../assets/elements/oswilno-parking-space.js | 2 +- crates/web-assets/build.rs | 3 +- crates/web-assets/src/lib.rs | 6 +- scripts/generate-entries.sh | 2 + 36 files changed, 819 insertions(+), 463 deletions(-) create mode 100644 crates/oswilno-parking-space/templates/parking-spaces/parking_space_actions.html create mode 100644 crates/web-assets/assets/elements/oswilno-parking-space-location.js create mode 100644 crates/web-assets/assets/elements/oswilno-parking-space-rent.js create mode 100644 crates/web-assets/assets/elements/oswilno-parking-space-rents.js diff --git a/Cargo.lock b/Cargo.lock index 9555c54..122d907 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,14 +29,14 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite 0.2.13", "smallvec", - "tokio 1.32.0", - "tokio-util 0.7.8", + "tokio 1.33.0", + "tokio-util 0.7.9", ] [[package]] name = "actix-admin" -version = "0.5.0" -source = "git+https://code.ita-prog.pl/Tsumanu/actix-admin.git#586d4f419a97d57347d5456894d766cfe3050645" +version = "0.6.0" +source = "git+https://github.com/mgugger/actix-admin.git#156d5c7f3586d62367309ed84cdf368e7f9545d2" dependencies = [ "actix-admin-macros", "actix-files", @@ -45,23 +45,23 @@ dependencies = [ "actix-web", "async-trait", "chrono", + "csv", "derive_more", "futures-util", - "itertools 0.11.0", + "itertools", "lazy_static", "regex", - "sea-orm 0.12.2", + "sea-orm 0.12.3", "serde", "serde_derive", "tera", - "tracing", "urlencoding", ] [[package]] name = "actix-admin-macros" -version = "0.5.0" -source = "git+https://code.ita-prog.pl/Tsumanu/actix-admin.git#586d4f419a97d57347d5456894d766cfe3050645" +version = "0.6.0" +source = "git+https://github.com/mgugger/actix-admin.git#156d5c7f3586d62367309ed84cdf368e7f9545d2" dependencies = [ "bae", "proc-macro2", @@ -82,8 +82,8 @@ dependencies = [ "futures-sink", "memchr", "pin-project-lite 0.2.13", - "tokio 1.32.0", - "tokio-util 0.7.8", + "tokio 1.33.0", + "tokio-util 0.7.9", "tracing", ] @@ -152,10 +152,10 @@ dependencies = [ "percent-encoding", "pin-project-lite 0.2.13", "rand 0.8.5", - "sha1 0.10.5", + "sha1 0.10.6", "smallvec", - "tokio 1.32.0", - "tokio-util 0.7.8", + "tokio 1.33.0", + "tokio-util 0.7.9", "tracing", "zstd", ] @@ -178,12 +178,12 @@ dependencies = [ "rand 0.8.5", "redis", "redis-async-pool", - "ring", + "ring 0.16.20", "serde", "serde_json", "thiserror", "time", - "tokio 1.32.0", + "tokio 1.33.0", "tracing", "uuid", ] @@ -195,7 +195,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -220,7 +220,7 @@ dependencies = [ "serde_json", "serde_plain", "tempfile", - "tokio 1.32.0", + "tokio 1.33.0", ] [[package]] @@ -233,7 +233,7 @@ dependencies = [ "parse-size", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -257,7 +257,7 @@ checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" dependencies = [ "actix-macros", "futures-core", - "tokio 1.32.0", + "tokio 1.33.0", ] [[package]] @@ -273,7 +273,7 @@ dependencies = [ "futures-util", "mio 0.8.8", "socket2 0.5.4", - "tokio 1.32.0", + "tokio 1.33.0", "tracing", ] @@ -364,7 +364,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -385,7 +385,7 @@ checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -426,9 +426,9 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead", "aes", @@ -463,9 +463,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -544,9 +544,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "askama" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47cbc3cf73fa8d9833727bbee4835ba5c421a0d65b72daf9a7b5d0e0f9cfb57e" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" dependencies = [ "askama_derive", "askama_escape", @@ -569,18 +569,18 @@ dependencies = [ [[package]] name = "askama_derive" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22fbe0413545c098358e56966ff22cdd039e10215ae213cfbd65032b119fc94" +checksum = "9a0fc7dcf8bd4ead96b1d36b41df47c14beedf7b0301fc543d8f2384e66a2ec0" dependencies = [ + "askama_parser", "basic-toml", "mime", "mime_guess", - "nom 7.1.3", "proc-macro2", "quote", "serde", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -589,6 +589,15 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" +[[package]] +name = "askama_parser" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c268a96e01a4c47c8c5c2472aaa570707e006a875ea63e819f75474ceedaf7b4" +dependencies = [ + "nom 7.1.3", +] + [[package]] name = "async-attributes" version = "1.1.2" @@ -612,14 +621,14 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.5.1" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "2c1da3ae8dabd9c00f453a329dfe1fb28da3c0a72e2478cdcd93171740c20499" dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand 1.9.0", + "fastrand 2.0.1", "futures-lite", "slab", ] @@ -637,7 +646,7 @@ dependencies = [ "blocking", "futures-lite", "once_cell", - "tokio 1.32.0", + "tokio 1.33.0", ] [[package]] @@ -654,7 +663,7 @@ dependencies = [ "log", "parking", "polling", - "rustix 0.37.23", + "rustix 0.37.24", "slab", "socket2 0.4.9", "waker-fn", @@ -715,14 +724,14 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "async-task" -version = "4.4.0" +version = "4.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" [[package]] name = "async-trait" @@ -732,7 +741,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -755,9 +764,9 @@ dependencies = [ [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" @@ -920,17 +929,18 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" dependencies = [ "async-channel", "async-lock", "async-task", - "atomic-waker", - "fastrand 1.9.0", + "fastrand 2.0.1", + "futures-io", "futures-lite", - "log", + "piper", + "tracing", ] [[package]] @@ -980,9 +990,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.3.4" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -991,9 +1001,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1001,9 +1011,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" dependencies = [ "memchr", "serde", @@ -1039,9 +1049,9 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -1201,15 +1211,13 @@ dependencies = [ [[package]] name = "comrak" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784836d0812dade01579cc0cc9b1684847044e716fd7aa6bffbc172e42199500" +checksum = "482aa5695bca086022be453c700a40c02893f1ba7098a2c88351de55341ae894" dependencies = [ "entities", "memchr", "once_cell", - "pest", - "pest_derive", "regex", "slug", "typed-arena", @@ -1218,9 +1226,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" dependencies = [ "crossbeam-utils", ] @@ -1367,6 +1375,27 @@ dependencies = [ "typenum", ] +[[package]] +name = "csv" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +dependencies = [ + "csv-core", + "itoa 1.0.9", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +dependencies = [ + "memchr", +] + [[package]] name = "ctr" version = "0.9.2" @@ -1397,7 +1426,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1408,7 +1437,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1557,25 +1586,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys 0.48.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "etcetera" version = "0.8.0" @@ -1604,9 +1622,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "finl_unicode" @@ -1626,13 +1644,12 @@ dependencies = [ [[package]] name = "flume" -version = "0.10.14" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" dependencies = [ "futures-core", "futures-sink", - "pin-project", "spin 0.9.8", ] @@ -1767,7 +1784,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1825,7 +1842,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1926,8 +1943,8 @@ dependencies = [ "http", "indexmap 1.9.3", "slab", - "tokio 1.32.0", - "tokio-util 0.7.8", + "tokio 1.33.0", + "tokio-util 0.7.9", "tracing", ] @@ -1951,9 +1968,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ "ahash 0.8.3", "allocator-api2", @@ -1965,7 +1982,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] @@ -1988,9 +2005,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -2141,12 +2158,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] @@ -2157,7 +2174,7 @@ checksum = "ce243b1bfa62ffc028f1cc3b6034ec63d649f3031bc8a4fbbb004e1ac17d1f68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2171,9 +2188,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.31.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0770b0a3d4c70567f0d58331f3088b0e4c4f56c9b8d764efe654b4a5d46de3a" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" dependencies = [ "console", "lazy_static", @@ -2213,15 +2230,6 @@ dependencies = [ "libc", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.11.0" @@ -2245,9 +2253,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -2269,7 +2277,7 @@ checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.4", "pem", - "ring", + "ring 0.16.20", "serde", "serde_json", "simple_asn1", @@ -2324,15 +2332,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libsqlite3-sys" @@ -2359,9 +2367,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "local-channel" @@ -2419,18 +2427,19 @@ dependencies = [ [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if 1.0.0", "digest", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "migration" @@ -2440,7 +2449,7 @@ dependencies = [ "oswilno-contract", "sea-orm 0.11.3", "sea-orm-migration", - "tokio 1.32.0", + "tokio 1.33.0", ] [[package]] @@ -2621,9 +2630,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -2668,9 +2677,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "ordered-float" -version = "3.9.1" +version = "3.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a54938017eacd63036332b4ae5c8a49fc8c0c1d6d629893057e4f13609edd06" +checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" dependencies = [ "num-traits", ] @@ -2700,10 +2709,10 @@ dependencies = [ "redis", "redis-async-pool", "ron 0.8.1", - "sea-orm 0.12.2", + "sea-orm 0.12.3", "serde", "serde_json", - "tokio 1.32.0", + "tokio 1.33.0", "toml 0.7.8", "tracing", "tracing-subscriber", @@ -2748,7 +2757,7 @@ dependencies = [ "chrono", "oswilno-actix-admin", "regex", - "sea-orm 0.12.2", + "sea-orm 0.12.3", "serde", "uuid", ] @@ -2765,10 +2774,10 @@ dependencies = [ "oswilno-contract", "oswilno-session", "oswilno-view", - "sea-orm 0.12.2", + "sea-orm 0.12.3", "serde", "serde_json", - "tokio 1.32.0", + "tokio 1.33.0", "tracing", ] @@ -2792,11 +2801,11 @@ dependencies = [ "rand 0.8.5", "redis", "redis-async-pool", - "ring", - "sea-orm 0.12.2", + "ring 0.16.20", + "sea-orm 0.12.3", "serde", "time", - "tokio 1.32.0", + "tokio 1.33.0", "tracing", "uuid", ] @@ -2858,7 +2867,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2869,9 +2878,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" [[package]] name = "parking_lot" @@ -2979,9 +2988,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ "memchr", "thiserror", @@ -2990,9 +2999,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" dependencies = [ "pest", "pest_generator", @@ -3000,22 +3009,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" dependencies = [ "once_cell", "pest", @@ -3062,14 +3071,14 @@ dependencies = [ [[package]] name = "phonenumber" -version = "0.3.2+8.13.9" +version = "0.3.3+8.13.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34749f64ea9d76f10cdc8a859588b57775f59177c7dd91f744d620bd62982d6f" +checksum = "635f3e6288e4f01c049d89332a031bd74f25d64b6fb94703ca966e819488cd06" dependencies = [ "bincode", "either", "fnv", - "itertools 0.10.5", + "itertools", "lazy_static", "nom 7.1.3", "quick-xml", @@ -3077,29 +3086,10 @@ dependencies = [ "regex-cache", "serde", "serde_derive", + "strum 0.24.1", "thiserror", ] -[[package]] -name = "pin-project" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - [[package]] name = "pin-project-lite" version = "0.1.12" @@ -3118,6 +3108,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +dependencies = [ + "atomic-waker", + "fastrand 2.0.1", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.7.5" @@ -3214,9 +3215,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -3400,14 +3401,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.1", + "regex-syntax 0.8.0", ] [[package]] @@ -3421,13 +3422,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.0", ] [[package]] @@ -3450,15 +3451,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c3cbb081b9784b07cceb8824c8583f86db4814d172ab043f3c23f7dc600bf83d" [[package]] name = "rend" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ "bytecheck", ] @@ -3473,11 +3474,25 @@ dependencies = [ "libc", "once_cell", "spin 0.5.2", - "untrusted", + "untrusted 0.7.1", "web-sys", "winapi 0.3.9", ] +[[package]] +name = "ring" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" +dependencies = [ + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "rkyv" version = "0.7.42" @@ -3584,9 +3599,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" +version = "0.37.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "4279d76516df406a8bd37e7dff53fd37d1a093f997a3c34a5c21658c126db06d" dependencies = [ "bitflags 1.3.2", "errno", @@ -3598,14 +3613,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "5a74ee2d7c2581cd139b42447d7d9389b889bdaad3a73f1ebb16f2a3237bb19c" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] @@ -3616,7 +3631,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct", "webpki", ] @@ -3627,7 +3642,7 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ - "ring", + "ring 0.16.20", "rustls-webpki", "sct", ] @@ -3643,12 +3658,12 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.5" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3684,8 +3699,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -3698,7 +3713,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3731,9 +3746,9 @@ dependencies = [ [[package]] name = "sea-orm" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61f6c7daef05dde3476d97001e11fca7a52b655aa3bf4fd610ab2da1176a2ed5" +checksum = "da5b2d70c255bc5cbe1d49f69c3c8eadae0fbbaeb18ee978edbf2f75775cb94d" dependencies = [ "async-stream", "async-trait", @@ -3743,13 +3758,13 @@ dependencies = [ "log", "ouroboros 0.17.2", "rust_decimal", - "sea-orm-macros 0.12.2", - "sea-query 0.30.1", + "sea-orm-macros 0.12.3", + "sea-query 0.30.2", "sea-query-binder 0.5.0", "serde", "serde_json", - "sqlx 0.7.1", - "strum", + "sqlx 0.7.2", + "strum 0.25.0", "thiserror", "time", "tracing", @@ -3788,15 +3803,15 @@ dependencies = [ [[package]] name = "sea-orm-macros" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd90e73d5f5b184bad525767da29fbfec132b4e62ebd6f60d2f2737ec6468f62" +checksum = "d7c8d455fad40194fb9774fdc4810c0f2700ff0dc0e93bd5ce9d641cc3f5dd75" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", "sea-bae", - "syn 2.0.37", + "syn 2.0.38", "unicode-ident", ] @@ -3834,9 +3849,9 @@ dependencies = [ [[package]] name = "sea-query" -version = "0.30.1" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c05a5bf6403834be253489bbe95fa9b1e5486bc843b61f60d26b5c9c1e244b" +checksum = "fb3e6bba153bb198646c8762c48414942a38db27d142e44735a133cabddcc820" dependencies = [ "bigdecimal", "chrono", @@ -3874,9 +3889,9 @@ dependencies = [ "bigdecimal", "chrono", "rust_decimal", - "sea-query 0.30.1", + "sea-query 0.30.2", "serde_json", - "sqlx 0.7.1", + "sqlx 0.7.2", "time", "uuid", ] @@ -3947,9 +3962,9 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" @@ -3968,7 +3983,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4023,9 +4038,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -4040,9 +4055,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -4051,9 +4066,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -4085,9 +4100,9 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "similar" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" +checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" [[package]] name = "simple_asn1" @@ -4127,9 +4142,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "socket2" @@ -4159,7 +4174,7 @@ checksum = "c87e960f4dca2788eeb86bbdde8dd246be8948790b7618d656e68f9b720a86e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4193,7 +4208,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" dependencies = [ - "itertools 0.11.0", + "itertools", "nom 7.1.3", "unicode_categories", ] @@ -4210,12 +4225,12 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e58421b6bc416714d5115a2ca953718f6c621a51b68e4f4922aea5a4391a721" +checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" dependencies = [ - "sqlx-core 0.7.1", - "sqlx-macros 0.7.1", + "sqlx-core 0.7.2", + "sqlx-macros 0.7.2", "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", @@ -4264,7 +4279,7 @@ dependencies = [ "rustls-pemfile", "serde", "serde_json", - "sha1 0.10.5", + "sha1 0.10.6", "sha2", "smallvec", "sqlformat", @@ -4281,9 +4296,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4cef4251aabbae751a3710927945901ee1d97ee96d757f6880ebb9a79bfd53" +checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" dependencies = [ "ahash 0.8.3", "atoi 2.0.0", @@ -4303,7 +4318,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "memchr", "once_cell", @@ -4319,7 +4334,7 @@ dependencies = [ "sqlformat", "thiserror", "time", - "tokio 1.32.0", + "tokio 1.33.0", "tokio-stream", "tracing", "url", @@ -4348,22 +4363,22 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208e3165167afd7f3881b16c1ef3f2af69fa75980897aac8874a0696516d12c2" +checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" dependencies = [ "proc-macro2", "quote", - "sqlx-core 0.7.1", + "sqlx-core 0.7.2", "sqlx-macros-core", "syn 1.0.109", ] [[package]] name = "sqlx-macros-core" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a4a8336d278c62231d87f24e8a7a74898156e34c1c18942857be2acb29c7dfc" +checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" dependencies = [ "dotenvy", "either", @@ -4375,21 +4390,21 @@ dependencies = [ "serde", "serde_json", "sha2", - "sqlx-core 0.7.1", + "sqlx-core 0.7.2", "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", "syn 1.0.109", "tempfile", - "tokio 1.32.0", + "tokio 1.33.0", "url", ] [[package]] name = "sqlx-mysql" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca69bf415b93b60b80dc8fda3cb4ef52b2336614d8da2de5456cc942a110482" +checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" dependencies = [ "atoi 2.0.0", "base64 0.21.4", @@ -4420,10 +4435,10 @@ dependencies = [ "rsa", "rust_decimal", "serde", - "sha1 0.10.5", + "sha1 0.10.6", "sha2", "smallvec", - "sqlx-core 0.7.1", + "sqlx-core 0.7.2", "stringprep", "thiserror", "time", @@ -4434,9 +4449,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0db2df1b8731c3651e204629dd55e52adbae0462fa1bdcbed56a2302c18181e" +checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" dependencies = [ "atoi 2.0.0", "base64 0.21.4", @@ -4465,10 +4480,10 @@ dependencies = [ "rust_decimal", "serde", "serde_json", - "sha1 0.10.5", + "sha1 0.10.6", "sha2", "smallvec", - "sqlx-core 0.7.1", + "sqlx-core 0.7.2", "stringprep", "thiserror", "time", @@ -4484,15 +4499,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "804d3f245f894e61b1e6263c84b23ca675d96753b5abfd5cc8597d86806e8024" dependencies = [ "once_cell", - "tokio 1.32.0", + "tokio 1.33.0", "tokio-rustls", ] [[package]] name = "sqlx-sqlite" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4c21bf34c7cae5b283efb3ac1bcc7670df7561124dc2f8bdc0b59be40f79a2" +checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" dependencies = [ "atoi 2.0.0", "chrono", @@ -4506,7 +4521,7 @@ dependencies = [ "log", "percent-encoding", "serde", - "sqlx-core 0.7.1", + "sqlx-core 0.7.2", "time", "tracing", "url", @@ -4536,12 +4551,34 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + [[package]] name = "strum" version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + [[package]] name = "subtle" version = "2.5.0" @@ -4561,9 +4598,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -4583,9 +4620,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.0.0", + "fastrand 2.0.1", "redox_syscall 0.3.5", - "rustix 0.38.13", + "rustix 0.38.18", "windows-sys 0.48.0", ] @@ -4619,22 +4656,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4649,9 +4686,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa 1.0.9", @@ -4662,15 +4699,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -4720,9 +4757,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes 1.5.0", @@ -4745,7 +4782,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -4755,7 +4792,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls 0.20.9", - "tokio 1.32.0", + "tokio 1.33.0", "webpki", ] @@ -4767,7 +4804,7 @@ checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite 0.2.13", - "tokio 1.32.0", + "tokio 1.33.0", ] [[package]] @@ -4786,15 +4823,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes 1.5.0", "futures-core", "futures-sink", "pin-project-lite 0.2.13", - "tokio 1.32.0", + "tokio 1.33.0", "tracing", ] @@ -4834,7 +4871,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -4862,7 +4899,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -5043,6 +5080,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.4.1" @@ -5096,9 +5139,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" @@ -5143,7 +5186,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -5177,7 +5220,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5197,7 +5240,7 @@ dependencies = [ "askama", "serde", "serde_json", - "tokio 1.32.0", + "tokio 1.33.0", ] [[package]] @@ -5212,12 +5255,12 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.3", + "untrusted 0.9.0", ] [[package]] @@ -5278,9 +5321,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi 0.3.9", ] @@ -5434,9 +5477,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" dependencies = [ "memchr", ] diff --git a/assets/build.js b/assets/build.js index 409770f..da7aabb 100644 --- a/assets/build.js +++ b/assets/build.js @@ -1,14 +1,43 @@ -(()=>{var h=Object.create;var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var g=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var S=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!f.call(e,r)&&r!==s&&n(e,r,{get:()=>t[r],enumerable:!(o=m(t,r))||o.enumerable});return e};var y=(e,t,s)=>(s=e!=null?h(p(e)):{},S(t||!e||!e.__esModule?n(s,"default",{value:e,enumerable:!0}):s,e));customElements.define("oswilno-price",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let e=this.shadowRoot,t=parseInt(this.getAttribute("price"));isNaN(t)&&(t=0);let s=parseInt(this.getAttribute("multiplier")),o=t,r=0;isNaN(s)||(o=Math.floor(t/s),r=t%s);let l=this.getAttribute("currency")||"PLN";e.innerHTML=`
${o}.${r>=10?r:r+"0"} ${l}
`}});var c=e=>{let t="";for(let o=0;o{var h=Object.create;var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var f=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var y=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m(t))!w.call(e,r)&&r!==s&&l(e,r,{get:()=>t[r],enumerable:!(o=p(t,r))||o.enumerable});return e};var g=(e,t,s)=>(s=e!=null?h(u(e)):{},y(t||!e||!e.__esModule?l(s,"default",{value:e,enumerable:!0}):s,e));customElements.define("oswilno-price",class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){let e=this.shadowRoot,t=parseInt(this.getAttribute("price"));isNaN(t)&&(t=0);let s=parseInt(this.getAttribute("multiplier")),o=t,r=0;isNaN(s)||(o=Math.floor(t/s),r=t%s);let n=this.getAttribute("currency")||"PLN";e.innerHTML=`
${o}.${r>=10?r:r+"0"} ${n}
`}});var i=e=>{let t="";for(let o=0;o:host{display:block;}
- `,c(e)}});customElements.define("oswilno-parking-space",class extends HTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=` + `,i(e)}});customElements.define("oswilno-parking-space-rents",class extends HTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=` + +
+ +
+ `}});customElements.define("oswilno-parking-space-rent",class extends HTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=` + +
+ +
+ `}});customElements.define("oswilno-parking-space",class extends HTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=`
- +
- `}});import("https://unpkg.com/htmx.org@1.9.4/dist/htmx.min.js");var a="Authorization",w="ACX-Authorization",i="ACX-Refresh",d=document.body;d.addEventListener("htmx:beforeOnLoad",function(e){let t=e.detail,s=t.xhr,o=s.status,r=t.successful;if(o===200){let l=s.getResponseHeader(a);l&&(console.log(s),localStorage.setItem("jwt",l.replace(/^Bearer /i,""))),s.getResponseHeader(i)&&localStorage.setItem("refresh",l.replace(/^Bearer /i,""))}else o===401&&localStorage.removeItem("jwt");(o===422||o===400)&&(t.shouldSwap=!0,t.isError=!1)});d.addEventListener("htmx:configRequest",function(e){localStorage.getItem("jwt")&&(e.detail.headers[w]="Bearer "+(localStorage.getItem("jwt")||""),e.detail.headers[a]="Bearer "+(localStorage.getItem("jwt")||""),e.detail.headers[i]=localStorage.getItem("refresh")||"")});})(); + `}});customElements.define("oswilno-parking-space-location",class extends HTMLElement{constructor(){super();let e=this.attachShadow({mode:"open"});e.innerHTML=` + +
+ +
+ `}});import("https://unpkg.com/htmx.org@1.9.4/dist/htmx.min.js");var a="Authorization",S="ACX-Authorization",c="ACX-Refresh",d=document.body;d.addEventListener("htmx:beforeOnLoad",function(e){let t=e.detail,s=t.xhr,o=s.status,r=t.successful;if(o===200){let n=s.getResponseHeader(a);n&&(console.log(s),localStorage.setItem("jwt",n.replace(/^Bearer /i,""))),s.getResponseHeader(c)&&localStorage.setItem("refresh",n.replace(/^Bearer /i,""))}else o===401&&localStorage.removeItem("jwt");(o===422||o===400)&&(t.shouldSwap=!0,t.isError=!1)});d.addEventListener("htmx:configRequest",function(e){localStorage.getItem("jwt")&&(e.detail.headers[S]="Bearer "+(localStorage.getItem("jwt")||""),e.detail.headers[a]="Bearer "+(localStorage.getItem("jwt")||""),e.detail.headers[c]=localStorage.getItem("refresh")||"")});})(); //# sourceMappingURL=build.js.map diff --git a/assets/build.js.map b/assets/build.js.map index 2372f16..1e30ce0 100644 --- a/assets/build.js.map +++ b/assets/build.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../crates/web-assets/assets/elements/oswilno-price.js", "../crates/web-assets/assets/css.js", "../crates/web-assets/assets/elements/oswilno-error.js", "../crates/web-assets/assets/elements/oswilno-parking-space.js", "../crates/web-assets/assets/app.js"], - "sourcesContent": ["customElements.define('oswilno-price', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: 'open' });\n\t}\n\tconnectedCallback() {\n\t\tlet shadow = this.shadowRoot;\n\t\tlet price = parseInt(this.getAttribute('price'));\n\t\tif (isNaN(price)) price = 0;\n\t\tconst multiplier = parseInt(this.getAttribute('multiplier'));\n\t\tlet major = price;\n\t\tlet minor = 0;\n\t\tif (!isNaN(multiplier)) {\n\t\t\tmajor = Math.floor(price / multiplier);\n\t\t\tminor = price % multiplier;\n\t\t}\n\t\tconst currency = this.getAttribute('currency') || 'PLN';\n\t\tshadow.innerHTML = `
${major}.${minor >= 10 ? minor : minor + '0'} ${ currency }
`;\n\t}\n});\n", "export const copyCss = (shadow) => {\n\tlet css = '';\n\tfor (let i = 0; i < document.styleSheets.length; i++) {\n\t\tconst styleSheet = document.styleSheets[i];\n\t\tfor (let j = 0; j < styleSheet.rules.length; j++) {\n\t\t\tcss += styleSheet.rules[j].cssText;\t\n\t\t}\n\t}\n\tconst sheet = new CSSStyleSheet();\n\tsheet.replaceSync(css);\n\tshadow.adoptedStyleSheets = [sheet];\n};\n", "import { copyCss } from \"../css.js\";\n\ncustomElements.define('oswilno-error', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: 'open' });\n\t\tshadow.innerHTML = `\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t`;\n\t\tcopyCss(shadow);\n\t}\n});\n", "customElements.define('oswilno-parking-space', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: 'open' });\n\t\tshadow.innerHTML = `\n\t\t\t\n\t\t\t
\n\t\t\t\n\t\t\t
\n\t\t`;\n\t}\n});\n", "import './elements/oswilno-price.js';\nimport './elements/oswilno-error.js';\nimport './elements/oswilno-parking-space.js';\nimport(\"https://unpkg.com/htmx.org@1.9.4/dist/htmx.min.js\");\n\nconst READ_AUTH_HEADER = 'Authorization';\nconst AUTH_HEADER = 'ACX-Authorization';\nconst REFRESH_HEADER = 'ACX-Refresh';\nconst body = document.body;\nbody.addEventListener('htmx:beforeOnLoad', function (evt) {\n\tconst detail = evt.detail;\n\tconst xhr = detail.xhr;\n\tconst status = xhr.status;\n\tconst successful = detail.successful;\n\n\tif (status === 200) {\n\t\tconst bearer = xhr.getResponseHeader(READ_AUTH_HEADER);\n\t\tif (bearer) {\n\t\t\tconsole.log(xhr);\n\t\t\tlocalStorage.setItem('jwt', bearer.replace(/^Bearer /i, ''));\n\t\t}\n\t\tconst refresh = xhr.getResponseHeader(REFRESH_HEADER);\n\t\tif (refresh) {\n\t\t\tlocalStorage.setItem('refresh', bearer.replace(/^Bearer /i, ''));\n\t\t}\n\t} else if (status === 401) {\n\t\tlocalStorage.removeItem('jwt');\n\t}\n\tif (status === 422 || status === 400) {\n\t\tdetail.shouldSwap = true;\n\t\tdetail.isError = false;\n\t}\n});\nbody.addEventListener('htmx:configRequest', function (evt) {\n\tif (!localStorage.getItem('jwt')) {\n\t\treturn;\n\t}\n\tevt.detail.headers[AUTH_HEADER] = 'Bearer ' + (localStorage.getItem('jwt') || '');\n\tevt.detail.headers[READ_AUTH_HEADER] = 'Bearer ' + (localStorage.getItem('jwt') || '');\n\tevt.detail.headers[REFRESH_HEADER] = (localStorage.getItem('refresh') || '');\n});\n\n"], - "mappings": "0sBAAA,eAAe,OAAO,gBAAiB,cAAc,WAAY,CAChE,aAAc,CACb,MAAM,EACN,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,CACnC,CACA,mBAAoB,CACnB,IAAIA,EAAS,KAAK,WACdC,EAAQ,SAAS,KAAK,aAAa,OAAO,CAAC,EAC3C,MAAMA,CAAK,IAAGA,EAAQ,GAC1B,IAAMC,EAAa,SAAS,KAAK,aAAa,YAAY,CAAC,EACvDC,EAAQF,EACRG,EAAQ,EACP,MAAMF,CAAU,IACpBC,EAAQ,KAAK,MAAMF,EAAQC,CAAU,EACrCE,EAAQH,EAAQC,GAEjB,IAAMG,EAAW,KAAK,aAAa,UAAU,GAAK,MAClDL,EAAO,UAAY,4CAA4CG,CAAK,IAAIC,GAAS,GAAKA,EAAQA,EAAQ,GAAG,IAAKC,CAAS,QACxH,CACD,CAAC,ECnBM,IAAMC,EAAWC,GAAW,CAClC,IAAIC,EAAM,GACV,QAASC,EAAI,EAAGA,EAAI,SAAS,YAAY,OAAQA,IAAK,CACrD,IAAMC,EAAa,SAAS,YAAYD,CAAC,EACzC,QAASE,EAAI,EAAGA,EAAID,EAAW,MAAM,OAAQC,IAC5CH,GAAOE,EAAW,MAAMC,CAAC,EAAE,OAE7B,CACA,IAAMC,EAAQ,IAAI,cAClBA,EAAM,YAAYJ,CAAG,EACrBD,EAAO,mBAAqB,CAACK,CAAK,CACnC,ECTA,eAAe,OAAO,gBAAiB,cAAc,WAAY,CAChE,aAAc,CACb,MAAM,EACN,IAAMC,EAAS,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EACjDA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnBC,EAAQD,CAAM,CACf,CACD,CAAC,ECdD,eAAe,OAAO,wBAAyB,cAAc,WAAY,CACxE,aAAc,CACb,MAAM,EACN,IAAME,EAAS,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EACjDA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQpB,CACD,CAAC,ECVD,OAAO,mDAAmD,EAE1D,IAAMC,EAAmB,gBACnBC,EAAc,oBACdC,EAAiB,cACjBC,EAAO,SAAS,KACtBA,EAAK,iBAAiB,oBAAqB,SAAUC,EAAK,CACzD,IAAMC,EAASD,EAAI,OACbE,EAAMD,EAAO,IACbE,EAASD,EAAI,OACbE,EAAaH,EAAO,WAE1B,GAAIE,IAAW,IAAK,CACnB,IAAME,EAASH,EAAI,kBAAkBN,CAAgB,EACjDS,IACH,QAAQ,IAAIH,CAAG,EACf,aAAa,QAAQ,MAAOG,EAAO,QAAQ,YAAa,EAAE,CAAC,GAE5CH,EAAI,kBAAkBJ,CAAc,GAEnD,aAAa,QAAQ,UAAWO,EAAO,QAAQ,YAAa,EAAE,CAAC,CAEjE,MAAWF,IAAW,KACrB,aAAa,WAAW,KAAK,GAE1BA,IAAW,KAAOA,IAAW,OAChCF,EAAO,WAAa,GACpBA,EAAO,QAAU,GAEnB,CAAC,EACDF,EAAK,iBAAiB,qBAAsB,SAAUC,EAAK,CACrD,aAAa,QAAQ,KAAK,IAG/BA,EAAI,OAAO,QAAQH,CAAW,EAAI,WAAa,aAAa,QAAQ,KAAK,GAAK,IAC9EG,EAAI,OAAO,QAAQJ,CAAgB,EAAI,WAAa,aAAa,QAAQ,KAAK,GAAK,IACnFI,EAAI,OAAO,QAAQF,CAAc,EAAK,aAAa,QAAQ,SAAS,GAAK,GAC1E,CAAC", - "names": ["shadow", "price", "multiplier", "major", "minor", "currency", "copyCss", "shadow", "css", "i", "styleSheet", "j", "sheet", "shadow", "copyCss", "shadow", "READ_AUTH_HEADER", "AUTH_HEADER", "REFRESH_HEADER", "body", "evt", "detail", "xhr", "status", "successful", "bearer"] + "sources": ["../crates/web-assets/assets/elements/oswilno-price.js", "../crates/web-assets/assets/css.js", "../crates/web-assets/assets/elements/oswilno-error.js", "../crates/web-assets/assets/elements/oswilno-parking-space-rents.js", "../crates/web-assets/assets/elements/oswilno-parking-space-rent.js", "../crates/web-assets/assets/elements/oswilno-parking-space.js", "../crates/web-assets/assets/elements/oswilno-parking-space-location.js", "../crates/web-assets/assets/app.js"], + "sourcesContent": ["customElements.define('oswilno-price', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: 'open' });\n\t}\n\tconnectedCallback() {\n\t\tlet shadow = this.shadowRoot;\n\t\tlet price = parseInt(this.getAttribute('price'));\n\t\tif (isNaN(price)) price = 0;\n\t\tconst multiplier = parseInt(this.getAttribute('multiplier'));\n\t\tlet major = price;\n\t\tlet minor = 0;\n\t\tif (!isNaN(multiplier)) {\n\t\t\tmajor = Math.floor(price / multiplier);\n\t\t\tminor = price % multiplier;\n\t\t}\n\t\tconst currency = this.getAttribute('currency') || 'PLN';\n\t\tshadow.innerHTML = `
${major}.${minor >= 10 ? minor : minor + '0'} ${ currency }
`;\n\t}\n});\n", "export const copyCss = (shadow) => {\n\tlet css = '';\n\tfor (let i = 0; i < document.styleSheets.length; i++) {\n\t\tconst styleSheet = document.styleSheets[i];\n\t\tfor (let j = 0; j < styleSheet.rules.length; j++) {\n\t\t\tcss += styleSheet.rules[j].cssText;\t\n\t\t}\n\t}\n\tconst sheet = new CSSStyleSheet();\n\tsheet.replaceSync(css);\n\tshadow.adoptedStyleSheets = [sheet];\n};\n", "import { copyCss } from \"../css.js\";\n\ncustomElements.define('oswilno-error', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: 'open' });\n\t\tshadow.innerHTML = `\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t`;\n\t\tcopyCss(shadow);\n\t}\n});\n", "customElements.define('oswilno-parking-space-rents', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: 'open' });\n\t\tshadow.innerHTML = `\n\t\t\t\n\t\t\t
\n \n\t\t\t
\n\t\t`;\n\t}\n});\n\n", "customElements.define('oswilno-parking-space-rent', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: 'open' });\n\t\tshadow.innerHTML = `\n\t\t\t\n\t\t\t
\n \n\t\t\t
\n\t\t`;\n\t}\n});\n", "customElements.define('oswilno-parking-space', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: 'open' });\n\t\tshadow.innerHTML = `\n\t\t\t\n\t\t\t
\n \n\t\t\t
\n\t\t`;\n\t}\n});\n", "customElements.define('oswilno-parking-space-location', class extends HTMLElement {\n\tconstructor() {\n\t\tsuper();\n\t\tconst shadow = this.attachShadow({ mode: 'open' });\n\t\tshadow.innerHTML = `\n\t\t\t\n\t\t\t
\n \n\t\t\t
\n\t\t`;\n\t}\n});\n", "import './elements/oswilno-price.js';\nimport './elements/oswilno-error.js';\nimport './elements/oswilno-parking-space-rents.js';\nimport './elements/oswilno-parking-space-rent.js';\nimport './elements/oswilno-parking-space.js';\nimport './elements/oswilno-parking-space-location.js';\n\nimport(\"https://unpkg.com/htmx.org@1.9.4/dist/htmx.min.js\");\n\nconst READ_AUTH_HEADER = 'Authorization';\nconst AUTH_HEADER = 'ACX-Authorization';\nconst REFRESH_HEADER = 'ACX-Refresh';\nconst body = document.body;\nbody.addEventListener('htmx:beforeOnLoad', function (evt) {\n\tconst detail = evt.detail;\n\tconst xhr = detail.xhr;\n\tconst status = xhr.status;\n\tconst successful = detail.successful;\n\n\tif (status === 200) {\n\t\tconst bearer = xhr.getResponseHeader(READ_AUTH_HEADER);\n\t\tif (bearer) {\n\t\t\tconsole.log(xhr);\n\t\t\tlocalStorage.setItem('jwt', bearer.replace(/^Bearer /i, ''));\n\t\t}\n\t\tconst refresh = xhr.getResponseHeader(REFRESH_HEADER);\n\t\tif (refresh) {\n\t\t\tlocalStorage.setItem('refresh', bearer.replace(/^Bearer /i, ''));\n\t\t}\n\t} else if (status === 401) {\n\t\tlocalStorage.removeItem('jwt');\n\t}\n\tif (status === 422 || status === 400) {\n\t\tdetail.shouldSwap = true;\n\t\tdetail.isError = false;\n\t}\n});\nbody.addEventListener('htmx:configRequest', function (evt) {\n\tif (!localStorage.getItem('jwt')) {\n\t\treturn;\n\t}\n\tevt.detail.headers[AUTH_HEADER] = 'Bearer ' + (localStorage.getItem('jwt') || '');\n\tevt.detail.headers[READ_AUTH_HEADER] = 'Bearer ' + (localStorage.getItem('jwt') || '');\n\tevt.detail.headers[REFRESH_HEADER] = (localStorage.getItem('refresh') || '');\n});\n\n"], + "mappings": "0sBAAA,eAAe,OAAO,gBAAiB,cAAc,WAAY,CAChE,aAAc,CACb,MAAM,EACN,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,CACnC,CACA,mBAAoB,CACnB,IAAIA,EAAS,KAAK,WACdC,EAAQ,SAAS,KAAK,aAAa,OAAO,CAAC,EAC3C,MAAMA,CAAK,IAAGA,EAAQ,GAC1B,IAAMC,EAAa,SAAS,KAAK,aAAa,YAAY,CAAC,EACvDC,EAAQF,EACRG,EAAQ,EACP,MAAMF,CAAU,IACpBC,EAAQ,KAAK,MAAMF,EAAQC,CAAU,EACrCE,EAAQH,EAAQC,GAEjB,IAAMG,EAAW,KAAK,aAAa,UAAU,GAAK,MAClDL,EAAO,UAAY,4CAA4CG,CAAK,IAAIC,GAAS,GAAKA,EAAQA,EAAQ,GAAG,IAAKC,CAAS,QACxH,CACD,CAAC,ECnBM,IAAMC,EAAWC,GAAW,CAClC,IAAIC,EAAM,GACV,QAASC,EAAI,EAAGA,EAAI,SAAS,YAAY,OAAQA,IAAK,CACrD,IAAMC,EAAa,SAAS,YAAYD,CAAC,EACzC,QAASE,EAAI,EAAGA,EAAID,EAAW,MAAM,OAAQC,IAC5CH,GAAOE,EAAW,MAAMC,CAAC,EAAE,OAE7B,CACA,IAAMC,EAAQ,IAAI,cAClBA,EAAM,YAAYJ,CAAG,EACrBD,EAAO,mBAAqB,CAACK,CAAK,CACnC,ECTA,eAAe,OAAO,gBAAiB,cAAc,WAAY,CAChE,aAAc,CACb,MAAM,EACN,IAAMC,EAAS,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EACjDA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA,IAMnBC,EAAQD,CAAM,CACf,CACD,CAAC,ECdD,eAAe,OAAO,8BAA+B,cAAc,WAAY,CAC9E,aAAc,CACb,MAAM,EACN,IAAME,EAAS,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EACjDA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAgBpB,CACD,CAAC,ECrBD,eAAe,OAAO,6BAA8B,cAAc,WAAY,CAC7E,aAAc,CACb,MAAM,EACN,IAAMC,EAAS,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EACjDA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQpB,CACD,CAAC,ECbD,eAAe,OAAO,wBAAyB,cAAc,WAAY,CACxE,aAAc,CACb,MAAM,EACN,IAAMC,EAAS,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EACjDA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQpB,CACD,CAAC,ECbD,eAAe,OAAO,iCAAkC,cAAc,WAAY,CACjF,aAAc,CACb,MAAM,EACN,IAAMC,EAAS,KAAK,aAAa,CAAE,KAAM,MAAO,CAAC,EACjDA,EAAO,UAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQpB,CACD,CAAC,ECND,OAAO,mDAAmD,EAE1D,IAAMC,EAAmB,gBACnBC,EAAc,oBACdC,EAAiB,cACjBC,EAAO,SAAS,KACtBA,EAAK,iBAAiB,oBAAqB,SAAUC,EAAK,CACzD,IAAMC,EAASD,EAAI,OACbE,EAAMD,EAAO,IACbE,EAASD,EAAI,OACbE,EAAaH,EAAO,WAE1B,GAAIE,IAAW,IAAK,CACnB,IAAME,EAASH,EAAI,kBAAkBN,CAAgB,EACjDS,IACH,QAAQ,IAAIH,CAAG,EACf,aAAa,QAAQ,MAAOG,EAAO,QAAQ,YAAa,EAAE,CAAC,GAE5CH,EAAI,kBAAkBJ,CAAc,GAEnD,aAAa,QAAQ,UAAWO,EAAO,QAAQ,YAAa,EAAE,CAAC,CAEjE,MAAWF,IAAW,KACrB,aAAa,WAAW,KAAK,GAE1BA,IAAW,KAAOA,IAAW,OAChCF,EAAO,WAAa,GACpBA,EAAO,QAAU,GAEnB,CAAC,EACDF,EAAK,iBAAiB,qBAAsB,SAAUC,EAAK,CACrD,aAAa,QAAQ,KAAK,IAG/BA,EAAI,OAAO,QAAQH,CAAW,EAAI,WAAa,aAAa,QAAQ,KAAK,GAAK,IAC9EG,EAAI,OAAO,QAAQJ,CAAgB,EAAI,WAAa,aAAa,QAAQ,KAAK,GAAK,IACnFI,EAAI,OAAO,QAAQF,CAAc,EAAK,aAAa,QAAQ,SAAS,GAAK,GAC1E,CAAC", + "names": ["shadow", "price", "multiplier", "major", "minor", "currency", "copyCss", "shadow", "css", "i", "styleSheet", "j", "sheet", "shadow", "copyCss", "shadow", "shadow", "shadow", "shadow", "READ_AUTH_HEADER", "AUTH_HEADER", "REFRESH_HEADER", "body", "evt", "detail", "xhr", "status", "successful", "bearer"] } diff --git a/assets/style.css b/assets/style.css index a296dcf..40ec808 100644 --- a/assets/style.css +++ b/assets/style.css @@ -905,6 +905,10 @@ select { width: 2rem; } +.w-\[48\%\] { + width: 48%; +} + .w-full { width: 100%; } diff --git a/crates/migration/src/m20230805_000001_add_email.rs b/crates/migration/src/m20230805_000001_add_email.rs index 2e326ff..c3d40eb 100644 --- a/crates/migration/src/m20230805_000001_add_email.rs +++ b/crates/migration/src/m20230805_000001_add_email.rs @@ -1,6 +1,7 @@ -use crate::m20220101_000001_create_table::Account; use sea_orm_migration::prelude::*; +use crate::m20220101_000001_create_table::Account; + #[derive(DeriveMigrationName)] pub struct Migration; diff --git a/crates/migration/src/m20230919_162830_create_rent_requests.rs b/crates/migration/src/m20230919_162830_create_rent_requests.rs index 18a0547..b9fc6f5 100644 --- a/crates/migration/src/m20230919_162830_create_rent_requests.rs +++ b/crates/migration/src/m20230919_162830_create_rent_requests.rs @@ -1,8 +1,7 @@ use sea_orm_migration::prelude::*; use crate::m20220101_000001_create_table::Account; -use crate::m20230726_135630_parking_spaces::ParkingSpace; -use crate::m20230726_135630_parking_spaces::ParkingSpaceRent; +use crate::m20230726_135630_parking_spaces::{ParkingSpace, ParkingSpaceRent}; #[derive(DeriveMigrationName)] pub struct Migration; diff --git a/crates/oswilno-admin/Cargo.toml b/crates/oswilno-admin/Cargo.toml index 5e3e778..670947c 100644 --- a/crates/oswilno-admin/Cargo.toml +++ b/crates/oswilno-admin/Cargo.toml @@ -5,8 +5,8 @@ edition = "2021" [dependencies] # actix-admin = "0.5.0" -# actix-admin = { git = "https://github.com/Eraden/actix-admin.git", features = ['enable-tracing'] } -actix-admin = { git = "https://code.ita-prog.pl/Tsumanu/actix-admin.git", features = ['enable-tracing'] } +actix-admin = { git = "https://github.com/mgugger/actix-admin.git" } +# actix-admin = { git = "https://code.ita-prog.pl/Tsumanu/actix-admin.git", features = ['enable-tracing'] } actix-web = "4.3.1" actix-web-grants = "3.0.2" askama = "0.12.0" diff --git a/crates/oswilno-admin/src/lib.rs b/crates/oswilno-admin/src/lib.rs index b5fb659..b5f4e02 100644 --- a/crates/oswilno-admin/src/lib.rs +++ b/crates/oswilno-admin/src/lib.rs @@ -17,6 +17,7 @@ fn create_actix_admin_builder() -> ActixAdminBuilder { logout_link: None, file_upload_directory: "./file_uploads", navbar_title: "oswilno - admin", + user_tenant_ref: None, }; let mut admin_builder = ActixAdminBuilder::new(configuration); diff --git a/crates/oswilno-contract/Cargo.toml b/crates/oswilno-contract/Cargo.toml index b5350e4..1718403 100644 --- a/crates/oswilno-contract/Cargo.toml +++ b/crates/oswilno-contract/Cargo.toml @@ -7,9 +7,10 @@ edition = "2021" actix = "0.13.0" # actix-admin = "0.5.0" # actix-admin = { git = "https://github.com/Eraden/actix-admin.git", features = ['enable-tracing'] } -actix-admin = { git = "https://code.ita-prog.pl/Tsumanu/actix-admin.git", features = ['enable-tracing'] } +actix-admin = { git = "https://github.com/mgugger/actix-admin.git" } +# actix-admin = { git = "https://code.ita-prog.pl/Tsumanu/actix-admin.git", features = ['enable-tracing'] } actix-rt = { version = "2.8.0", features = [] } -chrono = "0.4.26" +chrono = { version = "0.4.26", features = ["serde"] } oswilno-actix-admin = { path = "../oswilno-actix-admin" } regex = "1.9.1" sea-orm = { version = "0.12", features = ["postgres-array", "runtime-actix-rustls", "sqlx-postgres", "macros", "sqlx"] } diff --git a/crates/oswilno-contract/src/accounts.rs b/crates/oswilno-contract/src/accounts.rs index 61a5b40..cec04bc 100644 --- a/crates/oswilno-contract/src/accounts.rs +++ b/crates/oswilno-contract/src/accounts.rs @@ -1,11 +1,12 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 -use super::sea_orm_active_enums::Userrole; use actix_admin::prelude::*; use sea_orm::entity::prelude::*; #[allow(unused_imports)] use sea_orm::Iterable; +use super::sea_orm_active_enums::Userrole; + #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; diff --git a/crates/oswilno-contract/src/images.rs b/crates/oswilno-contract/src/images.rs index 01d3b47..ef0a919 100644 --- a/crates/oswilno-contract/src/images.rs +++ b/crates/oswilno-contract/src/images.rs @@ -1,11 +1,12 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 -use super::sea_orm_active_enums::ImageState; use actix_admin::prelude::*; use sea_orm::entity::prelude::*; #[allow(unused_imports)] use sea_orm::Iterable; +use super::sea_orm_active_enums::ImageState; + #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; diff --git a/crates/oswilno-contract/src/lib.rs b/crates/oswilno-contract/src/lib.rs index 4d4c637..6a18b97 100644 --- a/crates/oswilno-contract/src/lib.rs +++ b/crates/oswilno-contract/src/lib.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 pub mod prelude; @@ -9,5 +9,4 @@ pub mod parking_space_rents; pub mod parking_spaces; pub mod rent_requests; pub mod sea_orm_active_enums; -pub use actix_admin; -pub use sea_orm; +pub use {::chrono, actix_admin, sea_orm}; diff --git a/crates/oswilno-contract/src/parking_space_locations.rs b/crates/oswilno-contract/src/parking_space_locations.rs index d5452e5..24ba8f9 100644 --- a/crates/oswilno-contract/src/parking_space_locations.rs +++ b/crates/oswilno-contract/src/parking_space_locations.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 use actix_admin::prelude::*; use sea_orm::entity::prelude::*; diff --git a/crates/oswilno-contract/src/parking_space_rents.rs b/crates/oswilno-contract/src/parking_space_rents.rs index 71c0485..f319ae2 100644 --- a/crates/oswilno-contract/src/parking_space_rents.rs +++ b/crates/oswilno-contract/src/parking_space_rents.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 use actix_admin::prelude::*; use sea_orm::entity::prelude::*; diff --git a/crates/oswilno-contract/src/parking_spaces.rs b/crates/oswilno-contract/src/parking_spaces.rs index 4ef55fe..d760876 100644 --- a/crates/oswilno-contract/src/parking_spaces.rs +++ b/crates/oswilno-contract/src/parking_spaces.rs @@ -1,11 +1,12 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 -use super::sea_orm_active_enums::ParkingSpaceState; use actix_admin::prelude::*; use sea_orm::entity::prelude::*; #[allow(unused_imports)] use sea_orm::Iterable; +use super::sea_orm_active_enums::ParkingSpaceState; + #[derive(Copy, Clone, Default, Debug, DeriveEntity)] pub struct Entity; diff --git a/crates/oswilno-contract/src/prelude.rs b/crates/oswilno-contract/src/prelude.rs index 179afd2..93fd324 100644 --- a/crates/oswilno-contract/src/prelude.rs +++ b/crates/oswilno-contract/src/prelude.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 pub use super::accounts::Entity as Accounts; pub use super::images::Entity as Images; diff --git a/crates/oswilno-contract/src/rent_requests.rs b/crates/oswilno-contract/src/rent_requests.rs index a802fd5..c9d8b35 100644 --- a/crates/oswilno-contract/src/rent_requests.rs +++ b/crates/oswilno-contract/src/rent_requests.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 use actix_admin::prelude::*; use sea_orm::entity::prelude::*; diff --git a/crates/oswilno-contract/src/sea_orm_active_enums.rs b/crates/oswilno-contract/src/sea_orm_active_enums.rs index 113040e..f40bf37 100644 --- a/crates/oswilno-contract/src/sea_orm_active_enums.rs +++ b/crates/oswilno-contract/src/sea_orm_active_enums.rs @@ -1,4 +1,4 @@ -//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.2 +//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.3 use actix_admin::prelude::*; use sea_orm::entity::prelude::*; diff --git a/crates/oswilno-parking-space/src/lib.rs b/crates/oswilno-parking-space/src/lib.rs index aeddd45..c4024b9 100644 --- a/crates/oswilno-parking-space/src/lib.rs +++ b/crates/oswilno-parking-space/src/lib.rs @@ -1,15 +1,20 @@ +#![feature(result_option_inspect)] +use std::collections::BTreeMap; +use std::rc::Rc; +use std::sync::Arc; + use actix_web::http::header::ContentType; use actix_web::web::{scope, Data, Form, Path, ServiceConfig}; use actix_web::{get, post, put, HttpRequest, HttpResponse}; use askama_actix::Template; use autometrics::autometrics; use oswilno_contract::parking_space_locations::Model as ParkingSpaceLocation; -use oswilno_contract::parking_space_rents; use oswilno_contract::parking_space_rents::Model as ParkingSpaceRent; -use oswilno_contract::parking_spaces; use oswilno_contract::parking_spaces::Model as ParkingSpace; use oswilno_contract::sea_orm_active_enums::ParkingSpaceState; -use oswilno_contract::{accounts, parking_space_locations}; +use oswilno_contract::{ + accounts, chrono, parking_space_locations, parking_space_rents, parking_spaces, +}; use oswilno_session::{Authenticated, MaybeAuthenticated}; use oswilno_view::{ filters, is_partial, Blank, Errors, HelperContext, Layout, Main, MainOpts, SearchOpts, @@ -19,9 +24,6 @@ use sea_orm::prelude::*; use sea_orm::ActiveValue::{NotSet, Set}; use sea_orm::QueryOrder; use serde::Deserialize; -use std::collections::BTreeMap; -use std::rc::Rc; -use std::sync::Arc; pub async fn init(db: Arc) { ensure_locations(db).await; @@ -490,48 +492,38 @@ async fn parking_space_rent_form( ) -> HttpResponse { let parking_space_id = parking_space_id.into_inner(); let db = db.into_inner(); - let _account_id = session.as_ref().map(|s| s.account_id()); - let parking_space = { - use ::oswilno_contract::parking_spaces::{Column, Entity}; - let res = Entity::find() - .filter(Column::Id.eq(parking_space_id)) - .one(&*db) - .await; - match res { - Ok(Some(entity)) => entity, - error => { - tracing::debug!("Parking space does not exists: {error:?}"); - return HttpResponse::NotFound() - .body("Invalid request, parking space does not exists"); - } - } + let account_id = session.as_ref().map(|s| s.account_id()); + let q = parking_spaces::Entity::find().filter(parking_spaces::Column::Id.eq(parking_space_id)); + + let Ok(Some(parking_space)) = match account_id { + Some(id) => q.filter(parking_spaces::Column::AccountId.eq(id)), + None => q, + } + .one(&*db) + .await + .inspect_err(|error| tracing::debug!("Parking space does not exists: {error:?}")) else { + return HttpResponse::NotFound().body("Invalid request, parking space does not exists"); }; - let location = { - use ::oswilno_contract::parking_space_locations::{Column, Entity}; - let Some(location_id) = parking_space.location_id else { - tracing::debug!("Parking space does not have location id"); - return HttpResponse::NotFound() - .body("Invalid request, parking space does not have location"); - }; - let res = Entity::find() - .filter(Column::Id.eq(location_id)) - .one(&*db) - .await; - match res { - Ok(Some(entity)) => entity, - error => { - tracing::debug!("Parking space location does not exists: {error:?}"); - return HttpResponse::NotFound() - .body("Invalid request, parking space location does not exists"); - } - } + let Some(location_id) = parking_space.location_id else { + tracing::debug!("Parking space does not have location id"); + return HttpResponse::NotFound() + .body("Invalid request, parking space does not have location"); + }; + let Ok(Some(location)) = parking_space_locations::Entity::find() + .filter(parking_space_locations::Column::Id.eq(location_id)) + .one(&*db) + .await + .inspect_err(|error| tracing::debug!("Parking space location does not exists: {error:?}")) + else { + return HttpResponse::NotFound() + .body("Invalid request, parking space location does not exists"); }; let html = render_rent_form( ParkingSpaceRentForm::default(), &req, parking_space, location, - session, + session.into_option().map(Into::into), hcx, ); HttpResponse::Ok() @@ -547,20 +539,223 @@ async fn parking_space_rent_form( .body(html) } #[get("/{parking_space_id}/parking-space-rents/edit/{id}")] -async fn parking_space_rent_edit(_id: Path) -> HttpResponse { - todo!() +async fn parking_space_rent_edit( + req: HttpRequest, + id: Path, + parking_space_id: Path, + session: Authenticated, + db: Data, + hcx: HelperContext, +) -> HttpResponse { + let parking_space_id = parking_space_id.into_inner(); + let id = id.into_inner(); + let db = db.into_inner(); + let account_id = session.account_id(); + let session = session.into(); + + let Ok(Some(parking_space)) = parking_spaces::Entity::find() + .filter(parking_spaces::Column::Id.eq(parking_space_id)) + .filter(parking_spaces::Column::AccountId.eq(account_id)) + .one(&*db) + .await + .inspect_err(|error| tracing::debug!("Parking space does not exists: {error:?}")) + else { + return HttpResponse::NotFound().body("Invalid request, parking space does not exists"); + }; + let Ok(Some(rent)) = parking_space_rents::Entity::find() + .filter(parking_space_rents::Column::Id.eq(id)) + .filter(parking_space_rents::Column::ParkingSpaceId.eq(parking_space_id)) + .one(&*db) + .await + .inspect_err(|e| tracing::warn!("Parking space rent {id} not found: {e}")) + else { + return HttpResponse::NotFound() + .body("Invalid request, parking space rent does not exists"); + }; + let Some(location_id) = parking_space.location_id else { + tracing::debug!("Parking space does not have location id"); + return HttpResponse::NotFound() + .body("Invalid request, parking space does not have location"); + }; + let Ok(Some(location)) = parking_space_locations::Entity::find() + .filter(parking_space_locations::Column::Id.eq(location_id)) + .one(&*db) + .await + .inspect_err(|error| tracing::debug!("Parking space location does not exists: {error:?}")) + else { + return HttpResponse::NotFound() + .body("Invalid request, parking space location does not exists"); + }; + let html = render_rent_form( + ParkingSpaceRentForm { + price: None, + id: Some(id), + price_f: Some(rent.price as f64 / 100.0), + }, + &req, + parking_space, + location, + Some(session), + hcx, + ); + HttpResponse::Ok() + .append_header(( + "HX-Redirect", + format!("/parking-spaces/{parking_space_id}/parking-space-rents/{id}/edit",).as_str(), + )) + .append_header(("HX-Retarget", "main")) + .body(html) } #[post("/{parking_space_id}/parking-space-rents/create")] -async fn parking_space_rent_create(form: Form) -> HttpResponse { +async fn parking_space_rent_create( + req: HttpRequest, + form: Form, + parking_space_id: Path, + db: Data, + session: Authenticated, + hcx: HelperContext, +) -> HttpResponse { + let account_id = session.account_id(); + let session = session.into(); + let db = db.into_inner(); + let parking_space_id = parking_space_id.into_inner(); let mut form = form.into_inner(); form.price = form.price_f.map(|n| n * 100.0).map(|n| n as i32); - todo!() + let Ok(Some(parking_space)) = parking_spaces::Entity::find() + .filter(parking_spaces::Column::Id.eq(parking_space_id)) + .filter(parking_spaces::Column::AccountId.eq(account_id)) + .one(&*db) + .await + else { + return HttpResponse::InternalServerError() + .body("Invalid request, parking space does not exists"); + }; + let Some(location_id) = parking_space.location_id else { + tracing::debug!("Parking space does not have location id"); + return HttpResponse::NotFound() + .body("Invalid request, parking space does not have location"); + }; + let Ok(Some(location)) = parking_space_locations::Entity::find() + .filter(parking_space_locations::Column::Id.eq(location_id)) + .one(&*db) + .await + .inspect_err(|error| tracing::debug!("Parking space location does not exists: {error:?}")) + else { + return HttpResponse::NotFound() + .body("Invalid request, parking space location does not exists"); + }; + let Some(price) = form.price else { + return HttpResponse::BadRequest().body(render_rent_form( + form, + &req, + parking_space, + location, + Some(session), + hcx.clone(), + )); + }; + let entity = parking_space_rents::ActiveModel { + price: Set(price), + parking_space_id: Set(parking_space.id), + ..Default::default() + }; + let Ok(_rent) = entity.save(&*db).await.inspect_err(|e| { + tracing::error!( + "Failed to create new rent for parking space {}: {e}", + parking_space.id + ) + }) else { + return HttpResponse::BadRequest().body(render_rent_form( + form, + &req, + parking_space, + location, + Some(session), + hcx.clone(), + )); + }; + HttpResponse::SeeOther() + .append_header(("HX-Redirect", "/parking-spaces/all")) + .append_header(("Location", "/parking-spaces/all")) + .body("") } #[put("/{parking_space_id}/parking-space-rents/update")] -async fn parking_space_rent_update(form: Form) -> HttpResponse { +async fn parking_space_rent_update( + req: HttpRequest, + form: Form, + parking_space_id: Path, + db: Data, + session: Authenticated, + hcx: HelperContext, +) -> HttpResponse { + let account_id = session.account_id(); + let session = session.into(); + let db = db.into_inner(); + let parking_space_id = parking_space_id.into_inner(); let mut form = form.into_inner(); form.price = form.price_f.map(|n| n * 100.0).map(|n| n as i32); - todo!() + let Some(rent_id) = form.id else { + return HttpResponse::InternalServerError().body("Requires rent ID to update"); + }; + let Ok(Some(parking_space)) = parking_spaces::Entity::find() + .filter(parking_spaces::Column::Id.eq(parking_space_id)) + .filter(parking_spaces::Column::AccountId.eq(account_id)) + .one(&*db) + .await + else { + return HttpResponse::InternalServerError() + .body("Invalid request, parking space does not exists"); + }; + let Some(location_id) = parking_space.location_id else { + tracing::debug!("Parking space does not have location id"); + return HttpResponse::NotFound() + .body("Invalid request, parking space does not have location"); + }; + let Ok(Some(location)) = parking_space_locations::Entity::find() + .filter(parking_space_locations::Column::Id.eq(location_id)) + .one(&*db) + .await + .inspect_err(|error| tracing::debug!("Parking space location does not exists: {error:?}")) + else { + return HttpResponse::NotFound() + .body("Invalid request, parking space location does not exists"); + }; + let Some(price) = form.price else { + return HttpResponse::BadRequest().body(render_rent_form( + form, + &req, + parking_space, + location, + Some(session), + hcx.clone(), + )); + }; + let entity = parking_space_rents::ActiveModel { + id: Set(rent_id), + price: Set(price), + parking_space_id: Set(parking_space.id), + updated_at: Set(chrono::Utc::now().naive_utc()), + ..Default::default() + }; + let Ok(_rent) = entity.save(&*db).await.inspect_err(|e| { + tracing::error!( + "Failed to create new rent for parking space {}: {e}", + parking_space.id + ) + }) else { + return HttpResponse::BadRequest().body(render_rent_form( + form, + &req, + parking_space, + location, + Some(session), + hcx.clone(), + )); + }; + HttpResponse::SeeOther() + .append_header(("HX-Redirect", "/parking-spaces/all")) + .append_header(("Location", "/parking-spaces/all")) + .body("") } fn render_rent_form( @@ -568,7 +763,7 @@ fn render_rent_form( req: &HttpRequest, parking_space: ParkingSpace, location: ParkingSpaceLocation, - session: MaybeAuthenticated, + session: Option, hcx: HelperContext, ) -> String { let body = ParkingSpaceRentFormTemplate { @@ -583,7 +778,7 @@ fn render_rent_form( opts: MainOpts { show: true, search: None, - session: session.into_option().map(Into::into), + session, }, hcx: hcx.clone(), }; diff --git a/crates/oswilno-parking-space/templates/parking-spaces/all-partial.html b/crates/oswilno-parking-space/templates/parking-spaces/all-partial.html index e2c6bf8..02595cd 100644 --- a/crates/oswilno-parking-space/templates/parking-spaces/all-partial.html +++ b/crates/oswilno-parking-space/templates/parking-spaces/all-partial.html @@ -47,58 +47,7 @@ {% include "./single_parking_space.html" %} {% include "./parking_space_state.html" %} - -
- {% if parking_space.state == ParkingSpaceState::Verified %} - - - - - - - {% endif %} - {% if parking_space.state != ParkingSpaceState::Banned %} - - - - - - - - - - - - - - - - - - - - - - - {% endif %} -
+ {% include "./parking_space_actions.html" %}
{% endif %} @@ -118,16 +67,38 @@ {% if let Some(parking_space) = parking_space_by_id.get(parking_space_rent.parking_space_id) %} {% if parking_space.state == ParkingSpaceState::Verified || Some(parking_space.account_id.clone()) == account_id %} {% if let Some(account) = account_by_id.get(parking_space.account_id) %} + {% if let Some(location_id) = parking_space.location_id -%} + {% if let Some(location) = location_by_id.get(location_id) -%} + - + + + +
{{ account.login }}
- + {{ parking_space_rent.price }}
+ + {% endif %} + {% endif %} {% endif %} {% endif %} {% endif %} diff --git a/crates/oswilno-parking-space/templates/parking-spaces/parking_space_actions.html b/crates/oswilno-parking-space/templates/parking-spaces/parking_space_actions.html new file mode 100644 index 0000000..638142b --- /dev/null +++ b/crates/oswilno-parking-space/templates/parking-spaces/parking_space_actions.html @@ -0,0 +1,51 @@ +
+ {% if parking_space.state == ParkingSpaceState::Verified %} + + + + + + + {% endif %} + {% if parking_space.state != ParkingSpaceState::Banned %} + + + + + + + + + + + + + + + + + + + + + + + {% endif %} +
diff --git a/crates/oswilno-server/src/main.rs b/crates/oswilno-server/src/main.rs index dc25666..fc6260f 100644 --- a/crates/oswilno-server/src/main.rs +++ b/crates/oswilno-server/src/main.rs @@ -1,3 +1,4 @@ +#![feature(result_option_inspect)] use std::sync::Arc; use std::time::Duration; diff --git a/crates/oswilno-session/src/lib.rs b/crates/oswilno-session/src/lib.rs index 3a40a4c..281782e 100644 --- a/crates/oswilno-session/src/lib.rs +++ b/crates/oswilno-session/src/lib.rs @@ -1,3 +1,4 @@ +#![feature(result_option_inspect)] use std::sync::Arc; pub use actix_jwt_session::*; @@ -7,12 +8,11 @@ use actix_web::{get, post, HttpRequest, HttpResponse}; use askama_actix::Template; use autometrics::autometrics; use garde::Validate; +pub use oswilno_view::filters; use oswilno_view::{Blank, Errors, HelperContext, Layout, Main, MainOpts}; use sea_orm::DatabaseConnection; use serde::{Deserialize, Serialize}; -pub use oswilno_view::filters; - pub type Authenticated = actix_jwt_session::Authenticated; pub type MaybeAuthenticated = actix_jwt_session::MaybeAuthenticated; @@ -239,7 +239,6 @@ async fn login_inner( errors: &mut Errors, ) -> Option { let iat = OffsetDateTime::now_utc().unix_timestamp() as usize; - let account = find_account(payload, errors, db.clone()).await?; if let Err(e) = Hashing::verify(account.pass_hash.as_str(), payload.password.as_str()) { @@ -347,27 +346,27 @@ async fn refresh_token( _hcx: HelperContext, ) -> HttpResponse { let s = storage.into_inner(); - let pair = match s.refresh::(refresh_token.access_jti()).await { - Err(e) => { - tracing::warn!("Failed to refresh token: {e}"); - return HttpResponse::BadRequest().finish(); - } - Ok(pair) => pair, + let Ok(pair) = s + .refresh::(refresh_token.access_jti()) + .await + .map_err(|e| tracing::warn!("Failed to refresh token: {e}")) + else { + return HttpResponse::BadRequest().finish(); }; - let encrypted_jwt = match pair.jwt.encode() { - Ok(text) => text, - Err(e) => { - tracing::warn!("Failed to encode claims: {e}"); - return HttpResponse::InternalServerError().finish(); - } + let Ok(encrypted_jwt) = pair + .jwt + .encode() + .inspect_err(|e| tracing::warn!("Failed to encode claims: {e}")) + else { + return HttpResponse::InternalServerError().finish(); }; - let encrypted_refresh = match pair.refresh.encode() { - Err(e) => { - tracing::warn!("Failed to encode claims: {e}"); - return HttpResponse::InternalServerError().finish(); - } - Ok(text) => text, + let Ok(encrypted_refresh) = pair + .refresh + .encode() + .inspect_err(|e| tracing::warn!("Failed to encode claims: {e}")) + else { + return HttpResponse::InternalServerError().finish(); }; HttpResponse::Ok() .append_header(( @@ -600,12 +599,9 @@ async fn register_internal( } tracing::warn!("{errors:#?}"); - let pass = match Hashing::encrypt(p.password.as_str()) { - Ok(p) => p, - Err(e) => { - tracing::warn!("{e}"); - return Ok(HttpResponse::InternalServerError().body("")); - } + let Ok(pass) = Hashing::encrypt(p.password.as_str()).inspect_err(|e| tracing::warn!("{e}")) + else { + return Ok(HttpResponse::InternalServerError().body("")); }; let model = (ActiveModel { id: NotSet, diff --git a/crates/oswilno-view/src/filters.rs b/crates/oswilno-view/src/filters.rs index e52d489..8807ac3 100644 --- a/crates/oswilno-view/src/filters.rs +++ b/crates/oswilno-view/src/filters.rs @@ -1,6 +1,7 @@ -use crate::HelperContext; use askama::Result; +use crate::HelperContext; + #[tracing::instrument(skip(htx))] pub fn t(s: T, htx: &HelperContext) -> Result { // tracing::debug!("translating {s:?} to lang {lang:?} with {t:?}"); diff --git a/crates/oswilno-view/src/helper_context.rs b/crates/oswilno-view/src/helper_context.rs index 41750a6..0aefa15 100644 --- a/crates/oswilno-view/src/helper_context.rs +++ b/crates/oswilno-view/src/helper_context.rs @@ -1,12 +1,13 @@ -use crate::Lang; -use crate::{ExtractLangFuture, TranslationStorage}; -use actix_web::error::Error; -use actix_web::web::Data; -use actix_web::HttpRequest; use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; +use actix_web::error::Error; +use actix_web::web::Data; +use actix_web::HttpRequest; + +use crate::{ExtractLangFuture, Lang, TranslationStorage}; + #[derive(Clone, Debug)] pub struct HelperContext { pub t: Data, diff --git a/crates/oswilno-view/src/lang.rs b/crates/oswilno-view/src/lang.rs index 7d6be7f..97e847f 100644 --- a/crates/oswilno-view/src/lang.rs +++ b/crates/oswilno-view/src/lang.rs @@ -1,10 +1,11 @@ -use actix_web::error::Error; -use actix_web::HttpRequest; use std::future::Future; use std::pin::Pin; use std::str::FromStr; use std::task::{Context, Poll}; +use actix_web::error::Error; +use actix_web::HttpRequest; + #[derive(Clone, Copy, Hash, PartialEq, Eq, Debug, Default)] pub enum Lang { #[default] diff --git a/crates/oswilno-view/src/lib.rs b/crates/oswilno-view/src/lib.rs index f1ba73d..8a57eea 100644 --- a/crates/oswilno-view/src/lib.rs +++ b/crates/oswilno-view/src/lib.rs @@ -4,7 +4,6 @@ use std::sync::{Arc, RwLock}; use actix_web::http::header::ContentType; use actix_web::web::ServiceConfig; use actix_web::{get, HttpRequest, HttpResponse}; - pub use helper_context::*; pub use lang::*; diff --git a/crates/oswilno-view/templates/nav/search.html b/crates/oswilno-view/templates/nav/search.html index 836c9ec..a6176b4 100644 --- a/crates/oswilno-view/templates/nav/search.html +++ b/crates/oswilno-view/templates/nav/search.html @@ -11,7 +11,7 @@ type="search" id="search-navbar" class="block w-full min-w-[35rem] p-2 pl-10 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" - placeholder='{"Search.."|t(hcx)}' + placeholder='{{ "Search.."|t(hcx) }}' >
diff --git a/crates/web-assets/assets/app.js b/crates/web-assets/assets/app.js index 8fd2779..4df2b1c 100644 --- a/crates/web-assets/assets/app.js +++ b/crates/web-assets/assets/app.js @@ -1,6 +1,10 @@ import './elements/oswilno-price.js'; import './elements/oswilno-error.js'; +import './elements/oswilno-parking-space-rents.js'; +import './elements/oswilno-parking-space-rent.js'; import './elements/oswilno-parking-space.js'; +import './elements/oswilno-parking-space-location.js'; + import("https://unpkg.com/htmx.org@1.9.4/dist/htmx.min.js"); const READ_AUTH_HEADER = 'Authorization'; diff --git a/crates/web-assets/assets/elements/oswilno-parking-space-location.js b/crates/web-assets/assets/elements/oswilno-parking-space-location.js new file mode 100644 index 0000000..9b843e9 --- /dev/null +++ b/crates/web-assets/assets/elements/oswilno-parking-space-location.js @@ -0,0 +1,14 @@ +customElements.define('oswilno-parking-space-location', class extends HTMLElement { + constructor() { + super(); + const shadow = this.attachShadow({ mode: 'open' }); + shadow.innerHTML = ` + +
+ +
+ `; + } +}); diff --git a/crates/web-assets/assets/elements/oswilno-parking-space-rent.js b/crates/web-assets/assets/elements/oswilno-parking-space-rent.js new file mode 100644 index 0000000..fdd87f5 --- /dev/null +++ b/crates/web-assets/assets/elements/oswilno-parking-space-rent.js @@ -0,0 +1,14 @@ +customElements.define('oswilno-parking-space-rent', class extends HTMLElement { + constructor() { + super(); + const shadow = this.attachShadow({ mode: 'open' }); + shadow.innerHTML = ` + +
+ +
+ `; + } +}); diff --git a/crates/web-assets/assets/elements/oswilno-parking-space-rents.js b/crates/web-assets/assets/elements/oswilno-parking-space-rents.js new file mode 100644 index 0000000..cf976c9 --- /dev/null +++ b/crates/web-assets/assets/elements/oswilno-parking-space-rents.js @@ -0,0 +1,23 @@ +customElements.define('oswilno-parking-space-rents', class extends HTMLElement { + constructor() { + super(); + const shadow = this.attachShadow({ mode: 'open' }); + shadow.innerHTML = ` + +
+ +
+ `; + } +}); + diff --git a/crates/web-assets/assets/elements/oswilno-parking-space.js b/crates/web-assets/assets/elements/oswilno-parking-space.js index ddee1fc..3ba9ec3 100644 --- a/crates/web-assets/assets/elements/oswilno-parking-space.js +++ b/crates/web-assets/assets/elements/oswilno-parking-space.js @@ -7,7 +7,7 @@ customElements.define('oswilno-parking-space', class extends HTMLElement { :host { display: block; width: 100%; }
- +
`; } diff --git a/crates/web-assets/build.rs b/crates/web-assets/build.rs index 7934f59..a1f4cf5 100644 --- a/crates/web-assets/build.rs +++ b/crates/web-assets/build.rs @@ -6,5 +6,6 @@ fn main() { // .stdout(Stdio::piped()) // .spawn() // .expect("Failed to create child process for building JS"); - // child.wait_with_output().expect("Failed to run child process for building JS"); + // child.wait_with_output().expect("Failed to run child process for building + // JS"); } diff --git a/crates/web-assets/src/lib.rs b/crates/web-assets/src/lib.rs index 8e5ea40..f84147b 100644 --- a/crates/web-assets/src/lib.rs +++ b/crates/web-assets/src/lib.rs @@ -1,6 +1,8 @@ -use std::{borrow::Cow, sync::Once}; +use std::borrow::Cow; +use std::sync::Once; -use actix_web::{get, web::ServiceConfig, HttpResponse}; +use actix_web::web::ServiceConfig; +use actix_web::{get, HttpResponse}; pub fn mount(config: &mut ServiceConfig) { config diff --git a/scripts/generate-entries.sh b/scripts/generate-entries.sh index f9156ac..69cb6ff 100755 --- a/scripts/generate-entries.sh +++ b/scripts/generate-entries.sh @@ -4,6 +4,7 @@ sea-orm-cli generate entity -v -l --expanded-format -o ./crates/oswilno-contract echo 'pub use sea_orm;' >> ./crates/oswilno-contract/src/lib.rs echo 'pub use actix_admin;' >> ./crates/oswilno-contract/src/lib.rs +echo "pub use ::chrono;" >> ./crates/oswilno-contract/src/lib.rs for f in $( ls ./crates/oswilno-contract/src/*.rs ); do # bad generated code patch @@ -29,6 +30,7 @@ for f in $(ls crates/oswilno-contract/src/*.rs); do fi ;; *"struct Model"* ) + # echo "#[derive(DeriveActixAdmin, DeriveActixAdminModel, DeriveActixAdminViewModel, DeriveActixAdminModelSelectList)]" >> /tmp/ajosdfjosdpjfojsdfjpajpfa echo "#[derive(DeriveActixAdmin, DeriveActixAdminModel, DeriveActixAdminViewModel)]" >> /tmp/ajosdfjosdpjfojsdfjpajpfa ;; "pub id: i32," )