windows/mac tray tooltip show controlled session count

* ubuntu 22.04 can't see tooltip

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2023-09-09 09:45:05 +08:00
parent 45b0e7dc01
commit c254eebea2
37 changed files with 135 additions and 14 deletions

View File

@@ -234,6 +234,8 @@ pub enum Data {
#[cfg(windows)]
SyncWinCpuUsage(Option<f64>),
FileTransferLog(String),
#[cfg(any(windows, target_os = "macos"))]
ControlledSessionCount(usize),
}
#[tokio::main(flavor = "current_thread")]
@@ -482,6 +484,16 @@ async fn handle(data: Data, stream: &mut Connection) {
#[cfg(all(feature = "flutter", feature = "plugin_framework"))]
#[cfg(not(any(target_os = "android", target_os = "ios")))]
Data::Plugin(plugin) => crate::plugin::ipc::handle_plugin(plugin, stream).await,
#[cfg(any(windows, target_os = "macos"))]
Data::ControlledSessionCount(_) => {
allow_err!(
stream
.send(&Data::ControlledSessionCount(
crate::Connection::alive_conns().len()
))
.await
);
}
_ => {}
}
}