Merge branch 'dev' into chore/i18n

This commit is contained in:
Slinetrac
2025-11-05 12:25:12 +08:00
Unverified
9 changed files with 168 additions and 147 deletions

View File

@@ -55,7 +55,7 @@
"@tauri-apps/plugin-updater": "2.9.0",
"@types/json-schema": "^7.0.15",
"ahooks": "^3.9.6",
"axios": "^1.13.1",
"axios": "^1.13.2",
"dayjs": "1.11.19",
"foxact": "^0.2.49",
"i18next": "^25.6.0",
@@ -82,7 +82,7 @@
"@actions/github": "^6.0.1",
"@eslint-react/eslint-plugin": "^2.3.1",
"@eslint/js": "^9.39.1",
"@tauri-apps/cli": "2.9.2",
"@tauri-apps/cli": "2.9.3",
"@types/js-yaml": "^4.0.9",
"@types/lodash-es": "^4.17.12",
"@types/node": "^24.10.0",
@@ -119,7 +119,7 @@
"vite": "^7.1.12",
"vite-plugin-monaco-editor-esm": "^2.0.2",
"vite-plugin-svgr": "^4.5.0",
"vitest": "^4.0.6"
"vitest": "^4.0.7"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [

194
pnpm-lock.yaml generated
View File

@@ -69,8 +69,8 @@ importers:
specifier: ^3.9.6
version: 3.9.6(react-dom@19.2.0(react@19.2.0))(react@19.2.0)
axios:
specifier: ^1.13.1
version: 1.13.1
specifier: ^1.13.2
version: 1.13.2
dayjs:
specifier: 1.11.19
version: 1.11.19
@@ -145,8 +145,8 @@ importers:
specifier: ^9.39.1
version: 9.39.1
'@tauri-apps/cli':
specifier: 2.9.2
version: 2.9.2
specifier: 2.9.3
version: 2.9.3
'@types/js-yaml':
specifier: ^4.0.9
version: 4.0.9
@@ -256,8 +256,8 @@ importers:
specifier: ^4.5.0
version: 4.5.0(rollup@4.46.2)(typescript@5.9.3)(vite@7.1.12(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1))
vitest:
specifier: ^4.0.6
version: 4.0.6(@types/debug@4.1.12)(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1)
specifier: ^4.0.7
version: 4.0.7(@types/debug@4.1.12)(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1)
packages:
@@ -1684,74 +1684,74 @@ packages:
'@tauri-apps/api@2.9.0':
resolution: {integrity: sha512-qD5tMjh7utwBk9/5PrTA/aGr3i5QaJ/Mlt7p8NilQ45WgbifUNPyKWsA63iQ8YfQq6R8ajMapU+/Q8nMcPRLNw==}
'@tauri-apps/cli-darwin-arm64@2.9.2':
resolution: {integrity: sha512-g1OtCXydOZFYRUEAyGYdJ2lLaE3l5jk8o+Bro8y2WOLwBLtbWjBoJIVobOKFanfjG/Xr8H/UA+umEVILPhMc2A==}
'@tauri-apps/cli-darwin-arm64@2.9.3':
resolution: {integrity: sha512-W8FQXZXQmQ0Fmj9UJXNrm2mLdIaLLriKVY7o/FzmizyIKTPIvHjfZALTNybbpTQRbJvKoGHLrW1DNzAWVDWJYg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [darwin]
'@tauri-apps/cli-darwin-x64@2.9.2':
resolution: {integrity: sha512-nHHIY33noUmMOyFwAJz0xQyrYIXU+bae8MNos4TGsTo491YWAF2uzr6iW+Bq0N530xDcbe7EyRvDHgK43RmmVw==}
'@tauri-apps/cli-darwin-x64@2.9.3':
resolution: {integrity: sha512-zDwu40rlshijt3TU6aRvzPUyVpapsx1sNfOlreDMTaMelQLHl6YoQzSRpLHYwrHrhimxyX2uDqnKIiuGel0Lhg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [darwin]
'@tauri-apps/cli-linux-arm-gnueabihf@2.9.2':
resolution: {integrity: sha512-Dq17LBdSuzf+fWOKMIyiSao+Fcq4FiQwYYlx3Nk8oafDINc8sVBjC5gv2xp18KzYhk9teSWfmDpD1sj+D3t7uw==}
'@tauri-apps/cli-linux-arm-gnueabihf@2.9.3':
resolution: {integrity: sha512-+Oc2OfcTRwYtW93VJqd/HOk77buORwC9IToj/qsEvM7bTMq6Kda4alpZprzwrCHYANSw+zD8PgjJdljTpe4p+g==}
engines: {node: '>= 10'}
cpu: [arm]
os: [linux]
'@tauri-apps/cli-linux-arm64-gnu@2.9.2':
resolution: {integrity: sha512-Pxj5k29Rxj9xEht4gdE744t5HLXTwBojkjYDXXyJ3mE+BEg9hFX5WkStg7OkyZwH60u8NSkDSMpo7MJTH9srmA==}
'@tauri-apps/cli-linux-arm64-gnu@2.9.3':
resolution: {integrity: sha512-59GqU/J1n9wFyAtleoQOaU0oVIo+kwQynEw4meFDoKRXszKGor6lTsbsS3r0QKLSPbc0o/yYGJhqqCtkYjb/eg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@tauri-apps/cli-linux-arm64-musl@2.9.2':
resolution: {integrity: sha512-mx82BuD4q3Yj5Zw+LXveZgPaDCnmH2At2LosX1siK77kaD5Ap5FF+FN0V4y+3cwq+Hcrk9AhEUPbHqoNOx1R2g==}
'@tauri-apps/cli-linux-arm64-musl@2.9.3':
resolution: {integrity: sha512-fzvG+jEn5/iYGNH6Z2IRMheYFC4pJdXa19BR9fFm6Bdn2cuajRLDKdUcEME/DCtwqclphXtFZTrT4oezY5vI/A==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [linux]
'@tauri-apps/cli-linux-riscv64-gnu@2.9.2':
resolution: {integrity: sha512-Ypm1nnr7k+ECC1+JfDcnxROHt6BX8t/4GplxBvdY68BDXtIcBbdhPWDos7MK+3bDmoaA0WSJbW+DUjpfSkyKgw==}
'@tauri-apps/cli-linux-riscv64-gnu@2.9.3':
resolution: {integrity: sha512-qV8DZXI/fZwawk6T3Th1g6smiNC2KeQTk7XFgKvqZ6btC01z3UTsQmNGvI602zwm3Ld1TBZb4+rEWu2QmQimmw==}
engines: {node: '>= 10'}
cpu: [riscv64]
os: [linux]
'@tauri-apps/cli-linux-x64-gnu@2.9.2':
resolution: {integrity: sha512-tg85cGIM9PWwsbQg8m3uah3SfoNapgUr4vhWtkqgeTDZOjQuQ2duTwCH4UiM7acBpbZHNzvRrxSFpv0U53TqQQ==}
'@tauri-apps/cli-linux-x64-gnu@2.9.3':
resolution: {integrity: sha512-tquyEONCNRfqEBWEe4eAHnxFN5yY5lFkCuD4w79XLIovUxVftQ684+xLp7zkhntkt4y20SMj2AgJa/+MOlx4Kg==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@tauri-apps/cli-linux-x64-musl@2.9.2':
resolution: {integrity: sha512-xW8qaz9bcwR35W2gIg7fKG9e1Z34idOsGpD2zIPgxlJyF314B/1qie50hbOqt5AbbXHR4iRpxKE4kA2grqMmkg==}
'@tauri-apps/cli-linux-x64-musl@2.9.3':
resolution: {integrity: sha512-v2cBIB/6ji8DL+aiL5QUykU3ZO8OoJGyx50/qv2HQVzkf85KdaYSis3D/oVRemN/pcDz+vyCnnL3XnzFnDl4JQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [linux]
'@tauri-apps/cli-win32-arm64-msvc@2.9.2':
resolution: {integrity: sha512-A1PshB8oHdY7zYOPlLD7Om7/aD9sOUVREd765ElIzYDtptWcALwOP9jb22Wi01vDTqxf98E4ZGIcG2gxr4FhiA==}
'@tauri-apps/cli-win32-arm64-msvc@2.9.3':
resolution: {integrity: sha512-ZGvBy7nvrHPbE0HeKp/ioaiw8bNgAHxWnb7JRZ4/G0A+oFj0SeSFxl9k5uU6FKnM7bHM23Gd1oeaDex9g5Fceg==}
engines: {node: '>= 10'}
cpu: [arm64]
os: [win32]
'@tauri-apps/cli-win32-ia32-msvc@2.9.2':
resolution: {integrity: sha512-AuCi0Vnc4qkXRLCC58das0u45SmXAjqcOjqF324CBKa1Z7jjNJESm0Sc2oc2G2q6f2eAbAfi34s2iJNaJU1hlQ==}
'@tauri-apps/cli-win32-ia32-msvc@2.9.3':
resolution: {integrity: sha512-UsgIwOnpCoY9NK9/65QiwgmWVIE80LE7SwRYVblGtmlY9RYfsYvpbItwsovA/AcHMTiO+OCvS/q9yLeqS3m6Sg==}
engines: {node: '>= 10'}
cpu: [ia32]
os: [win32]
'@tauri-apps/cli-win32-x64-msvc@2.9.2':
resolution: {integrity: sha512-kDoejyfvME/mLkR4VofQnmVPTt/smJvoXuE3xgTbUwcUQKqawM8EyQvxOHQosaJYfQphHi7G0ya8UZo3PlDZig==}
'@tauri-apps/cli-win32-x64-msvc@2.9.3':
resolution: {integrity: sha512-fmw7NrrHE5m49idCvJAx9T9bsupjdJ0a3p3DPCNCZRGANU6R1tA1L+KTlVuUtdAldX2NqU/9UPo2SCslYKgJHQ==}
engines: {node: '>= 10'}
cpu: [x64]
os: [win32]
'@tauri-apps/cli@2.9.2':
resolution: {integrity: sha512-aGzdVgxQW6WQ7e5nydPZ/30u8HvltHjO3Ytzf1wOxX1N5Yj2TsjKWRb/AWJlB95Huml3k3c/b6s0ijAvlSo9xw==}
'@tauri-apps/cli@2.9.3':
resolution: {integrity: sha512-BQ7iLUXTQcyG1PpzLWeVSmBCedYDpnA/6Cm/kRFGtqjTf/eVUlyYO5S2ee07tLum3nWwDBWTGFZeruO8yEukfA==}
engines: {node: '>= 10'}
hasBin: true
@@ -2019,11 +2019,11 @@ packages:
peerDependencies:
vite: ^4 || ^5 || ^6 || ^7
'@vitest/expect@4.0.6':
resolution: {integrity: sha512-5j8UUlBVhOjhj4lR2Nt9sEV8b4WtbcYh8vnfhTNA2Kn5+smtevzjNq+xlBuVhnFGXiyPPNzGrOVvmyHWkS5QGg==}
'@vitest/expect@4.0.7':
resolution: {integrity: sha512-jGRG6HghnJDjljdjYIoVzX17S6uCVCBRFnsgdLGJ6CaxfPh8kzUKe/2n533y4O/aeZ/sIr7q7GbuEbeGDsWv4Q==}
'@vitest/mocker@4.0.6':
resolution: {integrity: sha512-3COEIew5HqdzBFEYN9+u0dT3i/NCwppLnO1HkjGfAP1Vs3vti1Hxm/MvcbC4DAn3Szo1M7M3otiAaT83jvqIjA==}
'@vitest/mocker@4.0.7':
resolution: {integrity: sha512-OsDwLS7WnpuNslOV6bJkXVYVV/6RSc4eeVxV7h9wxQPNxnjRvTTrIikfwCbMyl8XJmW6oOccBj2Q07YwZtQcCw==}
peerDependencies:
msw: ^2.4.9
vite: ^6.0.0 || ^7.0.0-0
@@ -2033,20 +2033,20 @@ packages:
vite:
optional: true
'@vitest/pretty-format@4.0.6':
resolution: {integrity: sha512-4vptgNkLIA1W1Nn5X4x8rLJBzPiJwnPc+awKtfBE5hNMVsoAl/JCCPPzNrbf+L4NKgklsis5Yp2gYa+XAS442g==}
'@vitest/pretty-format@4.0.7':
resolution: {integrity: sha512-YY//yxqTmk29+/pK+Wi1UB4DUH3lSVgIm+M10rAJ74pOSMgT7rydMSc+vFuq9LjZLhFvVEXir8EcqMke3SVM6Q==}
'@vitest/runner@4.0.6':
resolution: {integrity: sha512-trPk5qpd7Jj+AiLZbV/e+KiiaGXZ8ECsRxtnPnCrJr9OW2mLB72Cb824IXgxVz/mVU3Aj4VebY+tDTPn++j1Og==}
'@vitest/runner@4.0.7':
resolution: {integrity: sha512-orU1lsu4PxLEcDWfjVCNGIedOSF/YtZ+XMrd1PZb90E68khWCNzD8y1dtxtgd0hyBIQk8XggteKN/38VQLvzuw==}
'@vitest/snapshot@4.0.6':
resolution: {integrity: sha512-PaYLt7n2YzuvxhulDDu6c9EosiRuIE+FI2ECKs6yvHyhoga+2TBWI8dwBjs+IeuQaMtZTfioa9tj3uZb7nev1g==}
'@vitest/snapshot@4.0.7':
resolution: {integrity: sha512-xJL+Nkw0OjaUXXQf13B8iKK5pI9QVtN9uOtzNHYuG/o/B7fIEg0DQ+xOe0/RcqwDEI15rud1k7y5xznBKGUXAA==}
'@vitest/spy@4.0.6':
resolution: {integrity: sha512-g9jTUYPV1LtRPRCQfhbMintW7BTQz1n6WXYQYRQ25qkyffA4bjVXjkROokZnv7t07OqfaFKw1lPzqKGk1hmNuQ==}
'@vitest/spy@4.0.7':
resolution: {integrity: sha512-FW4X8hzIEn4z+HublB4hBF/FhCVaXfIHm8sUfvlznrcy1MQG7VooBgZPMtVCGZtHi0yl3KESaXTqsKh16d8cFg==}
'@vitest/utils@4.0.6':
resolution: {integrity: sha512-bG43VS3iYKrMIZXBo+y8Pti0O7uNju3KvNn6DrQWhQQKcLavMB+0NZfO1/QBAEbq0MaQ3QjNsnnXlGQvsh0Z6A==}
'@vitest/utils@4.0.7':
resolution: {integrity: sha512-HNrg9CM/Z4ZWB6RuExhuC6FPmLipiShKVMnT9JlQvfhwR47JatWLChA6mtZqVHqypE6p/z6ofcjbyWpM7YLxPQ==}
acorn-jsx@5.3.2:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
@@ -2133,8 +2133,8 @@ packages:
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
engines: {node: '>= 0.4'}
axios@1.13.1:
resolution: {integrity: sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==}
axios@1.13.2:
resolution: {integrity: sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==}
babel-plugin-macros@3.1.0:
resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==}
@@ -4192,18 +4192,18 @@ packages:
yaml:
optional: true
vitest@4.0.6:
resolution: {integrity: sha512-gR7INfiVRwnEOkCk47faros/9McCZMp5LM+OMNWGLaDBSvJxIzwjgNFufkuePBNaesGRnLmNfW+ddbUJRZn0nQ==}
vitest@4.0.7:
resolution: {integrity: sha512-xQroKAadK503CrmbzCISvQUjeuvEZzv6U0wlnlVFOi5i3gnzfH4onyQ29f3lzpe0FresAiTAd3aqK0Bi/jLI8w==}
engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0}
hasBin: true
peerDependencies:
'@edge-runtime/vm': '*'
'@types/debug': ^4.1.12
'@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
'@vitest/browser-playwright': 4.0.6
'@vitest/browser-preview': 4.0.6
'@vitest/browser-webdriverio': 4.0.6
'@vitest/ui': 4.0.6
'@vitest/browser-playwright': 4.0.7
'@vitest/browser-preview': 4.0.7
'@vitest/browser-webdriverio': 4.0.7
'@vitest/ui': 4.0.7
happy-dom: '*'
jsdom: '*'
peerDependenciesMeta:
@@ -5861,52 +5861,52 @@ snapshots:
'@tauri-apps/api@2.9.0': {}
'@tauri-apps/cli-darwin-arm64@2.9.2':
'@tauri-apps/cli-darwin-arm64@2.9.3':
optional: true
'@tauri-apps/cli-darwin-x64@2.9.2':
'@tauri-apps/cli-darwin-x64@2.9.3':
optional: true
'@tauri-apps/cli-linux-arm-gnueabihf@2.9.2':
'@tauri-apps/cli-linux-arm-gnueabihf@2.9.3':
optional: true
'@tauri-apps/cli-linux-arm64-gnu@2.9.2':
'@tauri-apps/cli-linux-arm64-gnu@2.9.3':
optional: true
'@tauri-apps/cli-linux-arm64-musl@2.9.2':
'@tauri-apps/cli-linux-arm64-musl@2.9.3':
optional: true
'@tauri-apps/cli-linux-riscv64-gnu@2.9.2':
'@tauri-apps/cli-linux-riscv64-gnu@2.9.3':
optional: true
'@tauri-apps/cli-linux-x64-gnu@2.9.2':
'@tauri-apps/cli-linux-x64-gnu@2.9.3':
optional: true
'@tauri-apps/cli-linux-x64-musl@2.9.2':
'@tauri-apps/cli-linux-x64-musl@2.9.3':
optional: true
'@tauri-apps/cli-win32-arm64-msvc@2.9.2':
'@tauri-apps/cli-win32-arm64-msvc@2.9.3':
optional: true
'@tauri-apps/cli-win32-ia32-msvc@2.9.2':
'@tauri-apps/cli-win32-ia32-msvc@2.9.3':
optional: true
'@tauri-apps/cli-win32-x64-msvc@2.9.2':
'@tauri-apps/cli-win32-x64-msvc@2.9.3':
optional: true
'@tauri-apps/cli@2.9.2':
'@tauri-apps/cli@2.9.3':
optionalDependencies:
'@tauri-apps/cli-darwin-arm64': 2.9.2
'@tauri-apps/cli-darwin-x64': 2.9.2
'@tauri-apps/cli-linux-arm-gnueabihf': 2.9.2
'@tauri-apps/cli-linux-arm64-gnu': 2.9.2
'@tauri-apps/cli-linux-arm64-musl': 2.9.2
'@tauri-apps/cli-linux-riscv64-gnu': 2.9.2
'@tauri-apps/cli-linux-x64-gnu': 2.9.2
'@tauri-apps/cli-linux-x64-musl': 2.9.2
'@tauri-apps/cli-win32-arm64-msvc': 2.9.2
'@tauri-apps/cli-win32-ia32-msvc': 2.9.2
'@tauri-apps/cli-win32-x64-msvc': 2.9.2
'@tauri-apps/cli-darwin-arm64': 2.9.3
'@tauri-apps/cli-darwin-x64': 2.9.3
'@tauri-apps/cli-linux-arm-gnueabihf': 2.9.3
'@tauri-apps/cli-linux-arm64-gnu': 2.9.3
'@tauri-apps/cli-linux-arm64-musl': 2.9.3
'@tauri-apps/cli-linux-riscv64-gnu': 2.9.3
'@tauri-apps/cli-linux-x64-gnu': 2.9.3
'@tauri-apps/cli-linux-x64-musl': 2.9.3
'@tauri-apps/cli-win32-arm64-msvc': 2.9.3
'@tauri-apps/cli-win32-ia32-msvc': 2.9.3
'@tauri-apps/cli-win32-x64-msvc': 2.9.3
'@tauri-apps/plugin-clipboard-manager@2.3.2':
dependencies:
@@ -6187,43 +6187,43 @@ snapshots:
transitivePeerDependencies:
- '@swc/helpers'
'@vitest/expect@4.0.6':
'@vitest/expect@4.0.7':
dependencies:
'@standard-schema/spec': 1.0.0
'@types/chai': 5.2.2
'@vitest/spy': 4.0.6
'@vitest/utils': 4.0.6
'@vitest/spy': 4.0.7
'@vitest/utils': 4.0.7
chai: 6.2.0
tinyrainbow: 3.0.3
'@vitest/mocker@4.0.6(vite@7.1.12(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1))':
'@vitest/mocker@4.0.7(vite@7.1.12(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1))':
dependencies:
'@vitest/spy': 4.0.6
'@vitest/spy': 4.0.7
estree-walker: 3.0.3
magic-string: 0.30.19
optionalDependencies:
vite: 7.1.12(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1)
'@vitest/pretty-format@4.0.6':
'@vitest/pretty-format@4.0.7':
dependencies:
tinyrainbow: 3.0.3
'@vitest/runner@4.0.6':
'@vitest/runner@4.0.7':
dependencies:
'@vitest/utils': 4.0.6
'@vitest/utils': 4.0.7
pathe: 2.0.3
'@vitest/snapshot@4.0.6':
'@vitest/snapshot@4.0.7':
dependencies:
'@vitest/pretty-format': 4.0.6
'@vitest/pretty-format': 4.0.7
magic-string: 0.30.19
pathe: 2.0.3
'@vitest/spy@4.0.6': {}
'@vitest/spy@4.0.7': {}
'@vitest/utils@4.0.6':
'@vitest/utils@4.0.7':
dependencies:
'@vitest/pretty-format': 4.0.6
'@vitest/pretty-format': 4.0.7
tinyrainbow: 3.0.3
acorn-jsx@5.3.2(acorn@8.15.0):
@@ -6340,7 +6340,7 @@ snapshots:
possible-typed-array-names: 1.1.0
optional: true
axios@1.13.1:
axios@1.13.2:
dependencies:
follow-redirects: 1.15.9
form-data: 4.0.4
@@ -8871,15 +8871,15 @@ snapshots:
terser: 5.44.0
yaml: 2.8.1
vitest@4.0.6(@types/debug@4.1.12)(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1):
vitest@4.0.7(@types/debug@4.1.12)(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1):
dependencies:
'@vitest/expect': 4.0.6
'@vitest/mocker': 4.0.6(vite@7.1.12(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1))
'@vitest/pretty-format': 4.0.6
'@vitest/runner': 4.0.6
'@vitest/snapshot': 4.0.6
'@vitest/spy': 4.0.6
'@vitest/utils': 4.0.6
'@vitest/expect': 4.0.7
'@vitest/mocker': 4.0.7(vite@7.1.12(@types/node@24.10.0)(jiti@2.6.1)(sass@1.93.3)(terser@5.44.0)(yaml@2.8.1))
'@vitest/pretty-format': 4.0.7
'@vitest/runner': 4.0.7
'@vitest/snapshot': 4.0.7
'@vitest/spy': 4.0.7
'@vitest/utils': 4.0.7
debug: 4.4.3
es-module-lexer: 1.7.0
expect-type: 1.2.2

View File

@@ -292,8 +292,7 @@ async fn restore_previous_profile(prev_profile: &String) -> CmdResult<()> {
};
Config::profiles()
.await
.edit_draft(|d| d.patch_config(&restore_profiles))
.stringify_err()?;
.edit_draft(|d| d.patch_config(&restore_profiles));
Config::profiles().await.apply();
crate::process::AsyncHandler::spawn(|| async move {
if let Err(e) = profiles_save_file_safe().await {
@@ -412,7 +411,7 @@ pub async fn patch_profiles_config(profiles: IProfiles) -> CmdResult<bool> {
CURRENT_SWITCHING_PROFILE.store(false, Ordering::Release);
return Ok(false);
}
let _ = Config::profiles()
Config::profiles()
.await
.edit_draft(|d| d.patch_config(&profiles));

View File

@@ -155,15 +155,13 @@ impl Config {
};
let runtime = Config::runtime().await;
let config = runtime
.latest_arc()
let runtime_arc = runtime.latest_arc();
let config = runtime_arc
.config
.as_ref()
.ok_or_else(|| anyhow!("failed to get runtime config"))?
.clone();
drop(runtime); // 显式释放锁
.ok_or_else(|| anyhow!("failed to get runtime config"))?;
help::save_yaml(&path, &config, Some("# Generated by Clash Verge")).await?;
help::save_yaml(&path, config, Some("# Generated by Clash Verge")).await?;
Ok(path)
}

View File

@@ -87,7 +87,7 @@ impl IProfiles {
}
/// 只修改currentvalid和chain
pub fn patch_config(&mut self, patch: &IProfiles) -> Result<()> {
pub fn patch_config(&mut self, patch: &IProfiles) {
if self.items.is_none() {
self.items = Some(vec![]);
}
@@ -100,8 +100,6 @@ impl IProfiles {
self.current = some_uid.cloned();
}
}
Ok(())
}
pub fn get_current(&self) -> Option<&String> {

View File

@@ -24,6 +24,8 @@ use futures::future::join_all;
use parking_lot::Mutex;
use smartstring::alias::String;
use std::collections::HashMap;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::{
sync::atomic::{AtomicBool, Ordering},
@@ -575,9 +577,6 @@ impl Tray {
return;
}
use std::future::Future;
use std::pin::Pin;
let fut: Pin<Box<dyn Future<Output = ()> + Send>> = match tray_event.as_str() {
"system_proxy" => Box::pin(async move {
feat::toggle_system_proxy().await;
@@ -1226,7 +1225,14 @@ fn on_menu_event(_: &AppHandle, event: MenuEvent) {
};
feat::switch_proxy_node(group_name, proxy_name).await;
}
_ => {}
_ => {
logging!(
debug,
Type::Tray,
"Unhandled tray menu event: {:?}",
event.id
);
}
}
// We dont expected to refresh tray state here

View File

@@ -275,41 +275,43 @@ impl CoreConfigValidator {
logging!(info, Type::Validate, "验证目录: {}", app_dir_str);
// 使用子进程运行clash验证配置
let output = app_handle
.shell()
.sidecar(clash_core.as_str())?
.args(["-t", "-d", app_dir_str, "-f", config_path])
.output()
.await?;
let command = app_handle.shell().sidecar(clash_core.as_str())?.args([
"-t",
"-d",
app_dir_str,
"-f",
config_path,
]);
let output = command.output().await?;
let stderr = std::string::String::from_utf8_lossy(&output.stderr);
let stdout = std::string::String::from_utf8_lossy(&output.stdout);
let status = &output.status;
let stderr = &output.stderr;
let stdout = &output.stdout;
// 检查进程退出状态和错误输出
let error_keywords = ["FATA", "fatal", "Parse config error", "level=fatal"];
let has_error =
!output.status.success() || error_keywords.iter().any(|&kw| stderr.contains(kw));
let has_error = !status.success() || contains_any_keyword(stderr, &error_keywords);
logging!(info, Type::Validate, "-------- 验证结果 --------");
if !stderr.is_empty() {
logging!(info, Type::Validate, "stderr输出:\n{}", stderr);
logging!(info, Type::Validate, "stderr输出:\n{:?}", stderr);
}
if has_error {
logging!(info, Type::Validate, "发现错误,开始处理错误信息");
let error_msg = if !stdout.is_empty() {
stdout.into()
let error_msg: String = if !stdout.is_empty() {
str::from_utf8(stdout).unwrap_or_default().into()
} else if !stderr.is_empty() {
stderr.into()
} else if let Some(code) = output.status.code() {
format!("验证进程异常退出,退出码: {code}")
str::from_utf8(stderr).unwrap_or_default().into()
} else if let Some(code) = status.code() {
format!("验证进程异常退出,退出码: {code}").into()
} else {
"验证进程被终止".into()
};
logging!(info, Type::Validate, "-------- 验证结束 --------");
Ok((false, error_msg.into())) // 返回错误消息给调用者处理
Ok((false, error_msg)) // 返回错误消息给调用者处理
} else {
logging!(info, Type::Validate, "验证成功");
logging!(info, Type::Validate, "-------- 验证结束 --------");
@@ -342,6 +344,23 @@ fn has_ext<P: AsRef<std::path::Path>>(path: P, ext: &str) -> bool {
.unwrap_or(false)
}
fn contains_any_keyword<'a>(buf: &'a [u8], keywords: &'a [&str]) -> bool {
for &kw in keywords {
let needle = kw.as_bytes();
if needle.is_empty() {
continue;
}
let mut i = 0;
while i + needle.len() <= buf.len() {
if &buf[i..i + needle.len()] == needle {
return true;
}
i += 1;
}
}
false
}
singleton_lazy!(
CoreConfigValidator,
CORECONFIGVALIDATOR,

View File

@@ -2,7 +2,7 @@ use crate::{
cmd,
config::{Config, PrfItem, PrfOption, profiles::profiles_draft_update_item_safe},
core::{CoreManager, handle, tray},
logging,
logging, logging_error,
utils::logging::Type,
};
use anyhow::{Result, bail};
@@ -11,17 +11,10 @@ use tauri::Emitter;
/// Toggle proxy profile
pub async fn toggle_proxy_profile(profile_index: String) {
match cmd::patch_profiles_config_by_profile_index(profile_index).await {
Ok(_) => {
let result = tray::Tray::global().update_menu().await;
if let Err(err) = result {
logging!(error, Type::Tray, "更新菜单失败: {}", err);
}
}
Err(err) => {
logging!(error, Type::Tray, "{err}");
}
}
logging_error!(
Type::Config,
cmd::patch_profiles_config_by_profile_index(profile_index).await
);
}
pub async fn switch_proxy_node(group_name: &str, proxy_name: &str) {

View File

@@ -1,4 +1,4 @@
#[cfg(not(feature = "tracing"))]
// #[cfg(not(feature = "tracing"))]
#[cfg(not(feature = "tauri-dev"))]
use crate::utils::logging::NoModuleFilter;
use crate::{
@@ -49,7 +49,9 @@ pub async fn init_logger() -> Result<()> {
#[cfg(feature = "tracing")]
spec.module("tauri", log::LevelFilter::Debug);
#[cfg(feature = "tracing")]
spec.module("wry", log::LevelFilter::Debug);
spec.module("wry", log::LevelFilter::Off);
#[cfg(feature = "tracing")]
spec.module("tauri_plugin_mihomo", log::LevelFilter::Off);
let spec = spec.build();
let logger = Logger::with(spec)
@@ -67,6 +69,12 @@ pub async fn init_logger() -> Result<()> {
);
#[cfg(not(feature = "tracing"))]
let logger = logger.filter(Box::new(NoModuleFilter(&["wry", "tauri"])));
#[cfg(feature = "tracing")]
let logger = logger.filter(Box::new(NoModuleFilter(&[
"wry",
"tauri_plugin_mihomo",
"kode_bridge",
])));
let _handle = logger.start()?;