diff --git a/web/src/components/table/channels/ChannelsColumnDefs.js b/web/src/components/table/channels/ChannelsColumnDefs.js
index 18cb5700..06a23024 100644
--- a/web/src/components/table/channels/ChannelsColumnDefs.js
+++ b/web/src/components/table/channels/ChannelsColumnDefs.js
@@ -544,7 +544,7 @@ export const getChannelsColumns = ({
menu={[
{
node: 'item',
- name: t('多key管理'),
+ name: t('多密钥管理'),
onClick: () => {
setCurrentMultiKeyChannel(record);
setShowMultiKeyManageModal(true);
diff --git a/web/src/components/table/channels/modals/MultiKeyManageModal.jsx b/web/src/components/table/channels/modals/MultiKeyManageModal.jsx
index 89ab790f..e185a1b8 100644
--- a/web/src/components/table/channels/modals/MultiKeyManageModal.jsx
+++ b/web/src/components/table/channels/modals/MultiKeyManageModal.jsx
@@ -30,20 +30,17 @@ import {
Popconfirm,
Empty,
Spin,
- Banner,
Select,
- Pagination
+ Row,
+ Col,
+ Badge,
+ Progress,
+ Card
} from '@douyinfe/semi-ui';
-import {
- IconRefresh,
- IconDelete,
- IconClose,
- IconSave,
- IconSetting
-} from '@douyinfe/semi-icons';
+import { IllustrationNoResult, IllustrationNoResultDark } from '@douyinfe/semi-illustrations';
import { API, showError, showSuccess, timestamp2string } from '../../../../helpers/index.js';
-const { Text, Title } = Typography;
+const { Text } = Typography;
const MultiKeyManageModal = ({
visible,
@@ -55,13 +52,13 @@ const MultiKeyManageModal = ({
const [loading, setLoading] = useState(false);
const [keyStatusList, setKeyStatusList] = useState([]);
const [operationLoading, setOperationLoading] = useState({});
-
+
// Pagination states
const [currentPage, setCurrentPage] = useState(1);
- const [pageSize, setPageSize] = useState(50);
+ const [pageSize, setPageSize] = useState(10);
const [total, setTotal] = useState(0);
const [totalPages, setTotalPages] = useState(0);
-
+
// Statistics states
const [enabledCount, setEnabledCount] = useState(0);
const [manualDisabledCount, setManualDisabledCount] = useState(0);
@@ -73,7 +70,7 @@ const MultiKeyManageModal = ({
// Load key status data
const loadKeyStatus = async (page = currentPage, size = pageSize, status = statusFilter) => {
if (!channel?.id) return;
-
+
setLoading(true);
try {
const requestData = {
@@ -82,22 +79,22 @@ const MultiKeyManageModal = ({
page: page,
page_size: size
};
-
+
// Add status filter if specified
if (status !== null) {
requestData.status = status;
}
-
+
const res = await API.post('/api/channel/multi_key/manage', requestData);
-
+
if (res.data.success) {
const data = res.data.data;
setKeyStatusList(data.keys || []);
setTotal(data.total || 0);
setCurrentPage(data.page || 1);
- setPageSize(data.page_size || 50);
+ setPageSize(data.page_size || 10);
setTotalPages(data.total_pages || 0);
-
+
// Update statistics (these are always the overall statistics)
setEnabledCount(data.enabled_count || 0);
setManualDisabledCount(data.manual_disabled_count || 0);
@@ -117,14 +114,14 @@ const MultiKeyManageModal = ({
const handleDisableKey = async (keyIndex) => {
const operationId = `disable_${keyIndex}`;
setOperationLoading(prev => ({ ...prev, [operationId]: true }));
-
+
try {
const res = await API.post('/api/channel/multi_key/manage', {
channel_id: channel.id,
action: 'disable_key',
key_index: keyIndex
});
-
+
if (res.data.success) {
showSuccess(t('密钥已禁用'));
await loadKeyStatus(currentPage, pageSize); // Reload current page
@@ -143,14 +140,14 @@ const MultiKeyManageModal = ({
const handleEnableKey = async (keyIndex) => {
const operationId = `enable_${keyIndex}`;
setOperationLoading(prev => ({ ...prev, [operationId]: true }));
-
+
try {
const res = await API.post('/api/channel/multi_key/manage', {
channel_id: channel.id,
action: 'enable_key',
key_index: keyIndex
});
-
+
if (res.data.success) {
showSuccess(t('密钥已启用'));
await loadKeyStatus(currentPage, pageSize); // Reload current page
@@ -168,13 +165,13 @@ const MultiKeyManageModal = ({
// Enable all disabled keys
const handleEnableAll = async () => {
setOperationLoading(prev => ({ ...prev, enable_all: true }));
-
+
try {
const res = await API.post('/api/channel/multi_key/manage', {
channel_id: channel.id,
action: 'enable_all_keys'
});
-
+
if (res.data.success) {
showSuccess(res.data.message || t('已启用所有密钥'));
// Reset to first page after bulk operation
@@ -194,13 +191,13 @@ const MultiKeyManageModal = ({
// Disable all enabled keys
const handleDisableAll = async () => {
setOperationLoading(prev => ({ ...prev, disable_all: true }));
-
+
try {
const res = await API.post('/api/channel/multi_key/manage', {
channel_id: channel.id,
action: 'disable_all_keys'
});
-
+
if (res.data.success) {
showSuccess(res.data.message || t('已禁用所有密钥'));
// Reset to first page after bulk operation
@@ -220,13 +217,13 @@ const MultiKeyManageModal = ({
// Delete all disabled keys
const handleDeleteDisabledKeys = async () => {
setOperationLoading(prev => ({ ...prev, delete_disabled: true }));
-
+
try {
const res = await API.post('/api/channel/multi_key/manage', {
channel_id: channel.id,
action: 'delete_disabled_keys'
});
-
+
if (res.data.success) {
showSuccess(res.data.message);
// Reset to first page after deletion as data structure might change
@@ -285,17 +282,24 @@ const MultiKeyManageModal = ({
}
}, [visible]);
+ // Percentages for progress display
+ const enabledPercent = total > 0 ? Math.round((enabledCount / total) * 100) : 0;
+ const manualDisabledPercent = total > 0 ? Math.round((manualDisabledCount / total) * 100) : 0;
+ const autoDisabledPercent = total > 0 ? Math.round((autoDisabledCount / total) * 100) : 0;
+
+ // 取消饼图:不再需要图表数据与配置
+
// Get status tag component
const renderStatusTag = (status) => {
switch (status) {
case 1:
- return