feat: add compression type support to status endpoint
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -3,10 +3,12 @@ use axum::{
|
|||||||
http::StatusCode,
|
http::StatusCode,
|
||||||
response::Json,
|
response::Json,
|
||||||
};
|
};
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
use crate::modes::server::common::{AppState, ApiResponse, StatusInfoResponse};
|
use crate::modes::server::common::{AppState, ApiResponse, StatusInfoResponse};
|
||||||
use crate::common::status::{generate_status_info, StatusInfo};
|
use crate::common::status::{generate_status_info, StatusInfo};
|
||||||
use crate::meta_plugin::MetaPluginType;
|
use crate::meta_plugin::MetaPluginType;
|
||||||
|
use crate::compression_engine::CompressionType;
|
||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
get,
|
get,
|
||||||
@@ -61,10 +63,17 @@ pub async fn handle_status(
|
|||||||
.cloned()
|
.cloned()
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
let enabled_compression_type = if let Some(compression_name) = &state.settings.compression {
|
||||||
|
CompressionType::from_str(compression_name).ok()
|
||||||
|
} else {
|
||||||
|
Some(crate::compression_engine::default_compression_type())
|
||||||
|
};
|
||||||
|
|
||||||
let status_info = generate_status_info(
|
let status_info = generate_status_info(
|
||||||
state.data_dir.clone(),
|
state.data_dir.clone(),
|
||||||
db_path.into(),
|
db_path.into(),
|
||||||
&supported_meta_plugins,
|
&supported_meta_plugins,
|
||||||
|
enabled_compression_type,
|
||||||
);
|
);
|
||||||
|
|
||||||
let response = ApiResponse {
|
let response = ApiResponse {
|
||||||
|
|||||||
Reference in New Issue
Block a user