refactor: 优化火山云视频生成界面 - 移除无用字段
界面优化: - 移除【配置】列:火山云API没有配置选项,显示无意义 - 移除【任务描述】字段:对视频生成任务来说不必要 具体修改: - 删除VideoGenerationRecord接口中的description字段 - 删除CreateVideoGenerationRequest接口中的description字段 - 移除表格头部的【配置】列 - 移除表格行中对应的配置信息单元格(分辨率、FPS、时长等) - 移除创建表单中的【任务描述】输入框 - 移除列表显示中的描述文本 - 清理未使用的FileAudio图标导入 用户体验改进: - 界面更简洁,专注于核心功能 - 减少不必要的输入字段 - 表格列数减少,信息更集中 - 符合火山云API的实际功能特性
This commit is contained in:
parent
a858c3791e
commit
a8f720eba2
|
|
@ -235,7 +235,6 @@ impl ConversationRepository {
|
|||
// 使用专用的只读连接,避免与写操作竞争
|
||||
match self.database.try_get_read_connection() {
|
||||
Some(conn) => {
|
||||
println!("✅ 成功获取只读连接");
|
||||
self.execute_history_query(&conn, query)
|
||||
},
|
||||
None => {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ pub async fn get_directory_settings() -> Result<DirectorySettingsResponse, Strin
|
|||
|
||||
match service.get_directory_settings() {
|
||||
Ok(settings) => {
|
||||
info!("成功获取目录设置");
|
||||
Ok(DirectorySettingsResponse::from(settings))
|
||||
}
|
||||
Err(e) => {
|
||||
|
|
@ -70,7 +69,6 @@ pub async fn get_directory_setting(setting_type: String) -> Result<Option<String
|
|||
|
||||
match service.get_directory_setting(setting_type_enum) {
|
||||
Ok(setting) => {
|
||||
info!("成功获取目录设置 {}: {:?}", setting_type, setting);
|
||||
Ok(setting)
|
||||
}
|
||||
Err(e) => {
|
||||
|
|
|
|||
|
|
@ -34,13 +34,11 @@ pub struct SystemVoiceResponse {
|
|||
pub async fn get_system_voices(
|
||||
database: State<'_, Arc<Database>>,
|
||||
) -> Result<Vec<SystemVoice>, 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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -567,13 +567,11 @@ pub async fn get_speech_generation_records(
|
|||
database: State<'_, Arc<Database>>,
|
||||
limit: Option<i32>,
|
||||
) -> Result<Vec<SpeechGenerationRecord>, 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) => {
|
||||
|
|
|
|||
|
|
@ -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<CreateVideoGenerationRequest>({
|
||||
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 = () => {
|
|||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
状态
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
配置
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
创建时间
|
||||
</th>
|
||||
|
|
@ -432,11 +424,6 @@ const VideoGenerationTool: React.FC = () => {
|
|||
<p className="text-sm font-medium text-gray-900 truncate">
|
||||
{record.name}
|
||||
</p>
|
||||
{record.description && (
|
||||
<p className="text-sm text-gray-500 truncate">
|
||||
{record.description}
|
||||
</p>
|
||||
)}
|
||||
<div className="flex items-center space-x-4 mt-1">
|
||||
{record.image_url && (
|
||||
<span className="inline-flex items-center text-xs text-gray-500">
|
||||
|
|
@ -473,13 +460,6 @@ const VideoGenerationTool: React.FC = () => {
|
|||
</p>
|
||||
)}
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||
<div className="space-y-1">
|
||||
<div>{record.resolution}</div>
|
||||
<div>{record.fps} FPS</div>
|
||||
<div>{record.duration}s</div>
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
|
||||
{new Date(record.created_at).toLocaleString()}
|
||||
</td>
|
||||
|
|
@ -554,18 +534,7 @@ const VideoGenerationTool: React.FC = () => {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
任务描述
|
||||
</label>
|
||||
<textarea
|
||||
value={formData.description || ''}
|
||||
onChange={(e) => setFormData(prev => ({ ...prev, description: e.target.value }))}
|
||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||
rows={3}
|
||||
placeholder="请输入任务描述(可选)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{/* 文件上传 */}
|
||||
|
|
|
|||
Loading…
Reference in New Issue