修复 antd 弃用警告
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import {
|
||||
Button, Card, Col, Input, InputNumber, message, Popconfirm, Row, Space, Statistic, Switch, Table, Tag, Typography,
|
||||
Button, Card, Col, Input, InputNumber, Popconfirm, Row, Space, Statistic, Switch, Table, Tag, Typography,
|
||||
} from 'antd';
|
||||
import { message } from '../utils/antdMessage';
|
||||
import type { TableProps } from 'antd';
|
||||
import { DownloadOutlined, PlayCircleOutlined, ReloadOutlined, StopOutlined } from '@ant-design/icons';
|
||||
import { accountCheckApi, type AccountCheckBatch, type AccountCheckItem } from '../api/modules';
|
||||
@@ -163,7 +164,7 @@ export default function AccountCheckPage() {
|
||||
return () => window.clearInterval(timer);
|
||||
}, [batchId, isRunning, refreshBatch]);
|
||||
|
||||
const statusCounts = batch?.status_counts || {};
|
||||
const statusCounts = useMemo(() => batch?.status_counts || {}, [batch?.status_counts]);
|
||||
const categoryStats = useMemo(() => [
|
||||
{ title: '已注销', value: statusCounts.account_cancelled || 0 },
|
||||
{ title: '密码错误', value: statusCounts.password_wrong || 0 },
|
||||
@@ -247,11 +248,11 @@ export default function AccountCheckPage() {
|
||||
];
|
||||
|
||||
return (
|
||||
<Space direction="vertical" size={16} style={{ width: '100%' }}>
|
||||
<Space orientation="vertical" size={16} style={{ width: '100%' }}>
|
||||
<Title level={3} style={{ margin: 0 }}>账号检测</Title>
|
||||
|
||||
<Card title="导入账号">
|
||||
<Space direction="vertical" size={12} style={{ width: '100%' }}>
|
||||
<Space orientation="vertical" size={12} style={{ width: '100%' }}>
|
||||
<TextArea
|
||||
rows={9}
|
||||
value={text}
|
||||
@@ -273,28 +274,32 @@ export default function AccountCheckPage() {
|
||||
</Col>
|
||||
<Col xs={8} md={4}>
|
||||
<Text type="secondary">单账号超时</Text>
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={3600}
|
||||
step={30}
|
||||
value={maxTotalTime}
|
||||
onChange={(value) => setMaxTotalTime(Number(value ?? 0))}
|
||||
disabled={isRunning}
|
||||
addonAfter="秒"
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
<Space.Compact style={{ width: '100%' }}>
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={3600}
|
||||
step={30}
|
||||
value={maxTotalTime}
|
||||
onChange={(value) => setMaxTotalTime(Number(value ?? 0))}
|
||||
disabled={isRunning}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
<Button disabled>秒</Button>
|
||||
</Space.Compact>
|
||||
</Col>
|
||||
<Col xs={8} md={4}>
|
||||
<Text type="secondary">重试次数</Text>
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={50}
|
||||
value={maxLoginRetries}
|
||||
onChange={(value) => setMaxLoginRetries(Number(value ?? 0))}
|
||||
disabled={isRunning}
|
||||
addonAfter="次"
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
<Space.Compact style={{ width: '100%' }}>
|
||||
<InputNumber
|
||||
min={0}
|
||||
max={50}
|
||||
value={maxLoginRetries}
|
||||
onChange={(value) => setMaxLoginRetries(Number(value ?? 0))}
|
||||
disabled={isRunning}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
<Button disabled>次</Button>
|
||||
</Space.Compact>
|
||||
</Col>
|
||||
<Col xs={12} md={4}>
|
||||
<Text type="secondary">代理</Text>
|
||||
|
||||
Reference in New Issue
Block a user