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:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user