feat(redis): persist command history across sessions (#933)

This commit is contained in:
t8y2 committed 2026-06-10 04:34:45 +08:00
1 parent d08385e75f
commit d0bf6c3b53
15 files changed
+179 -48

No files matched your search

+2 -1
View File
@@ -12,6 +12,7 @@ use crate::state::WebState;
pub struct HistoryQuery {
pub limit: Option<usize>,
pub offset: Option<usize>,
pub activity_kind: Option<String>,
}
#[derive(Deserialize)]
@@ -34,7 +35,7 @@ pub async fn load_history(
) -> Result<Json<Vec<HistoryEntry>>, AppError> {
let limit = q.limit.unwrap_or(100);
let offset = q.offset.unwrap_or(0);
let entries = state.app.storage.load_history_entries(limit, offset).await.map_err(AppError)?;
let entries = state.app.storage.load_history_entries(limit, offset, q.activity_kind).await.map_err(AppError)?;
Ok(Json(entries))
}