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