From a8f720eba29618ae7e0d7d4f70a0afe5749b1cb6 Mon Sep 17 00:00:00 2001 From: imeepos Date: Thu, 31 Jul 2025 13:29:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E7=81=AB?= =?UTF-8?q?=E5=B1=B1=E4=BA=91=E8=A7=86=E9=A2=91=E7=94=9F=E6=88=90=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=20-=20=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 界面优化: - 移除【配置】列:火山云API没有配置选项,显示无意义 - 移除【任务描述】字段:对视频生成任务来说不必要 具体修改: - 删除VideoGenerationRecord接口中的description字段 - 删除CreateVideoGenerationRequest接口中的description字段 - 移除表格头部的【配置】列 - 移除表格行中对应的配置信息单元格(分辨率、FPS、时长等) - 移除创建表单中的【任务描述】输入框 - 移除列表显示中的描述文本 - 清理未使用的FileAudio图标导入 用户体验改进: - 界面更简洁,专注于核心功能 - 减少不必要的输入字段 - 表格列数减少,信息更集中 - 符合火山云API的实际功能特性 --- .../repositories/conversation_repository.rs | 1 - .../commands/directory_settings_commands.rs | 2 -- .../commands/system_voice_commands.rs | 12 ------- .../commands/voice_clone_commands.rs | 3 -- .../src/pages/tools/VideoGenerationTool.tsx | 35 ++----------------- 5 files changed, 2 insertions(+), 51 deletions(-) diff --git a/apps/desktop/src-tauri/src/data/repositories/conversation_repository.rs b/apps/desktop/src-tauri/src/data/repositories/conversation_repository.rs index 6e73777..99371b7 100644 --- a/apps/desktop/src-tauri/src/data/repositories/conversation_repository.rs +++ b/apps/desktop/src-tauri/src/data/repositories/conversation_repository.rs @@ -235,7 +235,6 @@ impl ConversationRepository { // 使用专用的只读连接,避免与写操作竞争 match self.database.try_get_read_connection() { Some(conn) => { - println!("✅ 成功获取只读连接"); self.execute_history_query(&conn, query) }, None => { diff --git a/apps/desktop/src-tauri/src/presentation/commands/directory_settings_commands.rs b/apps/desktop/src-tauri/src/presentation/commands/directory_settings_commands.rs index f95d603..d202654 100644 --- a/apps/desktop/src-tauri/src/presentation/commands/directory_settings_commands.rs +++ b/apps/desktop/src-tauri/src/presentation/commands/directory_settings_commands.rs @@ -50,7 +50,6 @@ pub async fn get_directory_settings() -> Result { - info!("成功获取目录设置"); Ok(DirectorySettingsResponse::from(settings)) } Err(e) => { @@ -70,7 +69,6 @@ pub async fn get_directory_setting(setting_type: String) -> Result { - info!("成功获取目录设置 {}: {:?}", setting_type, setting); Ok(setting) } Err(e) => { diff --git a/apps/desktop/src-tauri/src/presentation/commands/system_voice_commands.rs b/apps/desktop/src-tauri/src/presentation/commands/system_voice_commands.rs index 1a5086a..8946761 100644 --- a/apps/desktop/src-tauri/src/presentation/commands/system_voice_commands.rs +++ b/apps/desktop/src-tauri/src/presentation/commands/system_voice_commands.rs @@ -34,13 +34,11 @@ pub struct SystemVoiceResponse { pub async fn get_system_voices( database: State<'_, Arc>, ) -> Result, String> { - info!("获取系统音色列表"); let repository = SystemVoiceRepository::new(database.inner().clone()); match repository.get_all_active() { Ok(voices) => { - info!("成功获取 {} 个系统音色", voices.len()); Ok(voices) } Err(e) => { @@ -63,7 +61,6 @@ pub async fn get_system_voices_by_type( match repository.get_by_type(voice_type_enum) { Ok(voices) => { - info!("成功获取 {} 个 {} 类型的系统音色", voices.len(), voice_type); Ok(voices) } Err(e) => { @@ -85,7 +82,6 @@ pub async fn get_system_voices_by_gender( match repository.get_by_gender(&gender) { Ok(voices) => { - info!("成功获取 {} 个 {} 性别的系统音色", voices.len(), gender); Ok(voices) } Err(e) => { @@ -107,7 +103,6 @@ pub async fn get_system_voices_by_language( match repository.get_by_language(&language) { Ok(voices) => { - info!("成功获取 {} 个 {} 语言的系统音色", voices.len(), language); Ok(voices) } Err(e) => { @@ -188,7 +183,6 @@ pub async fn get_system_voices_paginated( total_pages, }; - info!("成功获取分页系统音色,页码: {}, 每页: {}, 总数: {}", page, page_size, total); Ok(response) } Err(e) => { @@ -210,11 +204,6 @@ pub async fn get_system_voice_by_id( match repository.get_by_voice_id(&voice_id) { Ok(voice) => { - if voice.is_some() { - info!("成功获取系统音色详情: {}", voice_id); - } else { - info!("未找到系统音色: {}", voice_id); - } Ok(voice) } Err(e) => { @@ -297,6 +286,5 @@ pub async fn get_system_voice_stats( "by_gender": gender_stats }); - info!("成功获取系统音色统计信息"); Ok(stats) } diff --git a/apps/desktop/src-tauri/src/presentation/commands/voice_clone_commands.rs b/apps/desktop/src-tauri/src/presentation/commands/voice_clone_commands.rs index ab4f665..4e087d8 100644 --- a/apps/desktop/src-tauri/src/presentation/commands/voice_clone_commands.rs +++ b/apps/desktop/src-tauri/src/presentation/commands/voice_clone_commands.rs @@ -567,13 +567,11 @@ pub async fn get_speech_generation_records( database: State<'_, Arc>, limit: Option, ) -> Result, String> { - info!("获取语音生成记录列表, limit: {:?}", limit); match database.inner().with_connection(|conn| { SpeechGenerationRecord::get_all(conn, limit) }) { Ok(records) => { - info!("成功获取 {} 条语音生成记录", records.len()); Ok(records) } Err(e) => { @@ -596,7 +594,6 @@ pub async fn get_speech_generation_records_by_voice_id( SpeechGenerationRecord::get_by_voice_id(conn, &voice_id, limit) }) { Ok(records) => { - info!("成功获取音色 {} 的 {} 条语音生成记录", voice_id, records.len()); Ok(records) } Err(e) => { diff --git a/apps/desktop/src/pages/tools/VideoGenerationTool.tsx b/apps/desktop/src/pages/tools/VideoGenerationTool.tsx index da2b7c5..0fcf8ed 100644 --- a/apps/desktop/src/pages/tools/VideoGenerationTool.tsx +++ b/apps/desktop/src/pages/tools/VideoGenerationTool.tsx @@ -12,8 +12,7 @@ import { Image as ImageIcon, Eye, X, - FileVideo, - FileAudio + FileVideo } from 'lucide-react'; import { invoke } from '@tauri-apps/api/core'; import { open } from '@tauri-apps/plugin-dialog'; @@ -23,7 +22,6 @@ import { useNotifications } from '../../components/NotificationSystem'; interface VideoGenerationRecord { id: string; name: string; - description?: string; image_url?: string; audio_url?: string; prompt?: string; @@ -46,7 +44,6 @@ interface VideoGenerationRecord { interface CreateVideoGenerationRequest { name: string; - description?: string; image_url?: string; audio_url?: string; // 实际上是驱动视频URL,复用audio_url字段 // 注意:根据火山云API文档,需要图片和驱动视频两个文件 @@ -71,7 +68,6 @@ const VideoGenerationTool: React.FC = () => { const [isCreating, setIsCreating] = useState(false); const [formData, setFormData] = useState({ name: '', - description: '', image_url: '', audio_url: '', // 驱动视频URL }); @@ -199,7 +195,6 @@ const VideoGenerationTool: React.FC = () => { setShowCreateForm(false); setFormData({ name: '', - description: '', image_url: '', audio_url: '', }); @@ -385,9 +380,6 @@ const VideoGenerationTool: React.FC = () => { 状态 - - 配置 - 创建时间 @@ -432,11 +424,6 @@ const VideoGenerationTool: React.FC = () => {

{record.name}

- {record.description && ( -

- {record.description} -

- )}
{record.image_url && ( @@ -473,13 +460,6 @@ const VideoGenerationTool: React.FC = () => {

)} - -
-
{record.resolution}
-
{record.fps} FPS
-
{record.duration}s
-
- {new Date(record.created_at).toLocaleString()} @@ -554,18 +534,7 @@ const VideoGenerationTool: React.FC = () => { />
-
- -