From 60dd13cdb335808ec7e7607cd9560a57bf50a2de Mon Sep 17 00:00:00 2001 From: ayang <75017711+ayangweb@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:53:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=BB=E6=8E=89=E4=BA=86=E5=8F=8C?= =?UTF-8?q?=E5=87=BB=E5=A4=87=E4=BB=BD=E6=96=87=E4=BB=B6=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD=20(#756)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 238 +++++-------------- package.json | 1 - pnpm-lock.yaml | 10 - src-tauri/Cargo.toml | 1 - src-tauri/capabilities/default.json | 1 - src-tauri/src/lib.rs | 2 - src-tauri/tauri.conf.json | 9 +- src/pages/Backup/components/Manual/index.tsx | 26 +- 8 files changed, 67 insertions(+), 221 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd32afefdf..1651717302 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,12 +11,6 @@ dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -137,7 +131,7 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -272,7 +266,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -307,7 +301,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -397,7 +391,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.0", + "miniz_oxide", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -536,7 +530,7 @@ dependencies = [ "proc-macro-crate 2.0.2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", "syn_derive", ] @@ -899,26 +893,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const-random" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" -dependencies = [ - "const-random-macro", -] - -[[package]] -name = "const-random-macro" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" -dependencies = [ - "getrandom 0.2.15", - "once_cell", - "tiny-keccak", -] - [[package]] name = "convert_case" version = "0.4.0" @@ -1168,7 +1142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1178,7 +1152,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1214,7 +1188,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1225,7 +1199,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1268,7 +1242,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1281,7 +1255,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1351,7 +1325,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1383,16 +1357,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", -] - -[[package]] -name = "dlv-list" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" -dependencies = [ - "const-random", + "syn 2.0.86", ] [[package]] @@ -1453,7 +1418,6 @@ dependencies = [ "tauri-build", "tauri-nspanel", "tauri-plugin-autostart", - "tauri-plugin-deep-link", "tauri-plugin-dialog", "tauri-plugin-eco-autostart", "tauri-plugin-eco-backup", @@ -1556,7 +1520,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1635,15 +1599,14 @@ dependencies = [ [[package]] name = "exr" -version = "1.72.0" +version = "1.73.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "887d93f60543e9a9362ef8a21beedd0a833c5d9610e18c67abe15a5963dcb1a4" +checksum = "f83197f59927b46c04a183a619b7c29df34e63e63c7869320862268c0ef687e0" dependencies = [ "bit_field", - "flume", "half", "lebe", - "miniz_oxide 0.7.4", + "miniz_oxide", "rayon-core", "smallvec", "zune-inflate", @@ -1702,7 +1665,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1758,7 +1721,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -1869,7 +1832,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -2143,7 +2106,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -2239,7 +2202,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -2605,7 +2568,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -3045,15 +3008,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -3231,7 +3185,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -3293,7 +3247,7 @@ dependencies = [ "proc-macro-crate 2.0.2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -3585,16 +3539,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "ordered-multimap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" -dependencies = [ - "dlv-list", - "hashbrown 0.14.5", -] - [[package]] name = "ordered-stream" version = "0.2.0" @@ -3811,7 +3755,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -3914,7 +3858,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -4028,7 +3972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -4419,7 +4363,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "windows-registry 0.2.0", + "windows-registry", ] [[package]] @@ -4515,17 +4459,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rust-ini" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e310ef0e1b6eeb79169a1171daf9abcb87a2e17c03bee2c4bb100b55c75409f" -dependencies = [ - "cfg-if", - "ordered-multimap", - "trim-in-place", -] - [[package]] name = "rust_decimal" version = "1.36.0" @@ -4677,7 +4610,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -4755,7 +4688,7 @@ checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -4766,7 +4699,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -4789,7 +4722,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -4840,7 +4773,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -5139,7 +5072,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -5162,7 +5095,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.85", + "syn 2.0.86", "tempfile", "tokio", "url", @@ -5359,9 +5292,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.85" +version = "2.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" dependencies = [ "proc-macro2", "quote", @@ -5377,7 +5310,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -5458,7 +5391,7 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -5576,7 +5509,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "syn 2.0.85", + "syn 2.0.86", "tauri-utils", "thiserror", "time", @@ -5594,7 +5527,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", "tauri-codegen", "tauri-utils", ] @@ -5647,26 +5580,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "tauri-plugin-deep-link" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a9b5725027c6e9e075b06cb2d5c2cd3b5c29daa8012b404e1ff755cc56082f" -dependencies = [ - "dunce", - "log", - "rust-ini", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "tauri-utils", - "thiserror", - "url", - "windows-registry 0.3.0", - "windows-result 0.2.0", -] - [[package]] name = "tauri-plugin-dialog" version = "2.0.3" @@ -6101,22 +6014,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -6163,15 +6076,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tinyvec" version = "1.8.0" @@ -6324,7 +6228,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -6357,12 +6261,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "trim-in-place" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343e926fc669bc8cde4fa3129ab681c63671bae288b1f1081ceee6d9d37904fc" - [[package]] name = "try-lock" version = "0.2.5" @@ -6644,7 +6542,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", "wasm-bindgen-shared", ] @@ -6678,7 +6576,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6847,7 +6745,7 @@ checksum = "1d228f15bba3b9d56dde8bddbee66fa24545bd17b48d5128ccf4a8742b18e431" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -6982,7 +6880,7 @@ dependencies = [ "windows-implement 0.58.0", "windows-interface 0.58.0", "windows-result 0.2.0", - "windows-strings 0.1.0", + "windows-strings", "windows-targets 0.52.6", ] @@ -6994,7 +6892,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -7005,7 +6903,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -7016,7 +6914,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -7027,7 +6925,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] @@ -7037,18 +6935,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-registry" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafa604f2104cf5ae2cc2db1dee84b7e6a5d11b05f737b60def0ffdc398cbc0a" -dependencies = [ - "windows-result 0.2.0", - "windows-strings 0.2.0", + "windows-strings", "windows-targets 0.52.6", ] @@ -7080,15 +6967,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-strings" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978d65aedf914c664c510d9de43c8fd85ca745eaff1ed53edf409b479e441663" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -7558,7 +7436,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.85", + "syn 2.0.86", ] [[package]] diff --git a/package.json b/package.json index e82476661f..e5e62b85c5 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "@tanstack/react-virtual": "^3.10.8", "@tauri-apps/api": "^2.0.3", "@tauri-apps/plugin-autostart": "^2.0.0", - "@tauri-apps/plugin-deep-link": "^2.0.0", "@tauri-apps/plugin-dialog": "^2.0.1", "@tauri-apps/plugin-fs": "^2.0.1", "@tauri-apps/plugin-global-shortcut": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 483c0913cd..d08dc3a541 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,9 +23,6 @@ importers: '@tauri-apps/plugin-autostart': specifier: ^2.0.0 version: 2.0.0 - '@tauri-apps/plugin-deep-link': - specifier: ^2.0.0 - version: 2.0.0 '@tauri-apps/plugin-dialog': specifier: ^2.0.1 version: 2.0.1 @@ -1218,9 +1215,6 @@ packages: '@tauri-apps/plugin-autostart@2.0.0': resolution: {integrity: sha512-NEwOQWVasZ8RczXkMLNJokRDujneuMH/UFA5t84DLkbNZUmiD3G7HZWhgSd1YQ0BFU9h9w+h2B/py3y6bzWg4Q==} - '@tauri-apps/plugin-deep-link@2.0.0': - resolution: {integrity: sha512-cDa2k1OrRU5DoKc0IXl1Y8RlFOU107u2phdZfT7FkApsC6TL/VAPs3YOUTT8p9/PZ50EjOKP104HFMqVqnQ0bw==} - '@tauri-apps/plugin-dialog@2.0.1': resolution: {integrity: sha512-fnUrNr6EfvTqdls/ufusU7h6UbNFzLKvHk/zTuOiBq01R3dTODqwctZlzakdbfSp/7pNwTKvgKTAgl/NAP/Z0Q==} @@ -5043,10 +5037,6 @@ snapshots: dependencies: '@tauri-apps/api': 2.0.3 - '@tauri-apps/plugin-deep-link@2.0.0': - dependencies: - '@tauri-apps/api': 2.0.3 - '@tauri-apps/plugin-dialog@2.0.1': dependencies: '@tauri-apps/api': 2.0.3 diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 32d56a0bd2..22a947d17d 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -32,7 +32,6 @@ tauri-plugin-dialog = "2" tauri-plugin-fs = "2" tauri-plugin-updater = "2" tauri-plugin-process = "2" -tauri-plugin-deep-link = "2" tauri-plugin-eco-window.workspace = true tauri-plugin-eco-macos-permissions.workspace = true tauri-plugin-eco-mouse.workspace = true diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index f56acb625a..7de622a531 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -46,7 +46,6 @@ "dialog:default", "updater:default", "process:default", - "deep-link:default", "eco-window:default", "eco-macos-permissions:default", "eco-mouse:default", diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index d255fd2090..9ac26e89ee 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -55,8 +55,6 @@ pub fn run() { .plugin(tauri_plugin_updater::Builder::new().build()) // 进程相关插件:https://github.com/tauri-apps/tauri-plugin-process .plugin(tauri_plugin_process::init()) - // 将 EcoPaste 设置为特殊的 URL 或者文件的默认处理程序:https://github.com/tauri-apps/plugins-workspace/tree/v2/plugins/deep-link - .plugin(tauri_plugin_deep_link::init()) // 自定义的窗口管理插件 .plugin(tauri_plugin_eco_window::init()) // 自定义的 fs_extra 插件 diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 85f1229066..d23b919a0d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -73,14 +73,7 @@ "icons/icon.icns", "icons/icon.ico" ], - "resources": ["assets/tray.ico", "assets/tray-mac.ico"], - "fileAssociations": [ - { - "ext": ["EcoPaste-backup"], - "mimeType": "text/plain", - "description": "EcoPaste Backup File" - } - ] + "resources": ["assets/tray.ico", "assets/tray-mac.ico"] }, "plugins": { "updater": { diff --git a/src/pages/Backup/components/Manual/index.tsx b/src/pages/Backup/components/Manual/index.tsx index bbb70c4950..983ffab19f 100644 --- a/src/pages/Backup/components/Manual/index.tsx +++ b/src/pages/Backup/components/Manual/index.tsx @@ -2,7 +2,6 @@ import Icon from "@/components/Icon"; import ProList from "@/components/ProList"; import { emit } from "@tauri-apps/api/event"; import { downloadDir } from "@tauri-apps/api/path"; -import { onOpenUrl } from "@tauri-apps/plugin-deep-link"; import { open } from "@tauri-apps/plugin-dialog"; import { Flex, List, message } from "antd"; import type { FC } from "react"; @@ -12,35 +11,25 @@ const Manual: FC<{ state: State }> = (props) => { const { state } = props; const { t } = useTranslation(); - useMount(() => { - onOpenUrl((urls) => { - const url = urls.find((item) => item.endsWith(extname())); - - if (!url) return; - - handleImport(url.replace("file://", "")); - }); - }); - + // 备份文件的扩展名 const extname = () => { return `${globalStore.env.appName}-backup`; }; - const handleImport = async (path?: string | null) => { + // 导入数据 + const handleImport = async () => { try { - let srcPath = path; - - srcPath ??= await open({ + const path = await open({ filters: [{ name: "", extensions: [extname()] }], }); showWindow(); - if (!srcPath) return; + if (!path) return; state.spinning = true; - const result = await importData(srcPath); + const result = await importData(path); state.spinning = false; @@ -60,6 +49,7 @@ const Manual: FC<{ state: State }> = (props) => { } }; + // 导出数据 const handleExport = async () => { try { state.spinning = true; @@ -112,7 +102,7 @@ const Manual: FC<{ state: State }> = (props) => { justify="center" gap="small" className="b b-color-2 hover:b-primary h-102 flex-1 cursor-pointer rounded-8 bg-3 px-8 text-center transition hover:text-primary" - onClick={() => event()} + onClick={event} > {label}