diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a3380870..3b124daf 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1053,7 +1053,7 @@ dependencies = [ [[package]] name = "defguard_wireguard_rs" version = "0.3.0" -source = "git+https://github.com/DefGuard/wireguard-rs.git?tag=v0.3.0#7034b708e199eb9893bbca0bbdf24bdc910a3773" +source = "git+https://github.com/DefGuard/wireguard-rs.git?branch=main#d0caf499f5088dfd5ec360e5bf3bb250e081b90c" dependencies = [ "base64 0.21.5", "libc", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 8af5133e..dd6808d2 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -19,7 +19,7 @@ anyhow = "1.0" base64 = "0.21" clap = { version = "4.4", features = ["derive", "env"] } chrono = { version = "0.4", features = ["serde"] } -defguard_wireguard_rs = { git = "https://github.com/DefGuard/wireguard-rs.git", tag = "v0.3.0" } +defguard_wireguard_rs = { git = "https://github.com/DefGuard/wireguard-rs.git", branch = "main" } dirs = "5.0" local-ip-address = "0.5" log = "0.4" diff --git a/src-tauri/src/service/mod.rs b/src-tauri/src/service/mod.rs index 557517fb..5406c9b0 100644 --- a/src-tauri/src/service/mod.rs +++ b/src-tauri/src/service/mod.rs @@ -114,6 +114,20 @@ impl DesktopDaemonService for DaemonService { Status::new(Code::Internal, msg) })?; + // Configure dns + debug!("Configuring DNS for interface {ifname}"); + let dns: Vec = request + .dns + .into_iter() + .filter_map(|s| s.parse().ok()) + .collect(); + + wgapi.configure_dns(&dns).map_err(|err| { + let msg = format!("Failed to configure DNS for WireGuard interface {ifname}: {err}"); + error!("{msg}"); + Status::new(Code::Internal, msg) + })?; + Ok(Response::new(())) } diff --git a/src/pages/client/pages/ClientInstancePage/components/LocationUsageChart/LocationUsageChart.tsx b/src/pages/client/pages/ClientInstancePage/components/LocationUsageChart/LocationUsageChart.tsx index 841f08ec..01e77e26 100644 --- a/src/pages/client/pages/ClientInstancePage/components/LocationUsageChart/LocationUsageChart.tsx +++ b/src/pages/client/pages/ClientInstancePage/components/LocationUsageChart/LocationUsageChart.tsx @@ -84,7 +84,6 @@ export const LocationUsageChart = ({ }, [padding]); if (!data.length) return null; - return (
@@ -153,6 +152,7 @@ export const LocationUsageChart = ({ tickLine={{ stroke: colors.surfaceDefaultModal }} hide={hideX} padding={getPadding} + dx={3} tick={{ fontSize: 12, color: '#222', @@ -188,4 +188,6 @@ export const LocationUsageChart = ({ ); }; -const formatXTick = (tickData: number) => dayjs.utc(tickData).local().format('HH:mm'); +// FIXME: hack with spaces to avoid tick overlapping +const formatXTick = (tickData: number) => + dayjs.utc(tickData).local().format('HH:mm:ss ');