Mountain/IPC/StatusReporter/
mountain_get_ipc_status.rs1use tauri::Manager;
5
6use crate::{IPC::StatusReporter::Reporter::Struct as Reporter, dev_log};
7
8#[tauri::command]
9pub async fn mountain_get_ipc_status(app_handle:tauri::AppHandle) -> Result<serde_json::Value, String> {
10 dev_log!("lifecycle", "Tauri command: get_ipc_status");
11
12 if let Some(reporter) = app_handle.try_state::<Reporter>() {
13 reporter
14 .generate_status_report()
15 .await
16 .map(|report| serde_json::to_value(report).unwrap_or(serde_json::Value::Null))
17 } else {
18 Err("StatusReporter not found in application state".to_string())
19 }
20}