fix: imports + types
Some checks failed
Deploy Admin Frontend / build-and-deploy (push) Failing after 5s
Some checks failed
Deploy Admin Frontend / build-and-deploy (push) Failing after 5s
This commit is contained in:
parent
2413cdf561
commit
bf907196d0
@ -14,6 +14,8 @@ const KnowledgeBasesPage = lazy(() => import('./pages/KnowledgeBases'))
|
|||||||
const BillingPage = lazy(() => import('./pages/Billing'))
|
const BillingPage = lazy(() => import('./pages/Billing'))
|
||||||
const GiteaEmbed = lazy(() => import('./pages/GiteaEmbed'))
|
const GiteaEmbed = lazy(() => import('./pages/GiteaEmbed'))
|
||||||
const ConfigPage = lazy(() => import("./pages/Config"))
|
const ConfigPage = lazy(() => import("./pages/Config"))
|
||||||
|
const CSPage = lazy(() => import("./pages/ContentSafety"))
|
||||||
|
const MetricsPage = lazy(() => import("./pages/Metrics"))
|
||||||
const EventsPage = lazy(() => import("./pages/Events"))
|
const EventsPage = lazy(() => import("./pages/Events"))
|
||||||
const ServersPage = lazy(() => import("./pages/Servers"))
|
const ServersPage = lazy(() => import("./pages/Servers"))
|
||||||
const AuditLogPage = lazy(() => import("./pages/AuditLog"))
|
const AuditLogPage = lazy(() => import("./pages/AuditLog"))
|
||||||
|
|||||||
@ -15,8 +15,8 @@ function CSPage() {
|
|||||||
const [category, setCategory] = useState('general')
|
const [category, setCategory] = useState('general')
|
||||||
const [risk, setRisk] = useState('medium')
|
const [risk, setRisk] = useState('medium')
|
||||||
|
|
||||||
const { data: words } = useQuery({ queryKey: ['safety', 'words'], queryFn: () => api.get('/admin-api/content-safety/words') })
|
const { data: words } = useQuery({ queryKey: ['safety', 'words'], queryFn: (): Promise<any> => api.get('/admin-api/content-safety/words') })
|
||||||
const { data: checks } = useQuery({ queryKey: ['safety', 'checks'], queryFn: () => api.get('/admin-api/content-safety/checks') })
|
const { data: checks } = useQuery({ queryKey: ['safety', 'checks'], queryFn: (): Promise<any> => api.get('/admin-api/content-safety/checks') })
|
||||||
|
|
||||||
const addWord = async () => {
|
const addWord = async () => {
|
||||||
await api.post('/admin-api/content-safety/words', { word: newWord, category, riskLevel: risk })
|
await api.post('/admin-api/content-safety/words', { word: newWord, category, riskLevel: risk })
|
||||||
|
|||||||
@ -9,9 +9,9 @@ const { Title } = Typography
|
|||||||
function MetricsPage() {
|
function MetricsPage() {
|
||||||
const qc = useQueryClient()
|
const qc = useQueryClient()
|
||||||
|
|
||||||
const { data: overview } = useQuery({ queryKey: ['metrics', 'overview'], queryFn: () => api.get('/admin-api/metrics/overview'), staleTime: 10_000 })
|
const { data: overview } = useQuery({ queryKey: ['metrics', 'overview'], queryFn: (): Promise<any> => api.get('/admin-api/metrics/overview'), staleTime: 10_000 })
|
||||||
const { data: top } = useQuery({ queryKey: ['metrics', 'top'], queryFn: () => api.get('/admin-api/metrics/top?limit=15'), staleTime: 10_000 })
|
const { data: top } = useQuery({ queryKey: ['metrics', 'top'], queryFn: (): Promise<any> => api.get('/admin-api/metrics/top?limit=15'), staleTime: 10_000 })
|
||||||
const { data: recent } = useQuery({ queryKey: ['metrics', 'recent'], queryFn: () => api.get('/admin-api/metrics/recent?limit=30'), staleTime: 5_000 })
|
const { data: recent } = useQuery({ queryKey: ['metrics', 'recent'], queryFn: (): Promise<any> => api.get('/admin-api/metrics/recent?limit=30'), staleTime: 5_000 })
|
||||||
|
|
||||||
const topCols = [
|
const topCols = [
|
||||||
{ title: '接口', dataIndex: 'path', width: 300, ellipsis: true },
|
{ title: '接口', dataIndex: 'path', width: 300, ellipsis: true },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user