chore: update dependencies

This commit is contained in:
Kevin Yue committed 2026-05-06 23:20:58 +08:00
1 parent 6289e1539a
commit 0c3af0d60d
8 files changed
+1198 -1491

No files matched your search

Generated
+395 -783
View File
File diff suppressed because it is too large. Load diff
+15 -15
View File
@@ -11,27 +11,27 @@
"dependencies": { "dependencies": {
"@emotion/react": "^11.14.0", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1", "@emotion/styled": "^11.14.1",
"@mui/icons-material": "^7.3.6", "@mui/icons-material": "^7.3.10",
"@mui/material": "^7.3.6", "@mui/material": "^7.3.10",
"@tauri-apps/api": "^2.9.1", "@tauri-apps/api": "^2.11.0",
"react": "^19.2.3", "react": "^19.2.5",
"react-dom": "^19.2.3" "react-dom": "^19.2.5"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "^2.9.6", "@tauri-apps/cli": "^2.11.1",
"@types/node": "^22.19.3", "@types/node": "^25.6.0",
"@types/react": "^19.2.7", "@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.50.0", "@typescript-eslint/eslint-plugin": "^8.59.2",
"@typescript-eslint/parser": "^8.50.0", "@typescript-eslint/parser": "^8.59.2",
"@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-react": "^6.0.1",
"eslint": "^9.39.2", "eslint": "^9.39.4",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-hooks": "^7.1.1",
"prettier": "3.4.2", "prettier": "3.8.3",
"typescript": "^5.9.3", "typescript": "^6.0.3",
"vite": "^8.0.1" "vite": "^8.0.10"
}, },
"packageManager": "[email protected]" "packageManager": "[email protected]"
} }
+730 -686
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -89,8 +89,8 @@ impl GuiUpdater {
pub async fn update(&self) { pub async fn update(&self) {
if !cfg!(any(target_arch = "x86_64", target_arch = "aarch64")) { if !cfg!(any(target_arch = "x86_64", target_arch = "aarch64")) {
info!("GUI version is not supported on this architecture."); info!("GUI version is not supported on this architecture.");
return; return;
} }
info!("Update GUI, version: {}", self.version); info!("Update GUI, version: {}", self.version);
@@ -104,9 +104,9 @@ impl GuiUpdater {
}; };
let arch = if cfg!(target_arch = "x86_64") { let arch = if cfg!(target_arch = "x86_64") {
"x86_64" "x86_64"
} else { } else {
"aarch64" "aarch64"
}; };
let file_url = format!( let file_url = format!(
+1 -1
View File
@@ -159,7 +159,7 @@ mod signals {
pub async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) { pub async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) {
use gpapi::service::event::WsEvent; use gpapi::service::event::WsEvent;
use tokio::signal::unix::{signal, Signal, SignalKind}; use tokio::signal::unix::{Signal, SignalKind, signal};
let (mut user_sig1, mut user_sig2) = match || -> anyhow::Result<(Signal, Signal)> { let (mut user_sig1, mut user_sig2) = match || -> anyhow::Result<(Signal, Signal)> {
let user_sig1 = signal(SignalKind::user_defined1())?; let user_sig1 = signal(SignalKind::user_defined1())?;
+1 -1
View File
@@ -11,7 +11,7 @@ use openconnect::{find_csd_wrapper, find_vpnc_script};
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use tokio::{ use tokio::{
net::TcpListener, net::TcpListener,
sync::{mpsc, watch, RwLock}, sync::{RwLock, mpsc, watch},
}; };
use tokio_util::sync::CancellationToken; use tokio_util::sync::CancellationToken;
+1 -1
View File
@@ -58,7 +58,7 @@ async fn gateway_login_with_options(
// It's possible to get an empty response, log the response headers for debugging // It's possible to get an empty response, log the response headers for debugging
if res.trim().is_empty() { if res.trim().is_empty() {
debug!("Empty gateway login response headers: {:?}", res); info!("Empty gateway login response headers: {:?}", res);
bail!("Got empty gateway login response"); bail!("Got empty gateway login response");
} }
+51
View File
@@ -1,5 +1,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;
use std::ffi::OsStr;
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
@@ -41,6 +42,15 @@ pub fn patch_gui_runtime_env(hidpi: bool) {
// This is to avoid blank screen on some systems // This is to avoid blank screen on some systems
unsafe { std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1") }; unsafe { std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1") };
if is_wayland_session(
env::var_os("WAYLAND_DISPLAY").as_deref(),
env::var("XDG_SESSION_TYPE").ok().as_deref(),
) {
info!("Wayland session detected, enabling Linux WebKit rendering fallbacks");
set_env_if_missing("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
set_env_if_missing("LIBGL_ALWAYS_SOFTWARE", "1");
}
if hidpi { if hidpi {
info!("Setting GDK_SCALE=2 and GDK_DPI_SCALE=0.5"); info!("Setting GDK_SCALE=2 and GDK_DPI_SCALE=0.5");
unsafe { unsafe {
@@ -49,3 +59,44 @@ pub fn patch_gui_runtime_env(hidpi: bool) {
}; };
} }
} }
fn is_wayland_session(wayland_display: Option<&OsStr>, xdg_session_type: Option<&str>) -> bool {
if wayland_display.is_some() {
return true;
}
matches!(xdg_session_type, Some("wayland"))
}
fn set_env_if_missing(key: &str, value: &str) {
if env::var_os(key).is_some() {
return;
}
info!("Setting {}={}", key, value);
unsafe { env::set_var(key, value) };
}
#[cfg(test)]
mod tests {
use std::ffi::OsStr;
use super::is_wayland_session;
#[test]
fn detects_wayland_from_wayland_display() {
assert!(is_wayland_session(Some(OsStr::new("wayland-1")), None));
}
#[test]
fn detects_wayland_from_session_type() {
assert!(is_wayland_session(None, Some("wayland")));
}
#[test]
fn ignores_non_wayland_sessions() {
assert!(!is_wayland_session(None, None));
assert!(!is_wayland_session(None, Some("x11")));
assert!(!is_wayland_session(None, Some("tty")));
}
}