diff --git a/src/pages/AiGateway.tsx b/src/pages/AiGateway.tsx index afc0405..c4cf967 100644 --- a/src/pages/AiGateway.tsx +++ b/src/pages/AiGateway.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query' -import { Card, Row, Col, Statistic, Table, Tag, Button, Typography, Tabs, Modal, Form, Input, InputNumber, Select, Switch, Space, App } from 'antd' -import { ReloadOutlined, CloudOutlined, PlusOutlined, EditOutlined, DeleteOutlined, StopOutlined, CheckCircleOutlined } from '@ant-design/icons' +import { Card, Row, Col, Statistic, Table, Tag, Button, Typography, Tabs, Modal, Form, Input, InputNumber, Select, Switch, App } from 'antd' +import { ReloadOutlined, CloudOutlined, PlusOutlined, DeleteOutlined } from '@ant-design/icons' import { api } from '@/services/http-client' const { Title, Text } = Typography diff --git a/src/pages/Events.tsx b/src/pages/Events.tsx index 859828a..3325afb 100644 --- a/src/pages/Events.tsx +++ b/src/pages/Events.tsx @@ -33,7 +33,7 @@ function EventsPage() { const { data: failed } = useQuery({ queryKey: ['events', 'failed', selectedQueue], - queryFn: () => selectedQueue ? api.get(`/admin-api/events/${selectedQueue}/failed`) : null, + queryFn: (): Promise => selectedQueue ? api.get(`/admin-api/events/${selectedQueue}/failed`) : Promise.resolve(null), enabled: !!selectedQueue, }) @@ -44,8 +44,8 @@ function EventsPage() { } const handleBatchRetry = async (queue: string) => { - const res = await api.post(`/admin-api/events/${queue}/jobs/batch-retry`, { count: 50 }) - message.success(`批量重试完成: ${res.data?.retried || 0}/${res.data?.total || 0}`) + const res: any = await api.post(`/admin-api/events/${queue}/jobs/batch-retry`, { count: 50 }) + message.success(`批量重试完成: ${res?.data?.retried || 0}/${res?.data?.total || 0}`) qc.invalidateQueries({ queryKey: ['events'] }) }