fix: bug
This commit is contained in:
parent
a56336b63e
commit
f7e72162ad
|
|
@ -12,6 +12,10 @@
|
|||
"core:window:allow-minimize",
|
||||
"core:window:allow-start-dragging",
|
||||
"core:window:allow-toggle-maximize",
|
||||
"core:window:allow-internal-toggle-maximize"
|
||||
"core:window:allow-internal-toggle-maximize",
|
||||
"dialog:default",
|
||||
"dialog:allow-message",
|
||||
"dialog:allow-ask",
|
||||
"dialog:allow-confirm"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use tauri::{command, AppHandle};
|
||||
use crate::python_executor::{execute_python_command, PythonExecutorConfig};
|
||||
use crate::python_executor::execute_python_command;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct CreateCategoryRequest {
|
||||
|
|
@ -94,6 +94,7 @@ pub async fn delete_resource_category(app: AppHandle, category_id: String) -> Re
|
|||
#[command]
|
||||
pub async fn search_resource_categories(app: AppHandle, keyword: String) -> Result<String, String> {
|
||||
let args = vec![
|
||||
"-m".to_string(),
|
||||
"python_core.services.resource_category_manager".to_string(),
|
||||
"search_categories".to_string(),
|
||||
keyword,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useState, useEffect } from 'react'
|
||||
import { Plus, Edit, Trash2, Search, Save, X, Palette } from 'lucide-react'
|
||||
import { Plus, Edit, Trash2, Search, Save, X } from 'lucide-react'
|
||||
import { ResourceCategoryService, ResourceCategory } from '../services/resourceCategoryService'
|
||||
|
||||
const ResourceCategoryPage: React.FC = () => {
|
||||
|
|
@ -49,11 +49,10 @@ const ResourceCategoryPage: React.FC = () => {
|
|||
setShowCreateForm(false)
|
||||
setFormData({ title: '', ai_prompt: '', color: '#FF6B6B' })
|
||||
} else {
|
||||
alert('创建失败: ' + (response.msg || '未知错误'))
|
||||
console.error('创建失败:', response.msg || '未知错误')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to create category:', error)
|
||||
alert('创建失败: ' + (error instanceof Error ? error.message : '未知错误'))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,11 +69,10 @@ const ResourceCategoryPage: React.FC = () => {
|
|||
setEditingCategory(null)
|
||||
setFormData({ title: '', ai_prompt: '', color: '#FF6B6B' })
|
||||
} else {
|
||||
alert('更新失败: ' + (response.msg || '未知错误'))
|
||||
console.error('更新失败:', response.msg || '未知错误')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to update category:', error)
|
||||
alert('更新失败: ' + (error instanceof Error ? error.message : '未知错误'))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -86,11 +84,10 @@ const ResourceCategoryPage: React.FC = () => {
|
|||
if (response.status) {
|
||||
setCategories(categories.filter(cat => cat.id !== categoryId))
|
||||
} else {
|
||||
alert('删除失败: ' + (response.msg || '未知错误'))
|
||||
console.error('删除失败:', response.msg || '未知错误')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to delete category:', error)
|
||||
alert('删除失败: ' + (error instanceof Error ? error.message : '未知错误'))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue