Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/api-gateway/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ func main() {
StripPrefix: false,
Timeout: 60,
},
{
// 工具管理 API - 列表、创建、详情、更新、删除
Path: "/api/tools",
ServiceName: "agent-service",
StripPrefix: false,
Timeout: 10,
},
}
proxyManager.LoadRoutes(routes)

Expand Down
74 changes: 0 additions & 74 deletions apps/web/prisma/schema.prisma

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@ import {
Badge,
} from '@/components/atoms'
import { agentService, type Agent } from '@/service/agent'
import { Edit2, Trash2, Sparkles, Lock, Globe, Bot } from 'lucide-react'
import {
Edit2,
Trash2,
Sparkles,
Lock,
Globe,
Bot,
Settings,
} from 'lucide-react'
import { toast } from 'sonner'
import { cn } from '@/lib/utils'
import { formatDistanceToNow } from 'date-fns'
import { ConfigureToolsModal } from './ConfigureToolsModal'

interface AgentCardProps {
agent: Agent
Expand All @@ -33,6 +42,7 @@ interface AgentCardProps {
export function AgentCard({ agent, onUpdate }: AgentCardProps) {
const t = useTranslations('Agent')
const [showDeleteDialog, setShowDeleteDialog] = useState(false)
const [showToolsModal, setShowToolsModal] = useState(false)
const [isDeleting, setIsDeleting] = useState(false)

const handleDelete = async () => {
Expand Down Expand Up @@ -134,6 +144,15 @@ export function AgentCard({ agent, onUpdate }: AgentCardProps) {

{/* Actions */}
<div className='flex gap-2 pt-2 border-t'>
<Button
variant='outline'
size='sm'
className='flex-1 gap-1'
onClick={() => setShowToolsModal(true)}
>
<Settings className='size-3' />
{t('configureTools')}
</Button>
{canEdit && (
<Button
variant='outline'
Expand Down Expand Up @@ -168,6 +187,19 @@ export function AgentCard({ agent, onUpdate }: AgentCardProps) {
</CardContent>
</Card>

{/* Configure Tools Modal */}
{showToolsModal && (
<ConfigureToolsModal
agentId={agent.id}
agentName={agent.name}
onClose={() => setShowToolsModal(false)}
onSuccess={() => {
onUpdate()
setShowToolsModal(false)
}}
/>
)}

{/* Delete Confirmation Dialog */}
<AlertDialog open={showDeleteDialog} onOpenChange={setShowDeleteDialog}>
<AlertDialogContent>
Expand Down
Loading
Loading