mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
refactor: align dependencies and centralize GUI activation
This commit is contained in:
7 files changed
+145
-155
No files matched your search
@@ -29,6 +29,18 @@ pub struct DesktopLauncher<'a> {
|
||||
}
|
||||
|
||||
impl<'a> DesktopLauncher<'a> {
|
||||
/// Bring an already-running GUI to the foreground through its service.
|
||||
pub async fn activate_existing() -> anyhow::Result<()> {
|
||||
let endpoint = crate::utils::endpoint::http_endpoint().await?;
|
||||
crate::utils::request::client_builder()
|
||||
.build()?
|
||||
.post(format!("{endpoint}/active-gui"))
|
||||
.send()
|
||||
.await?
|
||||
.error_for_status()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn new(version: &'a str) -> Self {
|
||||
Self {
|
||||
version,
|
||||
|
||||
Reference in new issue
Block a user