fix: 添加Serde序列化支持以修复Tauri IPC错误

- 为 comfyui_sdk::ValidationResult 和 ValidationError 添加序列化支持
- 为 ConfigStats 和 Environment 类型添加序列化支持
- 为 ExecutionStats、MonitorStats、CacheStats 添加序列化支持
- 修复 Tauri 命令返回类型不满足 IpcResponse trait 的问题
This commit is contained in:
imeepos 2025-08-08 15:02:41 +08:00
parent 8223061aea
commit eb81f106dd
4 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ use crate::config::{AppConfig, ComfyUISettings};
use crate::data::models::comfyui::{ComfyUIConfig, ValidationResult};
/// 环境类型
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum Environment {
/// 开发环境
Development,
@ -285,7 +285,7 @@ impl ConfigManager {
}
/// 配置统计信息
#[derive(Debug, Clone)]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ConfigStats {
pub environment: Environment,
pub config_path: Option<String>,

View File

@ -368,7 +368,7 @@ impl ExecutionEngine {
}
/// 执行统计信息
#[derive(Debug, Clone)]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ExecutionStats {
pub running_count: usize,
pub running_executions: Vec<String>,

View File

@ -444,7 +444,7 @@ impl RealtimeMonitor {
}
/// 监控统计信息
#[derive(Debug, Clone)]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct MonitorStats {
pub is_running: bool,
pub websocket_connected: bool,

View File

@ -294,7 +294,7 @@ impl TemplateEngine {
}
/// 缓存统计信息
#[derive(Debug, Clone)]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct CacheStats {
pub cached_templates: usize,
pub cache_keys: Vec<String>,