Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchinchilla committed Jul 12, 2024
1 parent c49e9af commit a631a73
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_and_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
shell: bash
run: |
mkdir -p artifacts/${{ matrix.dir }}
mv target/${{ matrix.target }}/release/geph5-client artifacts/${{ matrix.dir }}/
cp target/${{ matrix.target }}/release/geph5-client artifacts/${{ matrix.dir }}/
- name: Build bridge and exit
if: matrix.os == 'ubuntu-20.04'
Expand All @@ -79,6 +79,7 @@ jobs:
run: |
choco install innosetup
cp target/${{ matrix.target }}/release/geph5-client-gui packaging/windows
cp target/${{ matrix.target }}/release/geph5-client packaging/windows
cp binaries/geph5-client/windows-lib/* packaging/windows
iscc packaging/windows/setup.iss
cp packaging/windows/Output/* artifacts/${{ matrix.dir }}/
Expand Down
31 changes: 26 additions & 5 deletions binaries/geph5-client-gui/src/daemon/subproc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::{
net::{IpAddr, Ipv4Addr, SocketAddr},
os::windows::process::CommandExt,
};

use geph5_client::Config;

Expand All @@ -21,10 +24,28 @@ impl Daemon for SubprocDaemon {
cfg_path.clone(),
serde_yaml::to_string(&serde_json::to_value(&cfg)?)?,
)?;
std::process::Command::new("geph5-client")
.arg("-c")
.arg(cfg_path)
.spawn()?;
if cfg.vpn {
std::thread::spawn(|| {
runas::Command::new("geph5-client")
.arg("-c")
.arg(cfg_path)
.gui(true)
.show(false)
.status()
});
} else {
let mut cmd = std::process::Command::new("geph5-client");

cmd.arg("-c").arg(cfg_path);

#[cfg(windows)]
{
use winapi::um::winbase::CREATE_NO_WINDOW;
cmd.creation_flags(CREATE_NO_WINDOW);
}

cmd.spawn()?;
}
Ok(())
}

Expand Down
10 changes: 9 additions & 1 deletion binaries/geph5-client-gui/src/tabs/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::time::{Duration, Instant};
use egui_plot::{Line, Plot, PlotPoints};
use geph5_client::ConnInfo;
use once_cell::sync::Lazy;
use smol_timeout::TimeoutExt;

use crate::{
daemon::{DAEMON_HANDLE, TOTAL_BYTES_TIMESERIES},
Expand All @@ -26,7 +27,14 @@ impl Dashboard {
let conn_info = self
.conn_info
.get_or_refresh(Duration::from_millis(200), || {
smol::future::block_on(DAEMON_HANDLE.control_client().conn_info()).ok()
smol::future::block_on(
DAEMON_HANDLE
.control_client()
.conn_info()
.timeout(Duration::from_millis(100)),
)
.map(|s| s.ok())
.flatten()
})
.cloned()
.flatten();
Expand Down

0 comments on commit a631a73

Please sign in to comment.