删除一些未使用的函数

This commit is contained in:
jingrow 2025-11-05 01:48:26 +08:00
parent e35c0b6782
commit 1dffd4194a

View File

@ -1,10 +1,10 @@
import axios from 'axios' import axios from 'axios'
import type { AIAgent, AgentExecutionResult } from '../types' import type { AIAgent } from '../types'
import { deleteRecords, createRecord, updateRecord, getFieldSelectOptions, getRecord } from './common' import { getRecord } from './common'
// 重新导出类型,供其他模块使用 // 重新导出类型,供其他模块使用
export type { AIAgent, AgentExecutionResult } export type { AIAgent }
// 统一使用相对路径,通过 Vite 代理转发到后端 // 统一使用相对路径,通过 Vite 代理转发到后端
@ -73,23 +73,4 @@ export const updateAgentApi = async (name: string, data: Partial<AIAgent>): Prom
console.error("Error in updateAgentApi:", error) console.error("Error in updateAgentApi:", error)
throw new Error(error.response?.data?.message || error.message || '更新AI Agent失败') throw new Error(error.response?.data?.message || error.message || '更新AI Agent失败')
} }
} }
// 创建智能体(使用通用函数)
export const createAgent = async (data: Record<string, any>): Promise<{ success: boolean; data?: any; message?: string }> => {
return createRecord('Local Ai Agent', data)
}
// 更新智能体(使用通用函数)
export const updateAgent = async (name: string, data: Record<string, any>): Promise<{ success: boolean; data?: any; message?: string }> => {
return updateRecord('Local Ai Agent', name, data)
}
// 删除智能体(支持批量删除)
export const deleteAgents = async (names: string[]): Promise<{ success: boolean; message?: string }> => {
return deleteRecords('Local Ai Agent', names)
}
// 获取智能体选项(参考节点实现)
export const getAgentStatusOptions = () => getFieldSelectOptions('Local Ai Agent', 'status')
export const getAgentTriggerModeOptions = () => getFieldSelectOptions('Local Ai Agent', 'trigger_mode')