fix: format client --status output as tables instead of raw JSON

Change client get_status() to return StatusInfo struct instead of
serde_json::Value, then render paths, meta plugins, and compression
tables matching the local mode's output style.
This commit is contained in:
2026-03-14 19:25:53 -03:00
parent 886ac98b21
commit 1a942b4d23
2 changed files with 70 additions and 8 deletions

View File

@@ -223,8 +223,15 @@ impl KeepClient {
Ok(())
}
pub fn get_status(&self) -> Result<serde_json::Value, CoreError> {
self.get_json("/api/status")
pub fn get_status(&self) -> Result<crate::common::status::StatusInfo, CoreError> {
#[derive(serde::Deserialize)]
struct ApiResponse {
data: Option<crate::common::status::StatusInfo>,
}
let response: ApiResponse = self.get_json("/api/status")?;
response
.data
.ok_or_else(|| CoreError::Other(anyhow::anyhow!("No status data returned")))
}
pub fn get_item_info(&self, id: i64) -> Result<ItemInfo, CoreError> {