Compare commits

..
5 changed files with 115 additions and 91 deletions
+2 -2
View File
@@ -79,7 +79,7 @@
"rehype-sanitize": "^6.0.0",
"swr": "^2.5.1",
"tauri-plugin-mihomo-api": "github:clash-verge-rev/tauri-plugin-mihomo#main",
"tldts": "7.6.0",
"tldts": "7.5.5",
"types-pac": "^1.0.3",
"validator": "^13.15.35"
},
@@ -91,7 +91,7 @@
"@tauri-apps/cli": "2.12.6",
"@types/lodash-es": "^4.17.12",
"@types/node": "^26.0.0",
"@types/react": "19.3.3",
"@types/react": "19.3.0",
"@types/react-dom": "19.3.0",
"@types/validator": "^13.15.10",
"@vitejs/plugin-legacy": "^8.2.3",
+67 -67
View File
@@ -199,10 +199,10 @@ importers:
version: 0.5.0(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@emotion/react':
specifier: ^11.14.0
version: 11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
version: 11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@emotion/styled':
specifier: ^11.14.1
version: 11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
version: 11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@juggle/resize-observer':
specifier: ^3.4.0
version: 3.4.0
@@ -211,10 +211,10 @@ importers:
version: 4.7.0(monaco-editor@0.58.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@mui/icons-material':
specifier: ^9.4.0
version: 9.4.0(@mui/material@9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(@types/react@19.3.3)(react@19.3.1)
version: 9.4.0(@mui/material@9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(@types/react@19.3.0)(react@19.3.1)
'@mui/material':
specifier: ^9.4.0
version: 9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
version: 9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@tanstack/react-virtual':
specifier: ^3.14.13
version: 3.14.13(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
@@ -289,16 +289,16 @@ importers:
version: 19.3.1(react@19.3.1)
react-error-boundary:
specifier: 6.1.6
version: 6.1.6(@types/react@19.3.3)(react@19.3.1)
version: 6.1.6(@types/react@19.3.0)(react@19.3.1)
react-hook-form:
specifier: ^7.88.0
version: 7.88.0(react@19.3.1)
react-i18next:
specifier: 18.0.3
version: 18.0.3(@types/react@19.3.3)(i18next@27.0.1(typescript@6.0.3))(react@19.3.1)(typescript@6.0.3)
version: 18.0.3(@types/react@19.3.0)(i18next@27.0.1(typescript@6.0.3))(react@19.3.1)(typescript@6.0.3)
react-markdown:
specifier: 10.1.0
version: 10.1.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
version: 10.1.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
react-router:
specifier: ^8.4.0
version: 8.4.0(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
@@ -315,8 +315,8 @@ importers:
specifier: github:clash-verge-rev/tauri-plugin-mihomo#main
version: https://codeload.github.com/clash-verge-rev/tauri-plugin-mihomo/tar.gz/7e4fa8642cf6c394ed88b5a969420d8eab60087f
tldts:
specifier: 7.6.0
version: 7.6.0
specifier: 7.5.5
version: 7.5.5
types-pac:
specifier: ^1.0.3
version: 1.0.3
@@ -346,11 +346,11 @@ importers:
specifier: ^26.0.0
version: 26.6.5
'@types/react':
specifier: 19.3.3
version: 19.3.3
specifier: 19.3.0
version: 19.3.0
'@types/react-dom':
specifier: 19.3.0
version: 19.3.0(@types/react@19.3.3)
version: 19.3.0(@types/react@19.3.0)
'@types/validator':
specifier: ^13.15.10
version: 13.15.10
@@ -2286,8 +2286,8 @@ packages:
peerDependencies:
'@types/react': '*'
'@types/react@19.3.3':
resolution: {integrity: sha512-K8uWpJc4teiuOPdiP1umjeA9rGMgVPiXuoL66fcS1QlwBT1WMqY8PORmub9FadopIs+RCW6siYEs7Lpq+vDlog==}
'@types/react@19.3.0':
resolution: {integrity: sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==}
'@types/trusted-types@2.0.7':
resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==}
@@ -4060,11 +4060,11 @@ packages:
resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
engines: {node: '>=12.0.0'}
tldts-core@7.6.0:
resolution: {integrity: sha512-0By9U6fw2hNzfJAbBMuo1bsX/OyVlsj0wjGyMPV50RZKoLCRwXBOX0FQqgZDaMo2WjjaEW/ZGyVXicLUFTmXqQ==}
tldts-core@7.5.5:
resolution: {integrity: sha512-rEJz/8cJFY/bdF354gl14yxavbrIbvM+FcbkYVQ6CSCMQTJdUFUIm39TTWSiGPvcpQh7/F6qHrD3SkwwdgtDCw==}
tldts@7.6.0:
resolution: {integrity: sha512-IFk9SJW/EhTZMpJA1zRdP+69JK4NmJbMx1aRdJvLBR9em1k62eWiwolSWlDRpRdkaAnZ1dDCwFPmRPBNuLGGHA==}
tldts@7.5.5:
resolution: {integrity: sha512-Hy6IImaWALzJOgCIss4gIFi4G0M9lqk95pFKCUVxQPZw+biZ1Pv6f28JpYgahpJB+BufA0HYsIU/aP/WIx3KRg==}
hasBin: true
trim-lines@3.0.1:
@@ -5204,7 +5204,7 @@ snapshots:
'@emotion/memoize@0.9.0': {}
'@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)':
'@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)':
dependencies:
'@babel/runtime': 7.29.7
'@emotion/babel-plugin': 11.13.5(supports-color@7.2.0)
@@ -5216,7 +5216,7 @@ snapshots:
hoist-non-react-statics: 3.3.2
react: 19.3.1
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
transitivePeerDependencies:
- supports-color
@@ -5230,18 +5230,18 @@ snapshots:
'@emotion/sheet@1.4.0': {}
'@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)':
'@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)':
dependencies:
'@babel/runtime': 7.29.7
'@emotion/babel-plugin': 11.13.5(supports-color@7.2.0)
'@emotion/is-prop-valid': 1.4.0
'@emotion/react': 11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
'@emotion/react': 11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@emotion/serialize': 1.3.3
'@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@19.3.1)
'@emotion/utils': 1.4.2
react: 19.3.1
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
transitivePeerDependencies:
- supports-color
@@ -5522,23 +5522,23 @@ snapshots:
'@mui/core-downloads-tracker@9.4.0': {}
'@mui/icons-material@9.4.0(@mui/material@9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(@types/react@19.3.3)(react@19.3.1)':
'@mui/icons-material@9.4.0(@mui/material@9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(@types/react@19.3.0)(react@19.3.1)':
dependencies:
'@babel/runtime': 7.29.7
'@mui/material': 9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@mui/material': 9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
react: 19.3.1
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
'@mui/material@9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)':
'@mui/material@9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)':
dependencies:
'@babel/runtime': 7.29.7
'@mui/core-downloads-tracker': 9.4.0
'@mui/system': 9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)
'@mui/types': 9.4.0(@types/react@19.3.3)
'@mui/utils': 9.4.0(@types/react@19.3.3)(react@19.3.1)
'@mui/system': 9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)
'@mui/types': 9.4.0(@types/react@19.3.0)
'@mui/utils': 9.4.0(@types/react@19.3.0)(react@19.3.1)
'@popperjs/core': 2.11.8
'@types/react-transition-group': 4.4.12(@types/react@19.3.3)
'@types/react-transition-group': 4.4.12(@types/react@19.3.0)
clsx: 2.1.1
csstype: 3.2.3
prop-types: 15.8.1
@@ -5547,20 +5547,20 @@ snapshots:
react-is: 19.3.0
react-transition-group: 4.4.5(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
optionalDependencies:
'@emotion/react': 11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
'@types/react': 19.3.3
'@emotion/react': 11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@types/react': 19.3.0
'@mui/private-theming@9.4.0(@types/react@19.3.3)(react@19.3.1)':
'@mui/private-theming@9.4.0(@types/react@19.3.0)(react@19.3.1)':
dependencies:
'@babel/runtime': 7.29.7
'@mui/utils': 9.4.0(@types/react@19.3.3)(react@19.3.1)
'@mui/utils': 9.4.0(@types/react@19.3.0)(react@19.3.1)
prop-types: 15.8.1
react: 19.3.1
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
'@mui/styled-engine@9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(react@19.3.1)':
'@mui/styled-engine@9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(react@19.3.1)':
dependencies:
'@babel/runtime': 7.29.7
'@emotion/cache': 11.14.0
@@ -5570,42 +5570,42 @@ snapshots:
prop-types: 15.8.1
react: 19.3.1
optionalDependencies:
'@emotion/react': 11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
'@emotion/react': 11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@mui/system@9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)':
'@mui/system@9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)':
dependencies:
'@babel/runtime': 7.29.7
'@mui/private-theming': 9.4.0(@types/react@19.3.3)(react@19.3.1)
'@mui/styled-engine': 9.4.0(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(react@19.3.1)
'@mui/types': 9.4.0(@types/react@19.3.3)
'@mui/utils': 9.4.0(@types/react@19.3.3)(react@19.3.1)
'@mui/private-theming': 9.4.0(@types/react@19.3.0)(react@19.3.1)
'@mui/styled-engine': 9.4.0(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@emotion/styled@11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(react@19.3.1)
'@mui/types': 9.4.0(@types/react@19.3.0)
'@mui/utils': 9.4.0(@types/react@19.3.0)(react@19.3.1)
clsx: 2.1.1
csstype: 3.2.3
prop-types: 15.8.1
react: 19.3.1
optionalDependencies:
'@emotion/react': 11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0)
'@types/react': 19.3.3
'@emotion/react': 11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@emotion/styled': 11.14.1(@emotion/react@11.14.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0))(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
'@types/react': 19.3.0
'@mui/types@9.4.0(@types/react@19.3.3)':
'@mui/types@9.4.0(@types/react@19.3.0)':
dependencies:
'@babel/runtime': 7.29.7
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
'@mui/utils@9.4.0(@types/react@19.3.3)(react@19.3.1)':
'@mui/utils@9.4.0(@types/react@19.3.0)(react@19.3.1)':
dependencies:
'@babel/runtime': 7.29.7
'@mui/types': 9.4.0(@types/react@19.3.3)
'@mui/types': 9.4.0(@types/react@19.3.0)
'@types/prop-types': 15.7.15
clsx: 2.1.1
prop-types: 15.8.1
react: 19.3.1
react-is: 19.3.0
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
'@napi-rs/wasm-runtime@1.2.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)':
dependencies:
@@ -6137,15 +6137,15 @@ snapshots:
'@types/prop-types@15.7.15': {}
'@types/react-dom@19.3.0(@types/react@19.3.3)':
'@types/react-dom@19.3.0(@types/react@19.3.0)':
dependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
'@types/react-transition-group@4.4.12(@types/react@19.3.3)':
'@types/react-transition-group@4.4.12(@types/react@19.3.0)':
dependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
'@types/react@19.3.3':
'@types/react@19.3.0':
dependencies:
csstype: 3.2.3
@@ -7897,11 +7897,11 @@ snapshots:
react: 19.3.1
scheduler: 0.28.0
react-error-boundary@6.1.6(@types/react@19.3.3)(react@19.3.1):
react-error-boundary@6.1.6(@types/react@19.3.0)(react@19.3.1):
dependencies:
react: 19.3.1
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
react-fast-compare@3.2.2: {}
@@ -7909,24 +7909,24 @@ snapshots:
dependencies:
react: 19.3.1
react-i18next@18.0.3(@types/react@19.3.3)(i18next@27.0.1(typescript@6.0.3))(react@19.3.1)(typescript@6.0.3):
react-i18next@18.0.3(@types/react@19.3.0)(i18next@27.0.1(typescript@6.0.3))(react@19.3.1)(typescript@6.0.3):
dependencies:
html-parse-stringify: 4.0.1
i18next: 27.0.1(typescript@6.0.3)
react: 19.3.1
optionalDependencies:
'@types/react': 19.3.3
'@types/react': 19.3.0
typescript: 6.0.3
react-is@16.13.1: {}
react-is@19.3.0: {}
react-markdown@10.1.0(@types/react@19.3.3)(react@19.3.1)(supports-color@7.2.0):
react-markdown@10.1.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0):
dependencies:
'@types/hast': 3.0.5
'@types/mdast': 4.0.4
'@types/react': 19.3.3
'@types/react': 19.3.0
devlop: 1.1.0
hast-util-to-jsx-runtime: 2.3.6(supports-color@7.2.0)
html-url-attributes: 3.0.1
@@ -8173,11 +8173,11 @@ snapshots:
fdir: 6.5.0(picomatch@4.0.7)
picomatch: 4.0.7
tldts-core@7.6.0: {}
tldts-core@7.5.5: {}
tldts@7.6.0:
tldts@7.5.5:
dependencies:
tldts-core: 7.6.0
tldts-core: 7.5.5
trim-lines@3.0.1: {}
+24 -18
View File
@@ -181,7 +181,8 @@ fn nsis_language_id(app_language: &str) -> &'static str {
}
}
/// Same wire shape as the updater plugin's JS `DownloadEvent`.
/// Same wire shape as the updater plugin's JS `DownloadEvent`, plus `Installing` when the
/// install starts.
#[derive(Clone, Serialize, specta::Type)]
#[serde(tag = "event", content = "data")]
pub enum DownloadEvent {
@@ -194,12 +195,17 @@ pub enum DownloadEvent {
chunk_length: usize,
},
Finished,
Installing,
}
const MIRRORS: [&str; 2] = ["https://update.hwdns.net/", "https://gh-proxy.org/"];
/// A source delivering less than this per window is dropped for the next one.
const MIN_PROGRESS: u64 = 1024 * 1024;
const PROGRESS_WINDOW: Duration = Duration::from_secs(30);
#[cfg(target_os = "windows")]
const INSTALL_TIMEOUT: Duration = Duration::from_secs(30);
#[cfg(not(target_os = "windows"))]
const INSTALL_TIMEOUT: Duration = Duration::from_secs(120);
/// The manifest's URL, then the other mirror, then GitHub itself.
fn download_sources(url: &tauri::Url) -> Vec<tauri::Url> {
@@ -292,8 +298,18 @@ impl SilentUpdater {
Ok(updater_builder.build()?.check().await?)
}
/// Installs verified bytes, dropping the cache first so a failure leaves nothing to
/// re-trigger. A timeout abandons the await, not the detached install task; a successful
/// Windows install exits the process inside the plugin (#2558).
async fn install(update: Update, bytes: Vec<u8>) -> Result<()> {
Ok(tokio::task::spawn_blocking(move || update.install(&bytes)).await??)
Self::delete_cache();
let install = tokio::task::spawn_blocking(move || update.install(&bytes));
match tokio::time::timeout(INSTALL_TIMEOUT, install).await {
Ok(result) => Ok(result??),
Err(_) => Err(anyhow::anyhow!(
"install timed out after {INSTALL_TIMEOUT:?}; it may still finish in the background"
)),
}
}
/// Installs a newer cached update before normal startup, if the user confirms.
@@ -368,23 +384,13 @@ impl SilentUpdater {
Self::show_update_splash(app_handle, &version);
// `install()` may hang (#2558); on Windows NSIS can take over without returning.
let install = tokio::time::timeout(std::time::Duration::from_secs(30), Self::install(update, bytes));
match install
.await
.unwrap_or_else(|_| Err(anyhow::anyhow!("install timed out (30s)")))
{
match Self::install(update, bytes).await {
Ok(()) => {
logging!(info, Type::System, "Update v{version} install triggered at startup");
Self::delete_cache();
logging!(info, Type::System, "Update v{version} installed at startup");
true
}
Err(e) => {
logging!(
warn,
Type::System,
"Startup install failed: {e:#}, will retry next launch"
);
logging!(warn, Type::System, "Startup install failed: {e:#}");
Self::close_update_splash(app_handle);
false
}
@@ -402,7 +408,7 @@ impl SilentUpdater {
let cancel = CancellationToken::new();
*self.manual_cancel.lock() = Some(cancel.clone());
let prepared = tokio::select! {
prepared = Self::prepare_install(app_handle, version, on_event) => Some(prepared),
prepared = Self::prepare_install(app_handle, version, &on_event) => Some(prepared),
() = cancel.cancelled() => None,
};
// `cancel_download` cancels under the lock, so once the token is taken back its state is
@@ -417,15 +423,15 @@ impl SilentUpdater {
};
logging!(info, Type::System, "Installing update v{version}...");
on_event(DownloadEvent::Installing);
Self::install(update, bytes).await?;
Self::delete_cache();
Ok(InstallUpdateOutcome::Installed)
}
async fn prepare_install(
app_handle: &tauri::AppHandle,
version: &str,
on_event: impl Fn(DownloadEvent) + Sync,
on_event: &(impl Fn(DownloadEvent) + Sync),
) -> Result<Option<(Update, Vec<u8>)>> {
let Some(update) = Self::check(app_handle)
.await?
@@ -267,6 +267,9 @@ export function UpdateViewer({ ref }: { ref?: Ref<UpdateViewerRef> }) {
})
const { downloaded, total } = download
// Install cannot be cancelled; only the download can.
const [installing, setInstalling] = useState(false)
const progress = total <= 0 ? 0 : Math.min((downloaded / total) * 100, 100)
useImperativeHandle(ref, () => ({
@@ -333,6 +336,8 @@ export function UpdateViewer({ ref }: { ref?: Ref<UpdateViewerRef> }) {
...prev,
total: prev.total || prev.downloaded,
}))
} else if (event.event === 'Installing') {
setInstalling(true)
}
}
@@ -366,6 +371,7 @@ export function UpdateViewer({ ref }: { ref?: Ref<UpdateViewerRef> }) {
} finally {
setUpdateState(false)
setDownload({ downloaded: 0, total: 0 })
setInstalling(false)
}
})
@@ -419,6 +425,7 @@ export function UpdateViewer({ ref }: { ref?: Ref<UpdateViewerRef> }) {
}}
okBtn={t('settings.modals.update.actions.update')}
cancelBtn={t('shared.actions.cancel')}
disableCancel={installing}
onClose={() => setOpen(false)}
onCancel={() => {
if (updateState) {
@@ -560,7 +567,7 @@ export function UpdateViewer({ ref }: { ref?: Ref<UpdateViewerRef> }) {
</Box>
{updateState && (
<LinearProgress
variant={total > 0 ? 'determinate' : 'indeterminate'}
variant={total > 0 && !installing ? 'determinate' : 'indeterminate'}
value={progress}
sx={{ mt: 1 }}
/>
+14 -3
View File
@@ -260,10 +260,16 @@ export type DnsOverrideOutcome =
| { status: 'applied' }
| { status: 'confirmation_required'; source: string }
/** Same wire shape as the updater plugin's JS `DownloadEvent`. */
/**
* Same wire shape as the updater plugin's JS `DownloadEvent`, plus `Installing` when the
* install starts.
*/
export type DownloadEvent = DownloadEvent_Serialize | DownloadEvent_Deserialize
/** Same wire shape as the updater plugin's JS `DownloadEvent`. */
/**
* Same wire shape as the updater plugin's JS `DownloadEvent`, plus `Installing` when the
* install starts.
*/
export type DownloadEvent_Deserialize =
| {
event: 'Started'
@@ -278,8 +284,12 @@ export type DownloadEvent_Deserialize =
}
}
| { event: 'Finished' }
| { event: 'Installing' }
/** Same wire shape as the updater plugin's JS `DownloadEvent`. */
/**
* Same wire shape as the updater plugin's JS `DownloadEvent`, plus `Installing` when the
* install starts.
*/
export type DownloadEvent_Serialize =
| {
event: 'Started'
@@ -294,6 +304,7 @@ export type DownloadEvent_Serialize =
}
}
| { event: 'Finished' }
| { event: 'Installing' }
/** Operation associated with a pending failure. */
export type FailedOperation =