From 69a6c3b4536ededa32efd2476af30b15c31d88d5 Mon Sep 17 00:00:00 2001 From: dushixiang Date: Sat, 7 Feb 2026 16:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20DDNS=20=E7=9A=84=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=93=8D=E4=BD=9C=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/admin/pages/DDNS/index.tsx | 110 +++++++++++++++-------------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/web/src/admin/pages/DDNS/index.tsx b/web/src/admin/pages/DDNS/index.tsx index 16d62fa..19c95eb 100644 --- a/web/src/admin/pages/DDNS/index.tsx +++ b/web/src/admin/pages/DDNS/index.tsx @@ -1,9 +1,10 @@ import {useEffect, useState} from 'react'; import {useSearchParams} from 'react-router-dom'; -import {App, Button, Divider, Input, Space, Table, Tag, Tooltip} from 'antd'; +import {App, Button, Divider, Dropdown, Input, Space, Table, Tag, Tooltip} from 'antd'; import type {ColumnsType} from 'antd/es/table'; +import type {MenuProps} from 'antd'; import {PageHeader} from '@admin/components'; -import {Globe, Plus, Settings} from 'lucide-react'; +import {Globe, MoreVertical, Plus, Settings} from 'lucide-react'; import dayjs from 'dayjs'; import type {DDNSConfig} from '@/types'; import {deleteDDNSConfig, disableDDNSConfig, enableDDNSConfig, getDDNSConfigs, triggerDDNSUpdate,} from '@/api/ddns'; @@ -205,56 +206,61 @@ const DDNSPage = () => { { title: '操作', key: 'action', - width: 240, - render: (_, record) => [ - , - , - , - , - , - ], + width: 150, + fixed: 'right', + render: (_, record) => { + const menuItems: MenuProps['items'] = [ + { + key: 'records', + label: '查看记录', + onClick: () => handleViewRecords(record), + }, + { + key: 'trigger', + label: '触发更新', + onClick: () => handleTrigger(record), + disabled: !record.enabled, + }, + { + key: 'toggle', + label: record.enabled ? '禁用' : '启用', + onClick: () => handleToggleStatus(record), + }, + { + key: 'edit', + label: '编辑', + onClick: () => handleUpdate(record), + }, + { + type: 'divider', + }, + { + key: 'delete', + label: '删除', + danger: true, + onClick: () => handleDelete(record), + }, + ]; + + return ( + + + +