Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2a24c7abd | ||
|
|
732a1f4694 | ||
|
|
4c5aa7084e | ||
|
|
fe1fea671c | ||
|
|
04c754c0ac | ||
|
|
754c22c84e | ||
|
|
629331870b | ||
|
|
78774315cb | ||
|
|
36b9c07928 | ||
|
|
40a818630d | ||
|
|
568511a4cf | ||
|
|
109fb39e09 | ||
|
|
68450d2042 | ||
|
|
8a052bbed6 | ||
|
|
3afbb56640 | ||
|
|
c0ad84a491 | ||
|
|
c72f17605c | ||
|
|
42fbee0cdb | ||
|
|
e9b7ec735f | ||
|
|
743788135f | ||
|
|
8ea3e6fa26 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "clash-verge",
|
"name": "clash-verge",
|
||||||
"version": "0.0.21",
|
"version": "0.0.22",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tauri dev",
|
"dev": "tauri dev",
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"@emotion/styled": "^11.8.1",
|
"@emotion/styled": "^11.8.1",
|
||||||
"@mui/icons-material": "^5.4.4",
|
"@mui/icons-material": "^5.4.4",
|
||||||
"@mui/material": "^5.4.4",
|
"@mui/material": "^5.4.4",
|
||||||
"@tauri-apps/api": "^1.0.0-rc.1",
|
"@tauri-apps/api": "^1.0.0-rc.2",
|
||||||
"ahooks": "^3.1.13",
|
"ahooks": "^3.1.13",
|
||||||
"axios": "^0.26.0",
|
"axios": "^0.26.0",
|
||||||
"dayjs": "^1.10.8",
|
"dayjs": "^1.10.8",
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@actions/github": "^5.0.0",
|
"@actions/github": "^5.0.0",
|
||||||
"@tauri-apps/cli": "^1.0.0-rc.5",
|
"@tauri-apps/cli": "^1.0.0-rc.7",
|
||||||
"@types/fs-extra": "^9.0.13",
|
"@types/fs-extra": "^9.0.13",
|
||||||
"@types/js-cookie": "^3.0.1",
|
"@types/js-cookie": "^3.0.1",
|
||||||
"@types/react": "^17.0.0",
|
"@types/react": "^17.0.0",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import fetch from "node-fetch";
|
|||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
|
|
||||||
const cwd = process.cwd();
|
const cwd = process.cwd();
|
||||||
|
const FORCE = process.argv.includes("--force");
|
||||||
|
|
||||||
const CLASH_URL_PREFIX =
|
const CLASH_URL_PREFIX =
|
||||||
"https://github.com/Dreamacro/clash/releases/download/premium/";
|
"https://github.com/Dreamacro/clash/releases/download/premium/";
|
||||||
@@ -19,9 +20,10 @@ function resolveClash() {
|
|||||||
|
|
||||||
// todo
|
// todo
|
||||||
const map = {
|
const map = {
|
||||||
"win32-x64": "clash-windows-386",
|
"win32-x64": "clash-windows-amd64",
|
||||||
"darwin-x64": "clash-darwin-amd64",
|
"darwin-x64": "clash-darwin-amd64",
|
||||||
"darwin-arm64": "clash-darwin-arm64",
|
"darwin-arm64": "clash-darwin-arm64",
|
||||||
|
"linux-x64": "clash-linux-amd64",
|
||||||
};
|
};
|
||||||
|
|
||||||
const name = map[`${platform}-${arch}`];
|
const name = map[`${platform}-${arch}`];
|
||||||
@@ -51,7 +53,7 @@ async function resolveSidecar() {
|
|||||||
const sidecarPath = path.join(sidecarDir, sidecarFile);
|
const sidecarPath = path.join(sidecarDir, sidecarFile);
|
||||||
|
|
||||||
await fs.mkdirp(sidecarDir);
|
await fs.mkdirp(sidecarDir);
|
||||||
if (await fs.pathExists(sidecarPath)) return;
|
if (!FORCE && (await fs.pathExists(sidecarPath))) return;
|
||||||
|
|
||||||
// download sidecar
|
// download sidecar
|
||||||
const binInfo = resolveClash();
|
const binInfo = resolveClash();
|
||||||
@@ -98,7 +100,7 @@ async function resolveMmdb() {
|
|||||||
|
|
||||||
const resDir = path.join(cwd, "src-tauri", "resources");
|
const resDir = path.join(cwd, "src-tauri", "resources");
|
||||||
const resPath = path.join(resDir, "Country.mmdb");
|
const resPath = path.join(resDir, "Country.mmdb");
|
||||||
if (await fs.pathExists(resPath)) return;
|
if (!FORCE && (await fs.pathExists(resPath))) return;
|
||||||
await fs.mkdirp(resDir);
|
await fs.mkdirp(resDir);
|
||||||
await downloadFile(url, resPath);
|
await downloadFile(url, resPath);
|
||||||
}
|
}
|
||||||
|
|||||||
203
src-tauri/Cargo.lock
generated
203
src-tauri/Cargo.lock
generated
@@ -34,9 +34,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.55"
|
version = "1.0.56"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "159bb86af3a200e19a068f4224eae4c8bb2d0fa054c7e5d1cacd5cef95e684cd"
|
checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arc-swap"
|
name = "arc-swap"
|
||||||
@@ -147,9 +147,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-task"
|
name = "async-task"
|
||||||
version = "4.1.0"
|
version = "4.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "677d306121baf53310a3fd342d88dc0824f6bbeace68347593658525565abee8"
|
checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
@@ -180,8 +180,8 @@ version = "0.15.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6"
|
checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
]
|
]
|
||||||
@@ -317,27 +317,6 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
|
checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bzip2"
|
|
||||||
version = "0.4.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0"
|
|
||||||
dependencies = [
|
|
||||||
"bzip2-sys",
|
|
||||||
"libc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bzip2-sys"
|
|
||||||
version = "0.1.11+1.0.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
|
|
||||||
dependencies = [
|
|
||||||
"cc",
|
|
||||||
"libc",
|
|
||||||
"pkg-config",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cache-padded"
|
name = "cache-padded"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
@@ -363,7 +342,7 @@ version = "0.15.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8"
|
checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
]
|
]
|
||||||
@@ -1173,9 +1152,9 @@ version = "0.15.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "413424d9818621fa3cfc8a3a915cdb89a7c3c507d56761b4ec83a9a98e587171"
|
checksum = "413424d9818621fa3cfc8a3a915cdb89a7c3c507d56761b4ec83a9a98e587171"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gio-sys 0.15.6",
|
"gio-sys 0.15.7",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
]
|
]
|
||||||
@@ -1188,9 +1167,9 @@ checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cairo-sys-rs",
|
"cairo-sys-rs",
|
||||||
"gdk-pixbuf-sys",
|
"gdk-pixbuf-sys",
|
||||||
"gio-sys 0.15.6",
|
"gio-sys 0.15.7",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"pango-sys",
|
"pango-sys",
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
@@ -1204,7 +1183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178"
|
checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gdk-sys",
|
"gdk-sys",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
"x11",
|
"x11",
|
||||||
@@ -1257,15 +1236,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gio"
|
name = "gio"
|
||||||
version = "0.15.6"
|
version = "0.15.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "96efd8a1c00d890f6b45671916e165b5e43ccec61957d443aff6d7e44f62d348"
|
checksum = "bb50e113645fba48bc36c8abaee1fe5e43d353e8763966e29dfe69660514e461"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"gio-sys 0.15.6",
|
"gio-sys 0.15.7",
|
||||||
"glib",
|
"glib",
|
||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@@ -1287,12 +1266,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gio-sys"
|
name = "gio-sys"
|
||||||
version = "0.15.6"
|
version = "0.15.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1d0fa5052773f5a56b8ae47dab09d040f5d9ce1311f4f99006e16e9a08269296"
|
checksum = "9cb5dabebbb63c5cf763c9d9cb120280bf1a442cc496e17fd78ff75272d68244"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
"winapi",
|
"winapi",
|
||||||
@@ -1300,9 +1279,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glib"
|
name = "glib"
|
||||||
version = "0.15.6"
|
version = "0.15.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa570813c504bdf7539a9400180c2dd4b789a819556fb86da7226d7d1b037b49"
|
checksum = "eb53a1102178803a8ea21d383a4332238e42988be61a97819be583bbb405e969"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
@@ -1310,8 +1289,8 @@ dependencies = [
|
|||||||
"futures-executor",
|
"futures-executor",
|
||||||
"futures-task",
|
"futures-task",
|
||||||
"glib-macros",
|
"glib-macros",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
@@ -1345,9 +1324,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glib-sys"
|
name = "glib-sys"
|
||||||
version = "0.15.6"
|
version = "0.15.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f4366377bd56697de8aaee24e673c575d2694d72e7756324ded2b0428829a7b8"
|
checksum = "19289e4953dad38c9fea1c5c52cc594f29afc4a70802822ef382dca356b27bfd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
@@ -1385,11 +1364,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gobject-sys"
|
name = "gobject-sys"
|
||||||
version = "0.15.5"
|
version = "0.15.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "df6859463843c20cf3837e3a9069b6ab2051aeeadf4c899d33344f4aea83189a"
|
checksum = "db362c9cb92af37a8d58cedb3464ff307485dcc463e46b298f1da1bda60f78b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
]
|
]
|
||||||
@@ -1427,9 +1406,9 @@ dependencies = [
|
|||||||
"cairo-sys-rs",
|
"cairo-sys-rs",
|
||||||
"gdk-pixbuf-sys",
|
"gdk-pixbuf-sys",
|
||||||
"gdk-sys",
|
"gdk-sys",
|
||||||
"gio-sys 0.15.6",
|
"gio-sys 0.15.7",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"pango-sys",
|
"pango-sys",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
@@ -1710,9 +1689,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipnet"
|
name = "ipnet"
|
||||||
version = "2.3.1"
|
version = "2.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9"
|
checksum = "35e70ee094dc02fd9c13fdad4940090f22dbd6ac7c9e7094a46cf0232a50bc7c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "itertools"
|
||||||
@@ -1752,8 +1731,8 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c"
|
checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 5.0.0",
|
"system-deps 5.0.0",
|
||||||
]
|
]
|
||||||
@@ -2209,18 +2188,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num_enum"
|
name = "num_enum"
|
||||||
version = "0.5.6"
|
version = "0.5.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad"
|
checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num_enum_derive",
|
"num_enum_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "num_enum_derive"
|
name = "num_enum_derive"
|
||||||
version = "0.5.6"
|
version = "0.5.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21"
|
checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate 1.1.3",
|
"proc-macro-crate 1.1.3",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -2235,6 +2214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
|
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"malloc_buf",
|
"malloc_buf",
|
||||||
|
"objc_exception",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2248,6 +2228,15 @@ dependencies = [
|
|||||||
"objc_id",
|
"objc_id",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "objc_exception"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objc_id"
|
name = "objc_id"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
@@ -2259,9 +2248,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.9.0"
|
version = "1.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
|
checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "opaque-debug"
|
name = "opaque-debug"
|
||||||
@@ -2271,9 +2260,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "open"
|
name = "open"
|
||||||
version = "2.1.0"
|
version = "2.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5a82915836ef43159bb6a3c64d884c42329ccd0b8afdca737cf1e3dd701709dc"
|
checksum = "9213e7b66aa06a7722828ee2980c1adff22a3922b582baaa1e62e30ca2a6c018"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pathdiff",
|
"pathdiff",
|
||||||
"winapi",
|
"winapi",
|
||||||
@@ -2343,9 +2332,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pango"
|
name = "pango"
|
||||||
version = "0.15.6"
|
version = "0.15.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "78c7420fc01a390ec200da7395b64d705f5d82fe03e5d0708aee422c46538be7"
|
checksum = "a159678be05876e40e1bb4e93db9c9e2f86986fac010b3630feab1273f83b605"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"glib",
|
"glib",
|
||||||
@@ -2360,8 +2349,8 @@ version = "0.15.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7022c2fb88cd2d9d55e1a708a8c53a3ae8678234c4a54bf623400aeb7f31fac2"
|
checksum = "7022c2fb88cd2d9d55e1a708a8c53a3ae8678234c4a54bf623400aeb7f31fac2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"libc",
|
"libc",
|
||||||
"system-deps 6.0.2",
|
"system-deps 6.0.2",
|
||||||
]
|
]
|
||||||
@@ -2853,9 +2842,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.5.4"
|
version = "1.5.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
|
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -2931,8 +2920,8 @@ dependencies = [
|
|||||||
"ashpd",
|
"ashpd",
|
||||||
"block",
|
"block",
|
||||||
"dispatch",
|
"dispatch",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"gtk-sys",
|
"gtk-sys",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
@@ -3293,9 +3282,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "siphasher"
|
name = "siphasher"
|
||||||
version = "0.3.9"
|
version = "0.3.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a86232ab60fa71287d7f2ddae4a7073f6b7aac33631c3015abb556f08c6d0a3e"
|
checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
@@ -3473,9 +3462,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tao"
|
name = "tao"
|
||||||
version = "0.6.3"
|
version = "0.6.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c4c62fc16d698750c5c918088c8134c63e8661e65efc608fe614236c59462f4"
|
checksum = "6a01ed3d6141768e0e36bfe3910f24511022c3dfb977810b00c518d507d4ead4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cairo-rs",
|
"cairo-rs",
|
||||||
@@ -3491,7 +3480,7 @@ dependencies = [
|
|||||||
"gdkx11-sys",
|
"gdkx11-sys",
|
||||||
"gio",
|
"gio",
|
||||||
"glib",
|
"glib",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gtk",
|
"gtk",
|
||||||
"instant",
|
"instant",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
@@ -3538,9 +3527,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri"
|
name = "tauri"
|
||||||
version = "1.0.0-rc.3"
|
version = "1.0.0-rc.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bb0c4a4ffd1f9b02cc3e974ce902f8132fb3d08ec6cce4ca193f97d921f5bce4"
|
checksum = "1112a78b3de89c41e01b671d62f24038d324c6cb61708896ee16f533b655c82e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"attohttpc",
|
"attohttpc",
|
||||||
@@ -3558,6 +3547,7 @@ dependencies = [
|
|||||||
"gtk",
|
"gtk",
|
||||||
"http",
|
"http",
|
||||||
"ignore",
|
"ignore",
|
||||||
|
"memchr",
|
||||||
"minisign-verify",
|
"minisign-verify",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"open",
|
"open",
|
||||||
@@ -3584,14 +3574,15 @@ dependencies = [
|
|||||||
"tokio",
|
"tokio",
|
||||||
"url",
|
"url",
|
||||||
"uuid",
|
"uuid",
|
||||||
|
"windows",
|
||||||
"zip",
|
"zip",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-build"
|
name = "tauri-build"
|
||||||
version = "1.0.0-rc.3"
|
version = "1.0.0-rc.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "855e47d8cfb2219fc14d2eed2c09bfb35f9ecd71a40ca2084aeeee2d23e0b60d"
|
checksum = "d7e31905edc1b40f369beccbbfb30b2e44c2f2bb1ffc06a3778d844af4a81da8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
@@ -3602,12 +3593,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-codegen"
|
name = "tauri-codegen"
|
||||||
version = "1.0.0-rc.2"
|
version = "1.0.0-rc.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "eef4656d174ba982198266da0c016573fe6c7c760e4290f05c8c384fe180007e"
|
checksum = "fbcba93e945eb73ee232621763a1295247d0155867bb72e815ab107a10a7cf97"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"blake3",
|
"blake3",
|
||||||
|
"ico",
|
||||||
|
"png 0.16.8",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -3623,9 +3616,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-macros"
|
name = "tauri-macros"
|
||||||
version = "1.0.0-rc.2"
|
version = "1.0.0-rc.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a0993f5a867e321d26200b2d6394cdf482bd6cc5a0e4691bcabf811544f51cd4"
|
checksum = "ed251657dcdd21922e0146af5f8a3b9ccf92707d4a42add615c250ff92a6838d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.4.0",
|
"heck 0.4.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -3637,9 +3630,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-runtime"
|
name = "tauri-runtime"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "851cd65e2c9df4dd70a4f9e115fb2441ac89f1c80df79de0c15a448b4acd7768"
|
checksum = "ae0442d935c2d168541d74be51c4d4f176b1c00ee6bf052f07c1aa5f688ba497"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gtk",
|
"gtk",
|
||||||
"http",
|
"http",
|
||||||
@@ -3656,14 +3649,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-runtime-wry"
|
name = "tauri-runtime-wry"
|
||||||
version = "0.3.2"
|
version = "0.3.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0184f95e065fb80afadf53f0a5f87a75af2da774d0524fe8cb2976fbec4a0bf2"
|
checksum = "643aaa56237304264804dbf34748b21042eadda71d2e964bced1651c19cc0314"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gtk",
|
"gtk",
|
||||||
"ico",
|
|
||||||
"infer",
|
|
||||||
"png 0.16.8",
|
|
||||||
"tauri-runtime",
|
"tauri-runtime",
|
||||||
"tauri-utils",
|
"tauri-utils",
|
||||||
"uuid",
|
"uuid",
|
||||||
@@ -3674,9 +3664,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-utils"
|
name = "tauri-utils"
|
||||||
version = "1.0.0-rc.2"
|
version = "1.0.0-rc.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0ad38ad698838886bf22ecb91c4b3d1ce178fdff7901ac7bff370103a4f51e59"
|
checksum = "21f11483d205c77d1ec398e80566485101696335983e69832cc6c41ab1e07266"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ctor",
|
"ctor",
|
||||||
"glob",
|
"glob",
|
||||||
@@ -4280,10 +4270,10 @@ dependencies = [
|
|||||||
"gdk",
|
"gdk",
|
||||||
"gdk-sys",
|
"gdk-sys",
|
||||||
"gio",
|
"gio",
|
||||||
"gio-sys 0.15.6",
|
"gio-sys 0.15.7",
|
||||||
"glib",
|
"glib",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"gtk",
|
"gtk",
|
||||||
"gtk-sys",
|
"gtk-sys",
|
||||||
"javascriptcore-rs",
|
"javascriptcore-rs",
|
||||||
@@ -4303,9 +4293,9 @@ dependencies = [
|
|||||||
"cairo-sys-rs",
|
"cairo-sys-rs",
|
||||||
"gdk-pixbuf-sys",
|
"gdk-pixbuf-sys",
|
||||||
"gdk-sys",
|
"gdk-sys",
|
||||||
"gio-sys 0.15.6",
|
"gio-sys 0.15.7",
|
||||||
"glib-sys 0.15.6",
|
"glib-sys 0.15.7",
|
||||||
"gobject-sys 0.15.5",
|
"gobject-sys 0.15.7",
|
||||||
"gtk-sys",
|
"gtk-sys",
|
||||||
"javascriptcore-rs-sys",
|
"javascriptcore-rs-sys",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -4411,8 +4401,8 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "window-shadows"
|
name = "window-shadows"
|
||||||
version = "0.0.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/tauri-apps/window-shadows#72de826498573de6bed48038bbc74a3dbde7460e"
|
source = "git+https://github.com/tauri-apps/window-shadows#71c656abf892313e0a91d56ddf8bef5d80bd2a22"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"objc",
|
"objc",
|
||||||
@@ -4423,7 +4413,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "window-vibrancy"
|
name = "window-vibrancy"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/tauri-apps/window-vibrancy#3fd5be20535ec9b595e893b75dc74b6725664852"
|
source = "git+https://github.com/tauri-apps/window-vibrancy#c91cd362e0758fe93cf41a740d2e00a668523fe8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"objc",
|
"objc",
|
||||||
@@ -4768,11 +4758,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815"
|
checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"bzip2",
|
|
||||||
"crc32fast",
|
"crc32fast",
|
||||||
"flate2",
|
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"time",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ edition = "2021"
|
|||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "1.0.0-rc.3", features = [] }
|
tauri-build = { version = "1.0.0-rc.4", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
@@ -21,7 +21,7 @@ chrono = "0.4.19"
|
|||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
serde_yaml = "0.8"
|
serde_yaml = "0.8"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
tauri = { version = "1.0.0-rc.3", features = ["shell-all", "system-tray", "updater", "window-all"] }
|
tauri = { version = "1.0.0-rc.4", features = ["shell-all", "system-tray", "updater", "window-all"] }
|
||||||
window-shadows = { git = "https://github.com/tauri-apps/window-shadows" }
|
window-shadows = { git = "https://github.com/tauri-apps/window-shadows" }
|
||||||
window-vibrancy = { git = "https://github.com/tauri-apps/window-vibrancy" }
|
window-vibrancy = { git = "https://github.com/tauri-apps/window-vibrancy" }
|
||||||
|
|
||||||
|
|||||||
BIN
src-tauri/icons/icon-shrink.png
Normal file
BIN
src-tauri/icons/icon-shrink.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
core::{ClashInfo, PrfItem, Profiles, VergeConfig},
|
core::{ClashInfo, PrfItem, PrfOption, Profiles, VergeConfig},
|
||||||
states::{ClashState, ProfilesState, VergeState},
|
states::{ClashState, ProfilesState, VergeState},
|
||||||
utils::{dirs, sysopt::SysProxyConfig},
|
utils::{dirs, sysopt::SysProxyConfig},
|
||||||
};
|
};
|
||||||
@@ -28,10 +28,10 @@ pub fn sync_profiles(profiles_state: State<'_, ProfilesState>) -> Result<(), Str
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn import_profile(
|
pub async fn import_profile(
|
||||||
url: String,
|
url: String,
|
||||||
with_proxy: bool,
|
option: Option<PrfOption>,
|
||||||
profiles_state: State<'_, ProfilesState>,
|
profiles_state: State<'_, ProfilesState>,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
let item = wrap_err!(PrfItem::from_url(&url, None, None, with_proxy).await)?;
|
let item = wrap_err!(PrfItem::from_url(&url, None, None, option).await)?;
|
||||||
|
|
||||||
let mut profiles = profiles_state.0.lock().unwrap();
|
let mut profiles = profiles_state.0.lock().unwrap();
|
||||||
wrap_err!(profiles.append_item(item))
|
wrap_err!(profiles.append_item(item))
|
||||||
@@ -55,7 +55,7 @@ pub async fn create_profile(
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn update_profile(
|
pub async fn update_profile(
|
||||||
index: String,
|
index: String,
|
||||||
with_proxy: bool,
|
option: Option<PrfOption>,
|
||||||
clash_state: State<'_, ClashState>,
|
clash_state: State<'_, ClashState>,
|
||||||
profiles_state: State<'_, ProfilesState>,
|
profiles_state: State<'_, ProfilesState>,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
@@ -71,7 +71,7 @@ pub async fn update_profile(
|
|||||||
item.url.clone().unwrap()
|
item.url.clone().unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
let item = wrap_err!(PrfItem::from_url(&url, None, None, with_proxy).await)?;
|
let item = wrap_err!(PrfItem::from_url(&url, None, None, option).await)?;
|
||||||
|
|
||||||
let mut profiles = profiles_state.0.lock().unwrap();
|
let mut profiles = profiles_state.0.lock().unwrap();
|
||||||
wrap_err!(profiles.update_item(index.clone(), item))?;
|
wrap_err!(profiles.update_item(index.clone(), item))?;
|
||||||
@@ -181,21 +181,23 @@ pub fn view_profile(index: String, profiles_state: State<'_, ProfilesState>) ->
|
|||||||
{
|
{
|
||||||
use std::os::windows::process::CommandExt;
|
use std::os::windows::process::CommandExt;
|
||||||
|
|
||||||
return match Command::new(code)
|
if let Err(err) = Command::new(code)
|
||||||
.creation_flags(0x08000000)
|
.creation_flags(0x08000000)
|
||||||
.arg(path)
|
.arg(path)
|
||||||
.spawn()
|
.spawn()
|
||||||
{
|
{
|
||||||
Ok(_) => Ok(()),
|
log::error!("{err}");
|
||||||
Err(_) => Err("failed to open file by VScode".into()),
|
return Err("failed to open file by VScode".into());
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
return match Command::new(code).arg(path).spawn() {
|
if let Err(err) = Command::new(code).arg(path).spawn() {
|
||||||
Ok(_) => Ok(()),
|
log::error!("{err}");
|
||||||
Err(_) => Err("failed to open file by VScode".into()),
|
return Err("failed to open file by VScode".into());
|
||||||
};
|
}
|
||||||
|
|
||||||
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
open_path_cmd(path, "failed to open file by `open`")
|
open_path_cmd(path, "failed to open file by `open`")
|
||||||
@@ -317,19 +319,21 @@ fn open_path_cmd(dir: PathBuf, err_str: &str) -> Result<(), String> {
|
|||||||
{
|
{
|
||||||
use std::os::windows::process::CommandExt;
|
use std::os::windows::process::CommandExt;
|
||||||
|
|
||||||
match Command::new("explorer")
|
if let Err(err) = Command::new("explorer")
|
||||||
.creation_flags(0x08000000)
|
.creation_flags(0x08000000)
|
||||||
.arg(dir)
|
.arg(dir)
|
||||||
.spawn()
|
.spawn()
|
||||||
{
|
{
|
||||||
Ok(_) => Ok(()),
|
log::error!("{err}");
|
||||||
Err(_) => Err(err_str.into()),
|
return Err(err_str.into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
match Command::new("open").arg(dir).spawn() {
|
if let Err(err) = Command::new("open").arg(dir).spawn() {
|
||||||
Ok(_) => Ok(()),
|
log::error!("{err}");
|
||||||
Err(_) => Err(err_str.into()),
|
return Err(err_str.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,8 +258,14 @@ impl Clash {
|
|||||||
config::save_yaml(temp_path.clone(), &config, Some("# Clash Verge Temp File"))?;
|
config::save_yaml(temp_path.clone(), &config, Some("# Clash Verge Temp File"))?;
|
||||||
|
|
||||||
tauri::async_runtime::spawn(async move {
|
tauri::async_runtime::spawn(async move {
|
||||||
|
// `external-controller` could be
|
||||||
|
// "127.0.0.1:9090" or ":9090"
|
||||||
|
// Todo: maybe it could support single port
|
||||||
let server = info.server.unwrap();
|
let server = info.server.unwrap();
|
||||||
let server = format!("http://{server}/configs");
|
let server = match server.starts_with(":") {
|
||||||
|
true => format!("http://127.0.0.1{server}/configs"),
|
||||||
|
false => format!("http://{server}/configs"),
|
||||||
|
};
|
||||||
|
|
||||||
let mut headers = HeaderMap::new();
|
let mut headers = HeaderMap::new();
|
||||||
headers.insert("Content-Type", "application/json".parse().unwrap());
|
headers.insert("Content-Type", "application/json".parse().unwrap());
|
||||||
@@ -320,9 +326,28 @@ impl Clash {
|
|||||||
let result: PrfEnhancedResult = serde_json::from_str(result).unwrap();
|
let result: PrfEnhancedResult = serde_json::from_str(result).unwrap();
|
||||||
|
|
||||||
if let Some(data) = result.data {
|
if let Some(data) = result.data {
|
||||||
|
// all of these can not be revised by script
|
||||||
|
// http/https/socks port should be under control
|
||||||
|
let not_allow: Vec<Value> = vec![
|
||||||
|
"port",
|
||||||
|
"socks-port",
|
||||||
|
"mixed-port",
|
||||||
|
"allow-lan",
|
||||||
|
"mode",
|
||||||
|
"external-controller",
|
||||||
|
"secret",
|
||||||
|
"log-level",
|
||||||
|
]
|
||||||
|
.iter()
|
||||||
|
.map(|&i| Value::from(i))
|
||||||
|
.collect();
|
||||||
|
|
||||||
for (key, value) in data.into_iter() {
|
for (key, value) in data.into_iter() {
|
||||||
config.insert(key, value);
|
if not_allow.iter().find(|&i| i == &key).is_none() {
|
||||||
|
config.insert(key, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Self::_activate(info, config).unwrap();
|
Self::_activate(info, config).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,13 +31,17 @@ pub struct PrfItem {
|
|||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub selected: Option<Vec<PrfSelected>>,
|
pub selected: Option<Vec<PrfSelected>>,
|
||||||
|
|
||||||
/// user info
|
/// subscription user info
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub extra: Option<PrfExtra>,
|
pub extra: Option<PrfExtra>,
|
||||||
|
|
||||||
/// updated time
|
/// updated time
|
||||||
pub updated: Option<usize>,
|
pub updated: Option<usize>,
|
||||||
|
|
||||||
|
/// some options of the item
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub option: Option<PrfOption>,
|
||||||
|
|
||||||
/// the file data
|
/// the file data
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
pub file_data: Option<String>,
|
pub file_data: Option<String>,
|
||||||
@@ -57,6 +61,18 @@ pub struct PrfExtra {
|
|||||||
pub expire: usize,
|
pub expire: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
||||||
|
pub struct PrfOption {
|
||||||
|
/// for `remote` profile's http request
|
||||||
|
/// see issue #13
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub user_agent: Option<String>,
|
||||||
|
|
||||||
|
/// for `remote` profile
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub with_proxy: Option<bool>,
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for PrfItem {
|
impl Default for PrfItem {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
PrfItem {
|
PrfItem {
|
||||||
@@ -69,6 +85,7 @@ impl Default for PrfItem {
|
|||||||
selected: None,
|
selected: None,
|
||||||
extra: None,
|
extra: None,
|
||||||
updated: None,
|
updated: None,
|
||||||
|
option: None,
|
||||||
file_data: None,
|
file_data: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,7 +107,7 @@ impl PrfItem {
|
|||||||
let url = item.url.as_ref().unwrap().as_str();
|
let url = item.url.as_ref().unwrap().as_str();
|
||||||
let name = item.name;
|
let name = item.name;
|
||||||
let desc = item.desc;
|
let desc = item.desc;
|
||||||
PrfItem::from_url(url, name, desc, false).await
|
PrfItem::from_url(url, name, desc, item.option).await
|
||||||
}
|
}
|
||||||
"local" => {
|
"local" => {
|
||||||
let name = item.name.unwrap_or("Local File".into());
|
let name = item.name.unwrap_or("Local File".into());
|
||||||
@@ -126,6 +143,7 @@ impl PrfItem {
|
|||||||
url: None,
|
url: None,
|
||||||
selected: None,
|
selected: None,
|
||||||
extra: None,
|
extra: None,
|
||||||
|
option: None,
|
||||||
updated: Some(help::get_now()),
|
updated: Some(help::get_now()),
|
||||||
file_data: Some(tmpl::ITEM_LOCAL.into()),
|
file_data: Some(tmpl::ITEM_LOCAL.into()),
|
||||||
})
|
})
|
||||||
@@ -137,13 +155,25 @@ impl PrfItem {
|
|||||||
url: &str,
|
url: &str,
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
desc: Option<String>,
|
desc: Option<String>,
|
||||||
with_proxy: bool,
|
option: Option<PrfOption>,
|
||||||
) -> Result<PrfItem> {
|
) -> Result<PrfItem> {
|
||||||
|
let with_proxy = match option.as_ref() {
|
||||||
|
Some(opt) => opt.with_proxy.unwrap_or(false),
|
||||||
|
None => false,
|
||||||
|
};
|
||||||
|
let user_agent = match option.as_ref() {
|
||||||
|
Some(opt) => opt.user_agent.clone(),
|
||||||
|
None => None,
|
||||||
|
};
|
||||||
|
|
||||||
let mut builder = reqwest::ClientBuilder::new();
|
let mut builder = reqwest::ClientBuilder::new();
|
||||||
|
|
||||||
if !with_proxy {
|
if !with_proxy {
|
||||||
builder = builder.no_proxy();
|
builder = builder.no_proxy();
|
||||||
}
|
}
|
||||||
|
if let Some(user_agent) = user_agent {
|
||||||
|
builder = builder.user_agent(user_agent);
|
||||||
|
}
|
||||||
|
|
||||||
let resp = builder.build()?.get(url).send().await?;
|
let resp = builder.build()?.get(url).send().await?;
|
||||||
let header = resp.headers();
|
let header = resp.headers();
|
||||||
@@ -177,6 +207,7 @@ impl PrfItem {
|
|||||||
url: Some(url.into()),
|
url: Some(url.into()),
|
||||||
selected: None,
|
selected: None,
|
||||||
extra,
|
extra,
|
||||||
|
option,
|
||||||
updated: Some(help::get_now()),
|
updated: Some(help::get_now()),
|
||||||
file_data: Some(data),
|
file_data: Some(data),
|
||||||
})
|
})
|
||||||
@@ -197,6 +228,7 @@ impl PrfItem {
|
|||||||
url: None,
|
url: None,
|
||||||
selected: None,
|
selected: None,
|
||||||
extra: None,
|
extra: None,
|
||||||
|
option: None,
|
||||||
updated: Some(help::get_now()),
|
updated: Some(help::get_now()),
|
||||||
file_data: Some(tmpl::ITEM_MERGE.into()),
|
file_data: Some(tmpl::ITEM_MERGE.into()),
|
||||||
})
|
})
|
||||||
@@ -217,6 +249,7 @@ impl PrfItem {
|
|||||||
url: None,
|
url: None,
|
||||||
selected: None,
|
selected: None,
|
||||||
extra: None,
|
extra: None,
|
||||||
|
option: None,
|
||||||
updated: Some(help::get_now()),
|
updated: Some(help::get_now()),
|
||||||
file_data: Some(tmpl::ITEM_SCRIPT.into()),
|
file_data: Some(tmpl::ITEM_SCRIPT.into()),
|
||||||
})
|
})
|
||||||
@@ -380,8 +413,10 @@ impl Profiles {
|
|||||||
patch!(each, item, url);
|
patch!(each, item, url);
|
||||||
patch!(each, item, selected);
|
patch!(each, item, selected);
|
||||||
patch!(each, item, extra);
|
patch!(each, item, extra);
|
||||||
|
patch!(each, item, updated);
|
||||||
|
|
||||||
each.updated = Some(help::get_now());
|
// can be removed
|
||||||
|
each.option = item.option;
|
||||||
|
|
||||||
self.items = Some(items);
|
self.items = Some(items);
|
||||||
return self.save_file();
|
return self.save_file();
|
||||||
|
|||||||
@@ -67,13 +67,13 @@ pub fn init_app(package_info: &PackageInfo) {
|
|||||||
let res_dir = dirs::app_resources_dir(package_info);
|
let res_dir = dirs::app_resources_dir(package_info);
|
||||||
|
|
||||||
if !app_dir.exists() {
|
if !app_dir.exists() {
|
||||||
fs::create_dir(&app_dir).unwrap();
|
fs::create_dir_all(&app_dir).unwrap();
|
||||||
}
|
}
|
||||||
if !log_dir.exists() {
|
if !log_dir.exists() {
|
||||||
fs::create_dir(&log_dir).unwrap();
|
fs::create_dir_all(&log_dir).unwrap();
|
||||||
}
|
}
|
||||||
if !profiles_dir.exists() {
|
if !profiles_dir.exists() {
|
||||||
fs::create_dir(&profiles_dir).unwrap();
|
fs::create_dir_all(&profiles_dir).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
init_log(&log_dir);
|
init_log(&log_dir);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ fn resolve_window(app: &App) {
|
|||||||
|
|
||||||
window.set_decorations(false).unwrap();
|
window.set_decorations(false).unwrap();
|
||||||
set_shadow(&window, true).unwrap();
|
set_shadow(&window, true).unwrap();
|
||||||
apply_blur(&window).unwrap();
|
apply_blur(&window, None).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
|
use anyhow::Result;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::io;
|
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
static DEFAULT_BYPASS: &str = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*;<local>";
|
static DEFAULT_BYPASS: &str = "localhost;127.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;192.168.*;<local>";
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
static DEFAULT_BYPASS: &str = "localhost,127.0.0.1/8,::1";
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
static DEFAULT_BYPASS: &str =
|
static DEFAULT_BYPASS: &str =
|
||||||
"192.168.0.0/16\n10.0.0.0/8\n172.16.0.0/12\n127.0.0.1\nlocalhost\n*.local\ntimestamp.apple.com\n";
|
"192.168.0.0/16\n10.0.0.0/8\n172.16.0.0/12\n127.0.0.1\nlocalhost\n*.local\ntimestamp.apple.com\n";
|
||||||
@@ -34,10 +36,12 @@ impl SysProxyConfig {
|
|||||||
bypass: bypass.unwrap_or(DEFAULT_BYPASS.into()),
|
bypass: bypass.unwrap_or(DEFAULT_BYPASS.into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
|
impl SysProxyConfig {
|
||||||
/// Get the windows system proxy config
|
/// Get the windows system proxy config
|
||||||
pub fn get_sys() -> io::Result<Self> {
|
pub fn get_sys() -> Result<Self> {
|
||||||
use winreg::enums::*;
|
use winreg::enums::*;
|
||||||
use winreg::RegKey;
|
use winreg::RegKey;
|
||||||
|
|
||||||
@@ -54,9 +58,30 @@ impl SysProxyConfig {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
/// Set the windows system proxy config
|
||||||
|
pub fn set_sys(&self) -> Result<()> {
|
||||||
|
use winreg::enums::*;
|
||||||
|
use winreg::RegKey;
|
||||||
|
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
||||||
|
let cur_var = hkcu.open_subkey_with_flags(
|
||||||
|
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
|
||||||
|
KEY_SET_VALUE,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let enable: u32 = if self.enable { 1u32 } else { 0u32 };
|
||||||
|
|
||||||
|
cur_var.set_value("ProxyEnable", &enable)?;
|
||||||
|
cur_var.set_value("ProxyServer", &self.server)?;
|
||||||
|
cur_var.set_value("ProxyOverride", &self.bypass)?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
impl SysProxyConfig {
|
||||||
/// Get the macos system proxy config
|
/// Get the macos system proxy config
|
||||||
pub fn get_sys() -> io::Result<Self> {
|
pub fn get_sys() -> Result<Self> {
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
let http = macproxy::get_proxy(&["-getwebproxy", MACOS_SERVICE])?;
|
let http = macproxy::get_proxy(&["-getwebproxy", MACOS_SERVICE])?;
|
||||||
@@ -82,63 +107,59 @@ impl SysProxyConfig {
|
|||||||
let bypass_output = Command::new("networksetup")
|
let bypass_output = Command::new("networksetup")
|
||||||
.args(["-getproxybypassdomains", MACOS_SERVICE])
|
.args(["-getproxybypassdomains", MACOS_SERVICE])
|
||||||
.output()?;
|
.output()?;
|
||||||
let bypass = std::str::from_utf8(&bypass_output.stdout).unwrap_or(DEFAULT_BYPASS);
|
|
||||||
|
// change the format to xxx,xxx
|
||||||
|
let bypass = std::str::from_utf8(&bypass_output.stdout)
|
||||||
|
.unwrap_or(DEFAULT_BYPASS)
|
||||||
|
.to_string()
|
||||||
|
.split('\n')
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(",");
|
||||||
|
|
||||||
Ok(SysProxyConfig {
|
Ok(SysProxyConfig {
|
||||||
enable,
|
enable,
|
||||||
server,
|
server,
|
||||||
bypass: bypass.into(),
|
bypass,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
/// Set the windows system proxy config
|
|
||||||
pub fn set_sys(&self) -> io::Result<()> {
|
|
||||||
use winreg::enums::*;
|
|
||||||
use winreg::RegKey;
|
|
||||||
let hkcu = RegKey::predef(HKEY_CURRENT_USER);
|
|
||||||
let cur_var = hkcu.open_subkey_with_flags(
|
|
||||||
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",
|
|
||||||
KEY_SET_VALUE,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
let enable: u32 = if self.enable { 1u32 } else { 0u32 };
|
|
||||||
|
|
||||||
cur_var.set_value("ProxyEnable", &enable)?;
|
|
||||||
cur_var.set_value("ProxyServer", &self.server)?;
|
|
||||||
cur_var.set_value("ProxyOverride", &self.bypass)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
|
||||||
/// Set the macos system proxy config
|
/// Set the macos system proxy config
|
||||||
pub fn set_sys(&self) -> io::Result<()> {
|
pub fn set_sys(&self) -> Result<()> {
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
let enable = self.enable;
|
let enable = self.enable;
|
||||||
let server = self.server.as_str();
|
let server = self.server.as_str();
|
||||||
|
let bypass = self.bypass.clone();
|
||||||
macproxy::set_proxy("-setwebproxy", MACOS_SERVICE, enable, server)?;
|
macproxy::set_proxy("-setwebproxy", MACOS_SERVICE, enable, server)?;
|
||||||
macproxy::set_proxy("-setsecurewebproxy", MACOS_SERVICE, enable, server)?;
|
macproxy::set_proxy("-setsecurewebproxy", MACOS_SERVICE, enable, server)?;
|
||||||
macproxy::set_proxy("-setsocksfirewallproxy", MACOS_SERVICE, enable, server)
|
macproxy::set_proxy("-setsocksfirewallproxy", MACOS_SERVICE, enable, server)?;
|
||||||
|
|
||||||
|
let domains = bypass.split(",").collect::<Vec<_>>();
|
||||||
|
Command::new("networksetup")
|
||||||
|
.args([["-setproxybypassdomains", MACOS_SERVICE].to_vec(), domains].concat())
|
||||||
|
.status()?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
mod macproxy {
|
mod macproxy {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use anyhow::bail;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
/// use networksetup
|
/// use networksetup
|
||||||
/// get the target proxy config
|
/// get the target proxy config
|
||||||
pub(super) fn get_proxy(args: &[&str; 2]) -> io::Result<(String, String)> {
|
pub(super) fn get_proxy(args: &[&str; 2]) -> Result<(String, String)> {
|
||||||
let output = Command::new("networksetup").args(args).output()?;
|
let output = Command::new("networksetup").args(args).output()?;
|
||||||
match std::str::from_utf8(&output.stdout) {
|
|
||||||
Ok(stdout) => {
|
let stdout = std::str::from_utf8(&output.stdout)?;
|
||||||
let enable = parse(stdout, "Enabled:");
|
let enable = parse(stdout, "Enabled:");
|
||||||
let server = parse(stdout, "Server:");
|
let server = parse(stdout, "Server:");
|
||||||
let port = parse(stdout, "Port:");
|
let port = parse(stdout, "Port:");
|
||||||
let server = format!("{}:{}", server, port);
|
let server = format!("{server}:{port}");
|
||||||
Ok((enable.into(), server))
|
Ok((enable.into(), server))
|
||||||
}
|
|
||||||
Err(_) => Err(io::Error::from_raw_os_error(1)),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// use networksetup
|
/// use networksetup
|
||||||
@@ -148,17 +169,17 @@ mod macproxy {
|
|||||||
device: &str,
|
device: &str,
|
||||||
enable: bool,
|
enable: bool,
|
||||||
server: &str,
|
server: &str,
|
||||||
) -> io::Result<()> {
|
) -> Result<()> {
|
||||||
let mut split = server.split(":");
|
let mut split = server.split(":");
|
||||||
let domain = split.next();
|
let host = split.next();
|
||||||
let port = split.next();
|
let port = split.next();
|
||||||
|
|
||||||
// can not parse the field
|
// can not parse the field
|
||||||
if domain.is_none() || port.is_none() {
|
if host.is_none() || port.is_none() {
|
||||||
return Err(io::Error::from_raw_os_error(1));
|
bail!("failed to parse the server into host:port");
|
||||||
}
|
}
|
||||||
|
|
||||||
let args = vec![target, device, domain.unwrap(), port.unwrap()];
|
let args = vec![target, device, host.unwrap(), port.unwrap()];
|
||||||
Command::new("networksetup").args(&args).status()?;
|
Command::new("networksetup").args(&args).status()?;
|
||||||
|
|
||||||
let target_state = String::from(target) + "state";
|
let target_state = String::from(target) + "state";
|
||||||
@@ -169,7 +190,7 @@ mod macproxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// parse the networksetup output
|
/// parse the networksetup output
|
||||||
pub(super) fn parse<'a>(target: &'a str, key: &'a str) -> &'a str {
|
fn parse<'a>(target: &'a str, key: &'a str) -> &'a str {
|
||||||
match target.find(key) {
|
match target.find(key) {
|
||||||
Some(idx) => {
|
Some(idx) => {
|
||||||
let idx = idx + key.len();
|
let idx = idx + key.len();
|
||||||
@@ -209,3 +230,137 @@ mod macproxy {
|
|||||||
dbg!(sysproxy.set_sys().unwrap());
|
dbg!(sysproxy.set_sys().unwrap());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Linux Desktop System Proxy Supports
|
||||||
|
/// by using `gsettings`
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
impl SysProxyConfig {
|
||||||
|
/// Get the system proxy config [http/https/socks]
|
||||||
|
pub fn get_sys() -> Result<Self> {
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
let schema = "org.gnome.system.proxy";
|
||||||
|
|
||||||
|
// get enable
|
||||||
|
let mode = Command::new("gsettings")
|
||||||
|
.args(["get", schema, "mode"])
|
||||||
|
.output()?;
|
||||||
|
let mode = std::str::from_utf8(&mode.stdout)?;
|
||||||
|
let enable = mode == "manual";
|
||||||
|
|
||||||
|
// get bypass
|
||||||
|
// Todo: parse the ignore-hosts
|
||||||
|
// ['aaa', 'bbb'] -> aaa,bbb
|
||||||
|
let ignore = Command::new("gsettings")
|
||||||
|
.args(["get", schema, "ignore-hosts"])
|
||||||
|
.output()?;
|
||||||
|
let ignore = std::str::from_utf8(&ignore.stdout)?;
|
||||||
|
let bypass = ignore.to_string();
|
||||||
|
|
||||||
|
let http = Self::get_proxy("http")?;
|
||||||
|
let https = Self::get_proxy("https")?;
|
||||||
|
let socks = Self::get_proxy("socks")?;
|
||||||
|
|
||||||
|
let mut server = "".into();
|
||||||
|
|
||||||
|
if socks.len() > 0 {
|
||||||
|
server = socks;
|
||||||
|
}
|
||||||
|
if https.len() > 0 {
|
||||||
|
server = https;
|
||||||
|
}
|
||||||
|
if http.len() > 0 {
|
||||||
|
server = http;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(SysProxyConfig {
|
||||||
|
enable,
|
||||||
|
server,
|
||||||
|
bypass,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get the system proxy config [http/https/socks]
|
||||||
|
pub fn set_sys(&self) -> Result<()> {
|
||||||
|
use anyhow::bail;
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
let enable = self.enable;
|
||||||
|
let server = self.server.as_str();
|
||||||
|
let bypass = self.bypass.clone();
|
||||||
|
let schema = "org.gnome.system.proxy";
|
||||||
|
|
||||||
|
if enable {
|
||||||
|
let mut split = server.split(":");
|
||||||
|
let host = split.next();
|
||||||
|
let port = split.next();
|
||||||
|
|
||||||
|
if port.is_none() {
|
||||||
|
bail!("failed to parse the port");
|
||||||
|
}
|
||||||
|
|
||||||
|
let host = format!("'{}'", host.unwrap_or("127.0.0.1"));
|
||||||
|
let host = host.as_str();
|
||||||
|
let port = port.unwrap();
|
||||||
|
|
||||||
|
let http = format!("{schema}.http");
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", http.as_str(), "host", host])
|
||||||
|
.status()?;
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", http.as_str(), "port", port])
|
||||||
|
.status()?;
|
||||||
|
|
||||||
|
let https = format!("{schema}.https");
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", https.as_str(), "host", host])
|
||||||
|
.status()?;
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", https.as_str(), "port", port])
|
||||||
|
.status()?;
|
||||||
|
|
||||||
|
let socks = format!("{schema}.socks");
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", socks.as_str(), "host", host])
|
||||||
|
.status()?;
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", socks.as_str(), "port", port])
|
||||||
|
.status()?;
|
||||||
|
|
||||||
|
// set bypass
|
||||||
|
// Todo: parse the ignore-hosts
|
||||||
|
// aaa,bbb,cccc -> ['aaa', 'bbb', 'ccc']
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", schema, "ignore-hosts", bypass.as_str()]) // todo
|
||||||
|
.status()?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mode = if enable { "'manual'" } else { "'none'" };
|
||||||
|
Command::new("gsettings")
|
||||||
|
.args(["set", schema, "mode", mode])
|
||||||
|
.status()?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// help function
|
||||||
|
fn get_proxy(typ: &str) -> Result<String> {
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
let schema = format!("org.gnome.system.proxy.{typ}");
|
||||||
|
let schema = schema.as_str();
|
||||||
|
|
||||||
|
let host = Command::new("gsettings")
|
||||||
|
.args(["get", schema, "host"])
|
||||||
|
.output()?;
|
||||||
|
let host = std::str::from_utf8(&host.stdout)?;
|
||||||
|
|
||||||
|
let port = Command::new("gsettings")
|
||||||
|
.args(["get", schema, "port"])
|
||||||
|
.output()?;
|
||||||
|
let port = std::str::from_utf8(&port.stdout)?;
|
||||||
|
|
||||||
|
Ok(format!("{host}:{port}"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "clash-verge",
|
"productName": "Clash Verge",
|
||||||
"version": "0.0.21"
|
"version": "0.0.22"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"distDir": "../dist",
|
"distDir": "../dist",
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ const UpdateDialog = (props: Props) => {
|
|||||||
uploadingState = true;
|
uploadingState = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await killSidecars();
|
|
||||||
await installUpdate();
|
await installUpdate();
|
||||||
|
await killSidecars();
|
||||||
await relaunch();
|
await relaunch();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
await restartSidecar();
|
await restartSidecar();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { mutate } from "swr";
|
import { mutate } from "swr";
|
||||||
import { useEffect } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useLockFn, useSetState } from "ahooks";
|
import { useLockFn, useSetState } from "ahooks";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@@ -7,8 +7,10 @@ import {
|
|||||||
DialogActions,
|
DialogActions,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
|
IconButton,
|
||||||
TextField,
|
TextField,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
|
import { Settings } from "@mui/icons-material";
|
||||||
import { CmdType } from "../../services/types";
|
import { CmdType } from "../../services/types";
|
||||||
import { patchProfile } from "../../services/cmds";
|
import { patchProfile } from "../../services/cmds";
|
||||||
import Notice from "../base/base-notice";
|
import Notice from "../base/base-notice";
|
||||||
@@ -20,13 +22,18 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// edit the profile item
|
// edit the profile item
|
||||||
|
// remote / local file / merge / script
|
||||||
const ProfileEdit = (props: Props) => {
|
const ProfileEdit = (props: Props) => {
|
||||||
const { open, itemData, onClose } = props;
|
const { open, itemData, onClose } = props;
|
||||||
const [form, setForm] = useSetState({ ...itemData });
|
const [form, setForm] = useSetState({ ...itemData });
|
||||||
|
const [option, setOption] = useSetState(itemData.option ?? {});
|
||||||
|
const [showOpt, setShowOpt] = useState(!!itemData.option);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (itemData) {
|
if (itemData) {
|
||||||
setForm({ ...itemData });
|
setForm({ ...itemData });
|
||||||
|
setOption(itemData.option ?? {});
|
||||||
|
setShowOpt(!!itemData.option?.user_agent);
|
||||||
}
|
}
|
||||||
}, [itemData]);
|
}, [itemData]);
|
||||||
|
|
||||||
@@ -34,7 +41,14 @@ const ProfileEdit = (props: Props) => {
|
|||||||
try {
|
try {
|
||||||
const { uid } = itemData;
|
const { uid } = itemData;
|
||||||
const { name, desc, url } = form;
|
const { name, desc, url } = form;
|
||||||
await patchProfile(uid, { uid, name, desc, url });
|
const option_ = showOpt ? option : undefined;
|
||||||
|
|
||||||
|
if (itemData.type === "remote" && !url) {
|
||||||
|
throw new Error("Remote URL should not be null");
|
||||||
|
}
|
||||||
|
|
||||||
|
await patchProfile(uid, { uid, name, desc, url, option: option_ });
|
||||||
|
setShowOpt(false);
|
||||||
mutate("getProfiles");
|
mutate("getProfiles");
|
||||||
onClose();
|
onClose();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
@@ -89,9 +103,28 @@ const ProfileEdit = (props: Props) => {
|
|||||||
onChange={(e) => setForm({ url: e.target.value })}
|
onChange={(e) => setForm({ url: e.target.value })}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{showOpt && (
|
||||||
|
<TextField
|
||||||
|
{...textFieldProps}
|
||||||
|
label="User Agent"
|
||||||
|
value={option.user_agent}
|
||||||
|
onChange={(e) => setOption({ user_agent: e.target.value })}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
||||||
<DialogActions sx={{ px: 2, pb: 2 }}>
|
<DialogActions sx={{ px: 2, pb: 2, position: "relative" }}>
|
||||||
|
{form.type === "remote" && (
|
||||||
|
<IconButton
|
||||||
|
size="small"
|
||||||
|
sx={{ position: "absolute", left: 18 }}
|
||||||
|
onClick={() => setShowOpt((o) => !o)}
|
||||||
|
>
|
||||||
|
<Settings />
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
|
|
||||||
<Button onClick={onClose}>Cancel</Button>
|
<Button onClick={onClose}>Cancel</Button>
|
||||||
<Button onClick={onUpdate} variant="contained">
|
<Button onClick={onUpdate} variant="contained">
|
||||||
Update
|
Update
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ const ProfileItem = (props: Props) => {
|
|||||||
if (loading) return;
|
if (loading) return;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
await updateProfile(itemData.uid, withProxy);
|
await updateProfile(itemData.uid, { with_proxy: withProxy });
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
mutate("getProfiles");
|
mutate("getProfiles");
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { useState } from "react";
|
||||||
import { useSWRConfig } from "swr";
|
import { useSWRConfig } from "swr";
|
||||||
import { useLockFn, useSetState } from "ahooks";
|
import { useLockFn, useSetState } from "ahooks";
|
||||||
import {
|
import {
|
||||||
@@ -7,11 +8,13 @@ import {
|
|||||||
DialogContent,
|
DialogContent,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
FormControl,
|
FormControl,
|
||||||
|
IconButton,
|
||||||
InputLabel,
|
InputLabel,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
Select,
|
Select,
|
||||||
TextField,
|
TextField,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
|
import { Settings } from "@mui/icons-material";
|
||||||
import { createProfile } from "../../services/cmds";
|
import { createProfile } from "../../services/cmds";
|
||||||
import Notice from "../base/base-notice";
|
import Notice from "../base/base-notice";
|
||||||
|
|
||||||
@@ -27,12 +30,17 @@ const ProfileNew = (props: Props) => {
|
|||||||
|
|
||||||
const { mutate } = useSWRConfig();
|
const { mutate } = useSWRConfig();
|
||||||
const [form, setForm] = useSetState({
|
const [form, setForm] = useSetState({
|
||||||
|
type: "remote",
|
||||||
name: "",
|
name: "",
|
||||||
desc: "",
|
desc: "",
|
||||||
type: "remote",
|
|
||||||
url: "",
|
url: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [showOpt, setShowOpt] = useState(false);
|
||||||
|
const [option, setOption] = useSetState({
|
||||||
|
user_agent: "",
|
||||||
|
}); // able to add more option
|
||||||
|
|
||||||
const onCreate = useLockFn(async () => {
|
const onCreate = useLockFn(async () => {
|
||||||
if (!form.type) {
|
if (!form.type) {
|
||||||
Notice.error("`Type` should not be null");
|
Notice.error("`Type` should not be null");
|
||||||
@@ -40,8 +48,18 @@ const ProfileNew = (props: Props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await createProfile({ ...form });
|
const name = form.name || `${form.type} file`;
|
||||||
setForm({ name: "", desc: "", type: "remote", url: "" });
|
|
||||||
|
if (form.type === "remote" && !form.url) {
|
||||||
|
throw new Error("The URL should not be null");
|
||||||
|
}
|
||||||
|
|
||||||
|
const option_ = showOpt ? option : undefined;
|
||||||
|
await createProfile({ ...form, name, option: option_ });
|
||||||
|
setForm({ type: "remote", name: "", desc: "", url: "" });
|
||||||
|
setOption({ user_agent: "" });
|
||||||
|
setShowOpt(false);
|
||||||
|
|
||||||
mutate("getProfiles");
|
mutate("getProfiles");
|
||||||
onClose();
|
onClose();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
@@ -61,17 +79,10 @@ const ProfileNew = (props: Props) => {
|
|||||||
<DialogTitle sx={{ pb: 0.5 }}>Create Profile</DialogTitle>
|
<DialogTitle sx={{ pb: 0.5 }}>Create Profile</DialogTitle>
|
||||||
|
|
||||||
<DialogContent sx={{ width: 336, pb: 1 }}>
|
<DialogContent sx={{ width: 336, pb: 1 }}>
|
||||||
<TextField
|
|
||||||
{...textFieldProps}
|
|
||||||
autoFocus
|
|
||||||
label="Name"
|
|
||||||
value={form.name}
|
|
||||||
onChange={(e) => setForm({ name: e.target.value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<FormControl size="small" fullWidth sx={{ mt: 2, mb: 1 }}>
|
<FormControl size="small" fullWidth sx={{ mt: 2, mb: 1 }}>
|
||||||
<InputLabel>Type</InputLabel>
|
<InputLabel>Type</InputLabel>
|
||||||
<Select
|
<Select
|
||||||
|
autoFocus
|
||||||
label="Type"
|
label="Type"
|
||||||
value={form.type}
|
value={form.type}
|
||||||
onChange={(e) => setForm({ type: e.target.value })}
|
onChange={(e) => setForm({ type: e.target.value })}
|
||||||
@@ -83,6 +94,13 @@ const ProfileNew = (props: Props) => {
|
|||||||
</Select>
|
</Select>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
|
<TextField
|
||||||
|
{...textFieldProps}
|
||||||
|
label="Name"
|
||||||
|
value={form.name}
|
||||||
|
onChange={(e) => setForm({ name: e.target.value })}
|
||||||
|
/>
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
{...textFieldProps}
|
{...textFieldProps}
|
||||||
label="Descriptions"
|
label="Descriptions"
|
||||||
@@ -98,9 +116,28 @@ const ProfileNew = (props: Props) => {
|
|||||||
onChange={(e) => setForm({ url: e.target.value })}
|
onChange={(e) => setForm({ url: e.target.value })}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{showOpt && (
|
||||||
|
<TextField
|
||||||
|
{...textFieldProps}
|
||||||
|
label="User Agent"
|
||||||
|
value={option.user_agent}
|
||||||
|
onChange={(e) => setOption({ user_agent: e.target.value })}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
||||||
<DialogActions sx={{ px: 2, pb: 2 }}>
|
<DialogActions sx={{ px: 2, pb: 2, position: "relative" }}>
|
||||||
|
{form.type === "remote" && (
|
||||||
|
<IconButton
|
||||||
|
size="small"
|
||||||
|
sx={{ position: "absolute", left: 18 }}
|
||||||
|
onClick={() => setShowOpt((o) => !o)}
|
||||||
|
>
|
||||||
|
<Settings />
|
||||||
|
</IconButton>
|
||||||
|
)}
|
||||||
|
|
||||||
<Button onClick={onClose}>Cancel</Button>
|
<Button onClick={onClose}>Cancel</Button>
|
||||||
<Button onClick={onCreate} variant="contained">
|
<Button onClick={onCreate} variant="contained">
|
||||||
Create
|
Create
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ const ProxyGroup = ({ group }: Props) => {
|
|||||||
} else {
|
} else {
|
||||||
profile.selected[index] = { name: group.name, now: name };
|
profile.selected[index] = { name: group.name, now: name };
|
||||||
}
|
}
|
||||||
await patchProfile(profiles!.current!, profile);
|
await patchProfile(profiles!.current!, { selected: profile.selected });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,10 @@ const ProfilePage = () => {
|
|||||||
name,
|
name,
|
||||||
now,
|
now,
|
||||||
}));
|
}));
|
||||||
patchProfile(current!, profile).catch(console.error);
|
|
||||||
|
patchProfile(current!, { selected: profile.selected }).catch(
|
||||||
|
console.error
|
||||||
|
);
|
||||||
// update proxies cache
|
// update proxies cache
|
||||||
if (hasChange) mutate("getProxies", getProxies());
|
if (hasChange) mutate("getProxies", getProxies());
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|||||||
@@ -14,7 +14,13 @@ export async function getAxios(force: boolean = false) {
|
|||||||
try {
|
try {
|
||||||
const info = await getClashInfo();
|
const info = await getClashInfo();
|
||||||
|
|
||||||
if (info?.server) server = info?.server;
|
if (info?.server) {
|
||||||
|
server = info.server;
|
||||||
|
|
||||||
|
// compatible width `external-controller`
|
||||||
|
if (server.startsWith(":")) server = `127.0.0.1${server}`;
|
||||||
|
else if (/^\d+$/.test(server)) server = `127.0.0.1:${server}`;
|
||||||
|
}
|
||||||
if (info?.secret) secret = info?.secret;
|
if (info?.secret) secret = info?.secret;
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,17 @@ export async function viewProfile(index: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function importProfile(url: string) {
|
export async function importProfile(url: string) {
|
||||||
return invoke<void>("import_profile", { url, withProxy: true });
|
return invoke<void>("import_profile", {
|
||||||
|
url,
|
||||||
|
option: { with_proxy: true },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateProfile(index: string, withProxy: boolean) {
|
export async function updateProfile(
|
||||||
return invoke<void>("update_profile", { index, withProxy });
|
index: string,
|
||||||
|
option?: CmdType.ProfileOption
|
||||||
|
) {
|
||||||
|
return invoke<void>("update_profile", { index, option });
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteProfile(index: string) {
|
export async function deleteProfile(index: string) {
|
||||||
@@ -35,7 +41,7 @@ export async function deleteProfile(index: string) {
|
|||||||
|
|
||||||
export async function patchProfile(
|
export async function patchProfile(
|
||||||
index: string,
|
index: string,
|
||||||
profile: CmdType.ProfileItem
|
profile: Partial<CmdType.ProfileItem>
|
||||||
) {
|
) {
|
||||||
return invoke<void>("patch_profile", { index, profile });
|
return invoke<void>("patch_profile", { index, profile });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,12 @@ export namespace CmdType {
|
|||||||
total: number;
|
total: number;
|
||||||
expire: number;
|
expire: number;
|
||||||
};
|
};
|
||||||
|
option?: ProfileOption;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProfileOption {
|
||||||
|
user_agent?: string;
|
||||||
|
with_proxy?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProfilesConfig {
|
export interface ProfilesConfig {
|
||||||
|
|||||||
112
yarn.lock
112
yarn.lock
@@ -572,66 +572,72 @@
|
|||||||
estree-walker "^2.0.1"
|
estree-walker "^2.0.1"
|
||||||
picomatch "^2.2.2"
|
picomatch "^2.2.2"
|
||||||
|
|
||||||
"@tauri-apps/api@^1.0.0-rc.1":
|
"@tauri-apps/api@^1.0.0-rc.2":
|
||||||
version "1.0.0-rc.1"
|
version "1.0.0-rc.2"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/api/-/api-1.0.0-rc.1.tgz#ce26a0fe30d8980a4682d50015eec28ed4a23c1e"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/api/-/api-1.0.0-rc.2.tgz#bac494a6b8868e05f86184d2ee1ccc8477470363"
|
||||||
integrity sha512-VBUOmfT8ea02JB/Qr+FHeaLnug5BRA7ro2pX47q0GZCbZsU9b+iPnOXl0ShJwT0melR7B6iamyhDwkHStMVfQA==
|
integrity sha512-JhUDCJpfxmf/S1R+yHmJGsher4CGi07Qv4fYeucB7naeFZ7yTQe7S1CHKUZaRYpurGSdwOF3my9k0LyGmpAGYw==
|
||||||
dependencies:
|
dependencies:
|
||||||
type-fest "2.11.2"
|
type-fest "2.12.0"
|
||||||
|
|
||||||
"@tauri-apps/cli-darwin-arm64@1.0.0-rc.5":
|
"@tauri-apps/cli-darwin-arm64@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.0.0-rc.5.tgz#9374be8c96afa1cf77b5647bc81fe1a05006757d"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-arm64/-/cli-darwin-arm64-1.0.0-rc.7.tgz#c7d190ea7496381bf456494e93dd8b35005a0e78"
|
||||||
integrity sha512-X+3EIAUGfoL8uE6PBADZC8FcUISe4JPQCxXgaVv6ehoZGoCh/pFJF7AvBGTQxbnvngqM7Xce4Lmh63Io2/5ggw==
|
integrity sha512-fb1plxZZHDG0KwZOoAl6tuisFU+oZFtNtqK3V2KL+4hz75DyH6BfsrgjyYSecJrtQejL2cHi8q7vUsU+EeLopw==
|
||||||
|
|
||||||
"@tauri-apps/cli-darwin-x64@1.0.0-rc.5":
|
"@tauri-apps/cli-darwin-x64@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.0.0-rc.5.tgz#4db1dd56a228bfafe5b3f64c7661abbe5606e804"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-darwin-x64/-/cli-darwin-x64-1.0.0-rc.7.tgz#b152f333ea081674e8e6c45d1c3ff1850bff854c"
|
||||||
integrity sha512-fEpgOdAvKdq9C5/yip8RnwP1VS+nRrtKdzzplu4jY6njDVH/Vom8mg+EfXkCY5RveCaoskJMFgUvt10IGeZHBA==
|
integrity sha512-FOFPNsYUgCDaxEK+9oQ3vv9bMD3XVcOKdh1vo/DImzZNO6fQkcsDC8zlmA+Q4axd+X8kvu0iti1fK8Vl7HIUEA==
|
||||||
|
|
||||||
"@tauri-apps/cli-linux-arm-gnueabihf@1.0.0-rc.5":
|
"@tauri-apps/cli-linux-arm-gnueabihf@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.0.0-rc.5.tgz#0f1ff84c534908a54fbe63b45004abc6d4f03f4d"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm-gnueabihf/-/cli-linux-arm-gnueabihf-1.0.0-rc.7.tgz#14fb37a337526200dbbe9b49dabd221b81682b02"
|
||||||
integrity sha512-V7sWSBrpLyvkQxpkHIM8JltYqQhiTpThySDjO8POtrTqkRwM5BXORcCYhxTAKCedecfYK/RNUJ6Q0t7+3jS6DQ==
|
integrity sha512-tFzcJtNHy5AInU3E7kKDyhg4Qb7csu3uZ3FhGfORmGvQAiNQFpGV3ypC230RQYa3sxxRMbn8vjUAZMlU6JArbA==
|
||||||
|
|
||||||
"@tauri-apps/cli-linux-arm64-gnu@1.0.0-rc.5":
|
"@tauri-apps/cli-linux-arm64-gnu@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.0.0-rc.5.tgz#c5d2f1dd962d80a1958261229778b410b86254d4"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-1.0.0-rc.7.tgz#43e7a38018258ad2bf665bb61e0328688b345355"
|
||||||
integrity sha512-HhM+2FInxtUAI/41LF4fDEzmhLQUq6DOoo7fLN94vgWlhsPyWZoDGP9pA043XbO86+4OX5JZUW1SnTVXMwEaMA==
|
integrity sha512-QAoNUJMmoCv/mDZsfEZOOTeEPYuxtMgCgqTDqMd0H8S0Y3Cu2D/Q2fwVl0s9pMb6wLD2GJ2FEneySEMhMxt7Pg==
|
||||||
|
|
||||||
"@tauri-apps/cli-linux-arm64-musl@1.0.0-rc.5":
|
"@tauri-apps/cli-linux-arm64-musl@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.0.0-rc.5.tgz#f485db9ca5402f5d2c4585801a3aaa4519bd67e8"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.0.0-rc.7.tgz#37ebcfc7d1431dd698f529fa57248adadd94b3b4"
|
||||||
integrity sha512-DhHdKOhf3+peA/sM0c9CpxK89cp8GVwOB5osFW55fxBZbD0mJFeL2SzjkgfGFqFu6Ci/ZiibQGfEp8XTC8OsYA==
|
integrity sha512-ieLyACtbY7ezReTnjWLw/kKDXRCbnbrUjQ+hltSmHaRuV51nX+I2rmFO5e7VPdj406jvyKwfSPuBC34bHxt3Og==
|
||||||
|
|
||||||
"@tauri-apps/cli-linux-x64-gnu@1.0.0-rc.5":
|
"@tauri-apps/cli-linux-x64-gnu@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.0.0-rc.5.tgz#e468939585bc98e80ec827d0a3d8ba06a7cc38e8"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-gnu/-/cli-linux-x64-gnu-1.0.0-rc.7.tgz#b47239c4f10b3fe8e1e2f031f639125ededc6d79"
|
||||||
integrity sha512-pZzsOHRGG/mdcn7fF/yOIOdeVzGxZUtZqvlGSd90ZM9Ps3//uYGCBHoNTbeSwp/V6+D0KVDaSCbm9lYlHoXcdA==
|
integrity sha512-wPAZctuFpurACxdCrjw+aaSuFReuIvv1nalVezfqA78AlsCk785yF2YVjoZr5bT8a9+6F+t8uNi3l6Vp5oNqwQ==
|
||||||
|
|
||||||
"@tauri-apps/cli-linux-x64-musl@1.0.0-rc.5":
|
"@tauri-apps/cli-linux-x64-musl@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.0.0-rc.5.tgz#a1308e93850555f2b6c97b5d7cdbbb9afaa803e2"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-linux-x64-musl/-/cli-linux-x64-musl-1.0.0-rc.7.tgz#9e62494cf80aed170f389d84b2b23f354e8ce748"
|
||||||
integrity sha512-COwWCbOhEjBlzGRGTa0ESO4/AiC0cBZ2UEPExRn++S+kWSPJ2vsyMdCLu3hiMy1ABSIRcQ4Vc68M1iVkLhOHHw==
|
integrity sha512-/AxuXFC2d1V8KpZJ6cFDcD5QqPFIZFXC/tAJlnTW75VnHgjat9TYP3BdSOuEA81ZLs9tV4PQF40tNnUSzfRYMg==
|
||||||
|
|
||||||
"@tauri-apps/cli-win32-x64-msvc@1.0.0-rc.5":
|
"@tauri-apps/cli-win32-ia32-msvc@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.0.0-rc.5.tgz#d15c95143d9123d10c510e28ba90df5349b68ecd"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-ia32-msvc/-/cli-win32-ia32-msvc-1.0.0-rc.7.tgz#71c2f9498f4d03fd2c0ca6137a2be7db95a006f3"
|
||||||
integrity sha512-zzizUmPWvnWjj+IUCk36kVjS9j1Bg5JmnwOW5QdX26+a64q5vocmVimCgrfZ5STw3sDFXE++S55ghpzhhH5o+g==
|
integrity sha512-C4M2rHXlYVPSHGl2Iax1rfiNM5GPSRP1JHxW7/4jH9FfW6mVFcjULZAyVMRfOMQEQ9bYXbVnSTPbhG2Fm0jPxQ==
|
||||||
|
|
||||||
"@tauri-apps/cli@^1.0.0-rc.5":
|
"@tauri-apps/cli-win32-x64-msvc@1.0.0-rc.7":
|
||||||
version "1.0.0-rc.5"
|
version "1.0.0-rc.7"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-1.0.0-rc.5.tgz#db8ca22c9f55f5400d1c6addd78ee1df5dc15a29"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli-win32-x64-msvc/-/cli-win32-x64-msvc-1.0.0-rc.7.tgz#6d719f70a0789f2a179d160c302996ce81194099"
|
||||||
integrity sha512-Q3D0R5YdZRA5EcL206hwwKCyXpet2mRDcfaRTU/IXwF73bS4AMja+JdAGfO2cyHuSvXd+b//Cgbei2zCG8M6hw==
|
integrity sha512-lpstJKOtP+ahhjbutapA02TpvfNTZqXwhmA1fvqxDu6BYVezFn7ZiGG5HwdXlkiRDfbwZwBd1evdkV3MxwY1NQ==
|
||||||
|
|
||||||
|
"@tauri-apps/cli@^1.0.0-rc.7":
|
||||||
|
version "1.0.0-rc.7"
|
||||||
|
resolved "https://registry.yarnpkg.com/@tauri-apps/cli/-/cli-1.0.0-rc.7.tgz#0eb73718f6ebddc159b0b54f6fd6dfc26d110b36"
|
||||||
|
integrity sha512-g7lUsI2iFiB2JuPFr209vWNqOnxCOGXN6yBttMRY+94UUXZOeWlKxYYpSabyjSr7EbfAUNzjITYmE4urdtmB+A==
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
"@tauri-apps/cli-darwin-arm64" "1.0.0-rc.5"
|
"@tauri-apps/cli-darwin-arm64" "1.0.0-rc.7"
|
||||||
"@tauri-apps/cli-darwin-x64" "1.0.0-rc.5"
|
"@tauri-apps/cli-darwin-x64" "1.0.0-rc.7"
|
||||||
"@tauri-apps/cli-linux-arm-gnueabihf" "1.0.0-rc.5"
|
"@tauri-apps/cli-linux-arm-gnueabihf" "1.0.0-rc.7"
|
||||||
"@tauri-apps/cli-linux-arm64-gnu" "1.0.0-rc.5"
|
"@tauri-apps/cli-linux-arm64-gnu" "1.0.0-rc.7"
|
||||||
"@tauri-apps/cli-linux-arm64-musl" "1.0.0-rc.5"
|
"@tauri-apps/cli-linux-arm64-musl" "1.0.0-rc.7"
|
||||||
"@tauri-apps/cli-linux-x64-gnu" "1.0.0-rc.5"
|
"@tauri-apps/cli-linux-x64-gnu" "1.0.0-rc.7"
|
||||||
"@tauri-apps/cli-linux-x64-musl" "1.0.0-rc.5"
|
"@tauri-apps/cli-linux-x64-musl" "1.0.0-rc.7"
|
||||||
"@tauri-apps/cli-win32-x64-msvc" "1.0.0-rc.5"
|
"@tauri-apps/cli-win32-ia32-msvc" "1.0.0-rc.7"
|
||||||
|
"@tauri-apps/cli-win32-x64-msvc" "1.0.0-rc.7"
|
||||||
|
|
||||||
"@types/fs-extra@^9.0.13":
|
"@types/fs-extra@^9.0.13":
|
||||||
version "9.0.13"
|
version "9.0.13"
|
||||||
@@ -1863,10 +1869,10 @@ tunnel@0.0.6:
|
|||||||
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
|
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
|
||||||
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==
|
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==
|
||||||
|
|
||||||
type-fest@2.11.2:
|
type-fest@2.12.0:
|
||||||
version "2.11.2"
|
version "2.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.11.2.tgz#5534a919858bc517492cd3a53a673835a76d2e71"
|
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.12.0.tgz#ce342f58cab9114912f54b493d60ab39c3fc82b6"
|
||||||
integrity sha512-reW2Y2Mpn0QNA/5fvtm5doROLwDPu2zOm5RtY7xQQS05Q7xgC8MOZ3yPNaP9m/s/sNjjFQtHo7VCNqYW2iI+Ig==
|
integrity sha512-Qe5GRT+n/4GoqCNGGVp5Snapg1Omq3V7irBJB3EaKsp7HWDo5Gv2d/67gfNyV+d5EXD+x/RF5l1h4yJ7qNkcGA==
|
||||||
|
|
||||||
typescript@^4.5.5:
|
typescript@^4.5.5:
|
||||||
version "4.6.2"
|
version "4.6.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user