Add session stats to desktop app
This commit is contained in:
parent
857db0caf4
commit
93c53b4285
5 changed files with 17 additions and 3 deletions
|
|
@ -19,6 +19,7 @@ use librqbit::{
|
|||
TorrentListResponse, TorrentStats,
|
||||
},
|
||||
dht::PersistentDhtConfig,
|
||||
session_stats::snapshot::SessionStatsSnapshot,
|
||||
tracing_subscriber_config_utils::{init_logging, InitLoggingOptions, InitLoggingResult},
|
||||
AddTorrent, AddTorrentOptions, Api, ApiError, PeerConnectionOptions, Session, SessionOptions,
|
||||
SessionPersistenceConfig,
|
||||
|
|
@ -318,6 +319,11 @@ async fn torrent_action_configure(
|
|||
.await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
async fn stats(state: tauri::State<'_, State>) -> Result<SessionStatsSnapshot, ApiError> {
|
||||
Ok(state.api()?.api_session_stats())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn get_version() -> &'static str {
|
||||
env!("CARGO_PKG_VERSION")
|
||||
|
|
@ -352,6 +358,7 @@ async fn start() {
|
|||
torrent_action_start,
|
||||
torrent_action_configure,
|
||||
torrent_create_from_base64_file,
|
||||
stats,
|
||||
get_version,
|
||||
config_default,
|
||||
config_current,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue