From 6e7d045794765ea66f7f7ce084ef246cb9472e29 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Fri, 15 Oct 2021 04:35:47 -0600 Subject: [PATCH] feat(ui): migrate UI/Web framework to WRY --- Cargo.lock | 1153 +++++++++++++++++++++++++++---- Cargo.toml | 3 +- src/frontend/mod.rs | 2 +- src/frontend/ui/mod.rs | 98 +-- src/main.rs | 2 +- ui/src/main.js | 28 +- ui/src/views/SelectPackages.vue | 11 +- 7 files changed, 1099 insertions(+), 198 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14081d5..4cb9f02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,15 +36,33 @@ dependencies = [ ] [[package]] -name = "atk-sys" -version = "0.10.0" +name = "anyhow" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f530e4af131d94cc4fa15c5c9d0348f0ef28bac64ba660b6b2a1cf2605dedfce" +checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" + +[[package]] +name = "atk" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a83b21d2aa75e464db56225e1bda2dd5993311ba1095acaa8fa03d1ae67026ba" dependencies = [ - "glib-sys", - "gobject-sys", + "atk-sys", + "bitflags", + "glib", "libc", - "system-deps", +] + +[[package]] +name = "atk-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "badcf670157c84bb8b1cf6b5f70b650fed78da2033c9eed84c4e49b11cbe83ea" +dependencies = [ + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", ] [[package]] @@ -123,10 +141,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "boxfnonce" -version = "0.1.1" +name = "block" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5988cb1d626264ac94100be357308f29ff7cbdd3b36bda27f450a4ee3f713426" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bumpalo" @@ -151,6 +169,12 @@ dependencies = [ "iovec", ] +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + [[package]] name = "bzip2" version = "0.4.3" @@ -173,13 +197,27 @@ dependencies = [ ] [[package]] -name = "cairo-sys-rs" -version = "0.10.0" +name = "cairo-rs" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ed2639b9ad5f1d6efa76de95558e11339e7318426d84ac4890b86c03e828ca7" +checksum = "9164355c892b026d6257e696dde5f3cb39beb3718297f0f161b562fe2ee3ab86" dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", "libc", - "system-deps", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c9c3928781e8a017ece15eace05230f04b647457d170d2d9641c94a444ff80" +dependencies = [ + "glib-sys 0.14.0", + "libc", + "system-deps 3.2.0", ] [[package]] @@ -188,6 +226,15 @@ version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" +[[package]] +name = "cfg-expr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b412e83326147c2bb881f8b40edfbf9905b9b8abaebd0e47ca190ba62fda8f0e" +dependencies = [ + "smallvec 1.7.0", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -222,7 +269,7 @@ dependencies = [ "ansi_term", "atty", "bitflags", - "strsim", + "strsim 0.8.0", "textwrap", "unicode-width", "vec_map", @@ -237,6 +284,68 @@ dependencies = [ "bitflags", ] +[[package]] +name = "cocoa" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation 0.9.2", + "core-graphics 0.22.2", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation 0.9.2", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "com" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a30a2b2a013da986dc5cc3eda3d19c0d59d53f835be1b2356eb8d00f000c793" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7606b05842fea68ddcc89e8053b8860ebcb2a0ba8d6abfe3a148e5d5a8d3f0c1" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn", +] + +[[package]] +name = "com_macros_support" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97e9a6d20f4ac8830e309a455d7e9416e65c6af5a97c88c55fbb4c2012e107da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "cookie" version = "0.12.0" @@ -265,22 +374,88 @@ dependencies = [ "url 1.7.2", ] +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys 0.7.0", + "libc", +] + [[package]] name = "core-foundation" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.8.3", "libc", ] +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + [[package]] name = "core-foundation-sys" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +[[package]] +name = "core-graphics" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" +dependencies = [ + "bitflags", + "core-foundation 0.7.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" +dependencies = [ + "bitflags", + "core-foundation 0.9.2", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation 0.9.2", + "foreign-types", + "libc", +] + +[[package]] +name = "core-video-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +dependencies = [ + "cfg-if 0.1.10", + "core-foundation-sys 0.7.0", + "core-graphics 0.19.2", + "libc", + "objc", +] + [[package]] name = "crc32fast" version = "1.2.1" @@ -382,6 +557,52 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "deunicode" version = "0.4.3" @@ -408,6 +629,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + [[package]] name = "dtoa" version = "0.4.8" @@ -460,6 +687,16 @@ dependencies = [ "log 0.4.14", ] +[[package]] +name = "field-offset" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +dependencies = [ + "memoffset 0.6.4", + "rustc_version 0.3.3", +] + [[package]] name = "filetime" version = "0.2.15" @@ -543,6 +780,21 @@ version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" +[[package]] +name = "futures-channel" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" + [[package]] name = "futures-cpupool" version = "0.1.8" @@ -554,33 +806,98 @@ dependencies = [ ] [[package]] -name = "gdk-pixbuf-sys" -version = "0.10.0" +name = "futures-executor" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bfe468a7f43e97b8d193a762b6c5cf67a7d36cacbc0b9291dbcae24bfea1e8f" +checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" + +[[package]] +name = "futures-task" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" + +[[package]] +name = "futures-util" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" +dependencies = [ + "autocfg 1.0.1", + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab 0.4.5", +] + +[[package]] +name = "gdk" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d749dcfc00d8de0d7c3a289e04a04293eb5ba3d8a4e64d64911d481fa9933b" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", "libc", - "system-deps", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534192cb8f01daeb8fab2c8d4baa8f9aae5b7a39130525779f5c2608e235b10f" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f097c0704201fbc8f69c1762dc58c6947c8bb188b8ed0bc7e65259f1894fe590" +dependencies = [ + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", ] [[package]] name = "gdk-sys" -version = "0.10.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a9653cfc500fd268015b1ac055ddbc3df7a5c9ea3f4ccef147b3957bd140d69" +checksum = "0e091b3d3d6696949ac3b3fb3c62090e5bfd7bd6850bef5c3c5ea701de1b1f1e" dependencies = [ "cairo-sys-rs", "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", "libc", "pango-sys", "pkg-config", - "system-deps", + "system-deps 3.2.0", ] [[package]] @@ -600,19 +917,83 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" +[[package]] +name = "gio" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711c3632b3ebd095578a9c091418d10fed492da9443f58ebc8f45efbeb215cb0" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys 0.14.0", + "glib", + "libc", + "once_cell", + "thiserror", +] + [[package]] name = "gio-sys" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e24fb752f8f5d2cf6bbc2c606fd2bc989c81c5e2fe321ab974d54f8b6344eac" dependencies = [ - "glib-sys", - "gobject-sys", + "glib-sys 0.10.1", + "gobject-sys 0.10.0", "libc", - "system-deps", + "system-deps 1.3.2", "winapi 0.3.9", ] +[[package]] +name = "gio-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0a41df66e57fcc287c4bcf74fc26b884f31901ea9792ec75607289b456f48fa" +dependencies = [ + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", + "winapi 0.3.9", +] + +[[package]] +name = "glib" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c515f1e62bf151ef6635f528d05b02c11506de986e43b34a5c920ef0b3796a4" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "once_cell", + "smallvec 1.7.0", +] + +[[package]] +name = "glib-macros" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aad66361f66796bfc73f530c51ef123970eb895ffba991a234fcf7bea89e518" +dependencies = [ + "anyhow", + "heck", + "proc-macro-crate 1.1.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "glib-sys" version = "0.10.1" @@ -620,7 +1001,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e9b997a66e9a23d073f2b1abb4dbfc3925e0b8952f67efd8d9b6e168e4cdc1" dependencies = [ "libc", - "system-deps", + "system-deps 1.3.2", +] + +[[package]] +name = "glib-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c1d60554a212445e2a858e42a0e48cece1bd57b311a19a9468f70376cf554ae" +dependencies = [ + "libc", + "system-deps 3.2.0", ] [[package]] @@ -629,27 +1020,76 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" dependencies = [ - "glib-sys", + "glib-sys 0.10.1", "libc", - "system-deps", + "system-deps 1.3.2", +] + +[[package]] +name = "gobject-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa92cae29759dae34ab5921d73fff5ad54b3d794ab842c117e36cafc7994c3f5" +dependencies = [ + "glib-sys 0.14.0", + "libc", + "system-deps 3.2.0", +] + +[[package]] +name = "gtk" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb51122dd3317e9327ec1e4faa151d1fa0d95664cd8fb8dcfacf4d4d29ac70c" +dependencies = [ + "atk", + "bitflags", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", ] [[package]] name = "gtk-sys" -version = "0.10.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89acda6f084863307d948ba64a4b1ef674e8527dddab147ee4cdcc194c880457" +checksum = "8c14c8d3da0545785a7c5a120345b3abb534010fb8ae0f2ef3f47c027fba303e" dependencies = [ "atk-sys", "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", "libc", "pango-sys", - "system-deps", + "system-deps 3.2.0", +] + +[[package]] +name = "gtk3-macros" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21de1da96dc117443fb03c2e270b2d34b7de98d0a79a19bbb689476173745b79" +dependencies = [ + "anyhow", + "heck", + "proc-macro-crate 1.1.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -659,10 +1099,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" dependencies = [ "byteorder", - "bytes", + "bytes 0.4.12", "fnv", "futures", - "http", + "http 0.1.21", "indexmap", "log 0.4.14", "slab 0.4.5", @@ -700,7 +1140,18 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" dependencies = [ - "bytes", + "bytes 0.4.12", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +dependencies = [ + "bytes 1.1.0", "fnv", "itoa", ] @@ -711,9 +1162,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", - "http", + "http 0.1.21", "tokio-buf", ] @@ -730,7 +1181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" dependencies = [ "base64 0.9.3", - "bytes", + "bytes 0.4.12", "futures", "futures-cpupool", "httparse", @@ -756,18 +1207,18 @@ version = "0.12.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c843caf6296fc1f93444735205af9ed4e109a539005abb2564ae1d6fad34c52" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "futures-cpupool", "h2", - "http", + "http 0.1.21", "http-body", "httparse", "iovec", "itoa", "log 0.4.14", "net2", - "rustc_version", + "rustc_version 0.2.3", "time", "tokio", "tokio-buf", @@ -786,13 +1237,19 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "hyper 0.12.36", "native-tls", "tokio-io", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.1.5" @@ -825,6 +1282,15 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "iovec" version = "0.1.4" @@ -834,12 +1300,31 @@ dependencies = [ "libc", ] +[[package]] +name = "itertools" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +[[package]] +name = "javascriptcore-rs" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca9c7d1445bba2889672fbadc16c3d5007bfdcf0a15a18a3a50fe9fab2c7427" +dependencies = [ + "glib", + "javascriptcore-rs-sys", +] + [[package]] name = "javascriptcore-rs-sys" version = "0.2.0" @@ -849,6 +1334,12 @@ dependencies = [ "libc", ] +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "js-sys" version = "0.3.55" @@ -904,6 +1395,7 @@ checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" name = "liftinstall" version = "0.2.0" dependencies = [ + "anyhow", "base64 0.13.0", "cc", "chrono", @@ -929,12 +1421,12 @@ dependencies = [ "toml", "url 2.2.2", "walkdir", - "web-view", "webbrowser", "which", "widestring 0.5.0", "winapi 0.3.9", "winres", + "wry", "xz2", "zip", ] @@ -948,6 +1440,15 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lock_api" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +dependencies = [ + "scopeguard", +] + [[package]] name = "log" version = "0.3.9" @@ -977,6 +1478,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + [[package]] name = "matches" version = "0.1.9" @@ -1099,6 +1609,52 @@ dependencies = [ "tempfile", ] +[[package]] +name = "ndk" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-glue" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e9e94628f24e7a3cb5b96a2dc5683acd9230bf11991c2a1677b87695138420" +dependencies = [ + "lazy_static", + "libc", + "log 0.4.14", + "ndk", + "ndk-macro", + "ndk-sys", +] + +[[package]] +name = "ndk-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling", + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" + [[package]] name = "net2" version = "0.2.37" @@ -1159,12 +1715,52 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +dependencies = [ + "derivative", + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "number_prefix" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + [[package]] name = "object" version = "0.26.2" @@ -1214,15 +1810,28 @@ dependencies = [ ] [[package]] -name = "pango-sys" -version = "0.10.0" +name = "pango" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d2650c8b62d116c020abd0cea26a4ed96526afda89b1c4ea567131fdefc890" +checksum = "546fd59801e5ca735af82839007edd226fe7d3bb06433ec48072be4439c28581" dependencies = [ - "glib-sys", - "gobject-sys", + "bitflags", + "glib", "libc", - "system-deps", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2367099ca5e761546ba1d501955079f097caa186bb53ce0f718dca99ac1942fe" +dependencies = [ + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "libc", + "system-deps 3.2.0", ] [[package]] @@ -1231,9 +1840,20 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" dependencies = [ - "lock_api", - "parking_lot_core", - "rustc_version", + "lock_api 0.3.4", + "parking_lot_core 0.6.2", + "rustc_version 0.2.3", +] + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api 0.4.5", + "parking_lot_core 0.8.5", ] [[package]] @@ -1246,11 +1866,25 @@ dependencies = [ "cloudabi", "libc", "redox_syscall 0.1.57", - "rustc_version", + "rustc_version 0.2.3", "smallvec 0.6.14", "winapi 0.3.9", ] +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall 0.2.10", + "smallvec 1.7.0", + "winapi 0.3.9", +] + [[package]] name = "pem" version = "0.8.3" @@ -1274,6 +1908,27 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.20" @@ -1286,6 +1941,49 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.30" @@ -1483,6 +2181,15 @@ dependencies = [ "rand_core 0.3.1", ] +[[package]] +name = "raw-window-handle" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" +dependencies = [ + "libc", +] + [[package]] name = "rayon" version = "1.5.1" @@ -1584,13 +2291,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" dependencies = [ "base64 0.10.1", - "bytes", + "bytes 0.4.12", "cookie", "cookie_store", "encoding_rs", "flate2", "futures", - "http", + "http 0.1.21", "hyper 0.12.36", "hyper-tls", "log 0.4.14", @@ -1641,6 +2348,15 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "ryu" version = "1.0.5" @@ -1691,8 +2407,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" dependencies = [ "bitflags", - "core-foundation", - "core-foundation-sys", + "core-foundation 0.9.2", + "core-foundation-sys 0.8.3", "libc", "security-framework-sys", ] @@ -1703,7 +2419,7 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.8.3", "libc", ] @@ -1713,7 +2429,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser", + "semver-parser 0.7.0", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.2", ] [[package]] @@ -1731,6 +2456,15 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "serde" version = "1.0.130" @@ -1821,6 +2555,12 @@ dependencies = [ "maybe-uninit", ] +[[package]] +name = "smallvec" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" + [[package]] name = "soup-sys" version = "0.10.0" @@ -1828,12 +2568,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7adf08565630bbb71f955f11f8a68464817ded2703a3549747c235b58a13e" dependencies = [ "bitflags", - "gio-sys", - "glib-sys", - "gobject-sys", + "gio-sys 0.10.1", + "glib-sys 0.10.1", + "gobject-sys 0.10.0", "libc", "pkg-config", - "system-deps", + "system-deps 1.3.2", ] [[package]] @@ -1848,7 +2588,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" dependencies = [ - "bytes", + "bytes 0.4.12", ] [[package]] @@ -1857,12 +2597,24 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "strum" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" +[[package]] +name = "strum" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2" + [[package]] name = "strum_macros" version = "0.18.0" @@ -1875,6 +2627,18 @@ dependencies = [ "syn", ] +[[package]] +name = "strum_macros" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "syn" version = "1.0.80" @@ -1905,7 +2669,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e223c65cd36b485a34c2ce6e38efa40777d31c4166d9076030c74cdcf971679f" dependencies = [ "cfg-if 1.0.0", - "core-foundation-sys", + "core-foundation-sys 0.8.3", "libc", "ntapi", "once_cell", @@ -1921,11 +2685,29 @@ checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" dependencies = [ "heck", "pkg-config", - "strum", - "strum_macros", + "strum 0.18.0", + "strum_macros 0.18.0", "thiserror", "toml", - "version-compare", + "version-compare 0.0.10", +] + +[[package]] +name = "system-deps" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6" +dependencies = [ + "anyhow", + "cfg-expr", + "heck", + "itertools", + "pkg-config", + "strum 0.21.0", + "strum_macros 0.21.1", + "thiserror", + "toml", + "version-compare 0.0.11", ] [[package]] @@ -1934,6 +2716,46 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" +[[package]] +name = "tao" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa57de7c282b68f8906278543a724ed8f5a2568f069dd0cc05fc10d1f07036b" +dependencies = [ + "bitflags", + "cairo-rs", + "cc", + "cocoa", + "core-foundation 0.9.2", + "core-graphics 0.22.2", + "core-video-sys", + "crossbeam-channel", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "glib-sys 0.14.0", + "gtk", + "instant", + "lazy_static", + "libc", + "log 0.4.14", + "ndk", + "ndk-glue", + "ndk-sys", + "objc", + "parking_lot 0.11.2", + "raw-window-handle", + "scopeguard", + "serde", + "tauri-libappindicator", + "unicode-segmentation", + "winapi 0.3.9", + "x11-dl", +] + [[package]] name = "tar" version = "0.4.37" @@ -1945,6 +2767,29 @@ dependencies = [ "xattr", ] +[[package]] +name = "tauri-libappindicator" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af6057bf1b03141122da159ad4136d8a474240db59d81af1840d7fce3b819ef2" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "log 0.4.14", + "tauri-libappindicator-sys", +] + +[[package]] +name = "tauri-libappindicator-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c40a817171cf25d69dd31e3fa9360fd4367e54948e30f3356962f0b1d9f23dad" +dependencies = [ + "gtk-sys", + "pkg-config", +] + [[package]] name = "tempfile" version = "3.2.0" @@ -2030,7 +2875,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "mio", "num_cpus", @@ -2054,7 +2899,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ - "bytes", + "bytes 0.4.12", "either", "futures", ] @@ -2065,7 +2910,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "tokio-io", ] @@ -2076,7 +2921,7 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87b1395334443abca552f63d4f61d0486f12377c2ba8b368e523f89e828cffd4" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "iovec", "log 0.4.14", @@ -2126,7 +2971,7 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "log 0.4.14", ] @@ -2161,7 +3006,7 @@ dependencies = [ "log 0.4.14", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.9.0", "slab 0.4.5", "tokio-executor", "tokio-io", @@ -2193,7 +3038,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "iovec", "mio", @@ -2236,7 +3081,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "log 0.4.14", "mio", @@ -2251,7 +3096,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" dependencies = [ - "bytes", + "bytes 0.4.12", "futures", "iovec", "libc", @@ -2293,6 +3138,12 @@ dependencies = [ "cfg-if 0.1.10", ] +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" + [[package]] name = "unicase" version = "2.6.0" @@ -2364,12 +3215,6 @@ dependencies = [ "percent-encoding 2.1.0", ] -[[package]] -name = "urlencoding" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1f0175e03a0973cf4afd476bef05c26e228520400eb1fd473ad417b1c00ffb" - [[package]] name = "uuid" version = "0.7.4" @@ -2397,6 +3242,12 @@ version = "0.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" +[[package]] +name = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + [[package]] name = "version_check" version = "0.9.3" @@ -2506,18 +3357,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-view" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee1da6aa5f232e7a4f17ae4549772d2e35d0f4ade03e7527b25c4c0b00abafea" -dependencies = [ - "boxfnonce", - "tinyfiledialogs", - "urlencoding", - "webview-sys", -] - [[package]] name = "webbrowser" version = "0.5.5" @@ -2530,43 +3369,72 @@ dependencies = [ ] [[package]] -name = "webkit2gtk-sys" -version = "0.12.0" +name = "webkit2gtk" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389e5138c85a0d111b9bda05b59efa8562315e1d657d72451410e12c858f0619" +checksum = "e3e47b7f870883fc21612d2a51b74262f7f2cc5371f1621370817292a35300a9" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys 0.14.0", + "glib", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66ccc9f0cb4de7c3b92376a5bf64e7ddffb33852f092721731a039ec38dda98" dependencies = [ "atk-sys", "bitflags", "cairo-sys-rs", "gdk-pixbuf-sys", "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", + "gio-sys 0.14.0", + "glib-sys 0.14.0", + "gobject-sys 0.14.0", "gtk-sys", "javascriptcore-rs-sys", "libc", "pango-sys", "pkg-config", "soup-sys", + "system-deps 3.2.0", ] [[package]] -name = "webview-sys" -version = "0.6.2" +name = "webview2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0001f025c1425ffe36270a81cb091eade87dd8d29ac773735ae47e1a8c8066c9" +checksum = "1b132bb76313456e93b17037262a030d54c9fe0f11838ef1593f845e3807ef8a" dependencies = [ - "cc", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "gtk-sys", - "javascriptcore-rs-sys", - "libc", - "pkg-config", - "webkit2gtk-sys", + "com", + "once_cell", + "webview2-sys", + "widestring 0.4.3", + "winapi 0.3.9", +] + +[[package]] +name = "webview2-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b7889e893ac4c50d7346356be3ce13a85e56512c38b8fde0526559b8012a4c" +dependencies = [ + "com", + "winapi 0.3.9", ] [[package]] @@ -2653,6 +3521,36 @@ dependencies = [ "toml", ] +[[package]] +name = "wry" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9549393a3917b5303277abb0267f8eecf9fd629b25f1c04e5284aa58b61915" +dependencies = [ + "cocoa", + "core-graphics 0.22.2", + "gdk", + "gio", + "glib", + "gtk", + "http 0.2.5", + "libc", + "log 0.4.14", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "tao", + "thiserror", + "url 2.2.2", + "webkit2gtk", + "webkit2gtk-sys", + "webview2", + "webview2-sys", + "winapi 0.3.9", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -2663,6 +3561,17 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "x11-dl" +version = "2.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + [[package]] name = "xattr" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index 1a2fb7c..17da354 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,8 @@ description = "An adaptable installer for your application." build = "build.rs" [dependencies] -web-view = { version = "0.7", features = ["edge"] } +anyhow = "^1" +wry = "0.12" tinyfiledialogs = "3.8" hyper = "0.11.27" diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index 056035d..a37cf1e 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -16,7 +16,7 @@ pub fn launch(app_name: &str, is_launcher: bool, framework: InstallerFramework) let (servers, address) = rest::server::spawn_servers(framework.clone()); - ui::start_ui(app_name, &address, is_launcher); + ui::start_ui(app_name, &address, is_launcher).log_expect("Failed to start UI"); // Explicitly hint that we want the servers instance until here. drop(servers); diff --git a/src/frontend/ui/mod.rs b/src/frontend/ui/mod.rs index b62cfa4..786fd3f 100644 --- a/src/frontend/ui/mod.rs +++ b/src/frontend/ui/mod.rs @@ -2,9 +2,16 @@ //! //! Provides a web-view UI. -use web_view::Content; - -use crate::logging::LoggingErrors; +use anyhow::Result; +use wry::{ + application::{ + dpi::LogicalSize, + event::{Event, StartCause, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, + }, + webview::{RpcResponse, WebViewBuilder}, +}; use log::Level; @@ -16,55 +23,56 @@ enum CallbackType { } /// Starts the main web UI. Will return when UI is closed. -pub fn start_ui(app_name: &str, http_address: &str, is_launcher: bool) { +pub fn start_ui(app_name: &str, http_address: &str, is_launcher: bool) -> Result<()> { let size = if is_launcher { (600, 300) } else { (1024, 600) }; - info!("Spawning web view instance"); - web_view::builder() - .title(&format!("{} Installer", app_name)) - .content(Content::Url(http_address)) - .size(size.0, size.1) - .resizable(false) - .debug(cfg!(debug_assertions)) - .user_data(()) - .invoke_handler(|wv, msg| { - let mut cb_result = Ok(()); - let command: CallbackType = - serde_json::from_str(msg).log_expect(&format!("Unable to parse string: {:?}", msg)); - - debug!("Incoming payload: {:?}", command); - - match command { - CallbackType::SelectInstallDir { callback_name } => { - let result = - tinyfiledialogs::select_folder_dialog("Select a install directory...", ""); - - if let Some(new_path) = result { - if !new_path.is_empty() { - let result = serde_json::to_string(&new_path) - .log_expect("Unable to serialize response"); - let command = format!("window.{}({});", callback_name, result); - debug!("Injecting response: {}", command); - cb_result = wv.eval(&command); + let event_loop = EventLoop::new(); + let window = WindowBuilder::new() + .with_title(format!("{} Installer", app_name)) + .with_inner_size(LogicalSize::new(size.0, size.1)) + .with_resizable(false) + .build(&event_loop)?; + let _webview = WebViewBuilder::new(window)? + .with_url(http_address)? + .with_rpc_handler(|_, mut event| { + debug!("Incoming payload: {:?}", event); + match event.method.as_str() { + "Test" => (), + "Log" => { + if let Some(msg) = event.params.take() { + if let Ok(msg) = serde_json::from_value::<(String, String)>(msg) { + let kind = match msg.0.as_str() { + "info" | "log" => Level::Info, + "warn" => Level::Warn, + _ => Level::Error, + }; + log!(target: "liftinstall::frontend::js", kind, "{}", msg.1); } } } - CallbackType::Log { msg, kind } => { - let kind = match kind.as_ref() { - "info" | "log" => Level::Info, - "warn" => Level::Warn, - "error" => Level::Error, - _ => Level::Error, - }; - - log!(target: "liftinstall::frontend::js", kind, "{}", msg); + "SelectInstallDir" => { + let result = + tinyfiledialogs::select_folder_dialog("Select a install directory...", "") + .and_then(|v| serde_json::to_value(v).ok()); + return Some(RpcResponse::new_result(event.id, result)); } - CallbackType::Test {} => {} + _ => warn!("Unknown RPC method: {}", event.method), } - - cb_result + None }) - .run() - .log_expect("Unable to launch Web UI!"); + .build()?; + + event_loop.run(move |event, _, control_flow| { + *control_flow = ControlFlow::Wait; + + match event { + Event::NewEvents(StartCause::Init) => info!("Webview started"), + Event::WindowEvent { + event: WindowEvent::CloseRequested, + .. + } => *control_flow = ControlFlow::Exit, + _ => (), + } + }); } diff --git a/src/main.rs b/src/main.rs index d3a83da..50e0319 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ #![deny(unsafe_code)] #![deny(missing_docs)] -extern crate web_view; +extern crate wry; extern crate futures; extern crate hyper; diff --git a/ui/src/main.js b/ui/src/main.js index d62fae9..66693ae 100644 --- a/ui/src/main.js +++ b/ui/src/main.js @@ -25,13 +25,8 @@ export const i18n = new VueI18n({ function intercept (method) { console[method] = function () { const message = Array.prototype.slice.apply(arguments).join(' ') - window.external.invoke( - JSON.stringify({ - Log: { - kind: method, - msg: message - } - }) + window.rpc.notify( + 'Log', method, message ) } } @@ -39,9 +34,7 @@ function intercept (method) { // See if we have access to the JSON interface let hasExternalInterface = false try { - window.external.invoke(JSON.stringify({ - Test: {} - })) + window.rpc.notify('Test') hasExternalInterface = true } catch (e) { console.warn('Running without JSON interface - unexpected behaviour may occur!') @@ -50,13 +43,8 @@ try { // Overwrite loggers with the logging backend if (hasExternalInterface) { window.onerror = function (msg, url, line) { - window.external.invoke( - JSON.stringify({ - Log: { - kind: 'error', - msg: msg + ' @ ' + url + ':' + line - } - }) + window.rpc.notify( + 'Log', 'error', msg + ' @ ' + url + ':' + line ) } @@ -91,12 +79,6 @@ axios.get('/api/attrs').then(function (resp) { console.error(err) }) -function selectFileCallback (name) { - app.install_location = name -} - -window.selectFileCallback = selectFileCallback - const app = new Vue({ i18n: i18n, router: router, diff --git a/ui/src/views/SelectPackages.vue b/ui/src/views/SelectPackages.vue index d88f5c5..d51dfda 100644 --- a/ui/src/views/SelectPackages.vue +++ b/ui/src/views/SelectPackages.vue @@ -80,7 +80,7 @@ export default { data: function () { return { publicPath: process.env.BASE_URL, - advanced: false, + advanced: true, repair: false, installDesktopShortcut: true } @@ -99,11 +99,12 @@ export default { }, methods: { select_file: function () { - window.external.invoke(JSON.stringify({ - SelectInstallDir: { - callback_name: 'selectFileCallback' + const that = this + window.rpc.call('SelectInstallDir').then(function (name) { + if (name) { + that.$root.$data.install_location = name } - })) + }) }, show_overwrite_dialog: function (confirmCallback) { this.$buefy.dialog.confirm({