chore: 提交所有工作进度 — SaaS 后端增强、Admin UI、桌面端集成
包含大量 SaaS 平台改进、Admin 管理后台更新、桌面端集成完善、 文档同步、测试文件重构等内容。为 QA 测试准备干净工作树。
This commit is contained in:
@@ -392,7 +392,8 @@ pub async fn viking_remove(uri: String) -> Result<(), String> {
|
||||
|
||||
/// Get memory tree
|
||||
#[tauri::command]
|
||||
pub async fn viking_tree(path: String, _depth: Option<usize>) -> Result<serde_json::Value, String> {
|
||||
pub async fn viking_tree(path: String, depth: Option<usize>) -> Result<serde_json::Value, String> {
|
||||
let max_depth = depth.unwrap_or(5);
|
||||
let storage = get_storage().await?;
|
||||
|
||||
let entries = storage
|
||||
@@ -405,9 +406,13 @@ pub async fn viking_tree(path: String, _depth: Option<usize>) -> Result<serde_js
|
||||
|
||||
for entry in entries {
|
||||
let parts: Vec<&str> = entry.uri.split('/').collect();
|
||||
let level = parts.len().saturating_sub(1);
|
||||
if level > max_depth {
|
||||
continue;
|
||||
}
|
||||
let mut current = &mut tree;
|
||||
|
||||
for part in &parts[..parts.len().saturating_sub(1)] {
|
||||
for part in &parts[..level] {
|
||||
if !current.contains_key(*part) {
|
||||
current.insert(
|
||||
(*part).to_string(),
|
||||
|
||||
Reference in New Issue
Block a user