diff --git a/src/pages/websites/domain/index.tsx b/src/pages/websites/domain/index.tsx index ee429eb..62f7e70 100644 --- a/src/pages/websites/domain/index.tsx +++ b/src/pages/websites/domain/index.tsx @@ -1,9 +1,13 @@ import { useTranslation } from '@/i18n.ts' -import { Button, Form, Divider, Space, Tooltip, Badge, Tag, Input } from 'antd' +import { Button, Form, Divider, Space, Tooltip, Badge, Tag, Input, Flex, Select } from 'antd' import { useAtom, useAtomValue } from 'jotai' import { deleteWebsiteDomainAtom, - saveOrUpdateWebsiteDomainAtom, websiteDomainAtom, websiteDomainsAtom, websiteDomainSearchAtom, + saveOrUpdateWebsiteDomainAtom, updateGroupWebsiteDomainAtom, + updateRemarkWebsiteDomainAtom, updateTagWebsiteDomainAtom, + websiteDomainAtom, + websiteDomainsAtom, + websiteDomainSearchAtom, } from '@/store/websites/domain' import { useEffect, useMemo, useState } from 'react' import Action from '@/components/action/Action.tsx' @@ -23,6 +27,9 @@ import { accountStatus, accountStatusColor } from '@/store/websites/dns_account. import Icon from '@/components/icon' import { useDialog } from '@/components/dialog' import { dnsListAtom } from '@/store/websites/dns.ts' +import ModalPro from '@/components/modal-pro' +import { domainGroupsAtom } from '@/store/websites/domain_groups.ts' +import NameServer from '@/pages/websites/domain/components/NameServer.tsx' const i18nPrefix = 'websites.domain.list' @@ -33,9 +40,14 @@ const WebsiteDomain = () => { const [ form ] = Form.useForm() const [ filterForm ] = Form.useForm() const { mutate: saveOrUpdate, isPending: isSubmitting, isSuccess } = useAtomValue(saveOrUpdateWebsiteDomainAtom) + const { mutate: updateRemark } = useAtomValue(updateRemarkWebsiteDomainAtom) + const { mutate: updateTags } = useAtomValue(updateTagWebsiteDomainAtom) + const { mutate: updateGroup } = useAtomValue(updateGroupWebsiteDomainAtom) const [ search, setSearch ] = useAtom(websiteDomainSearchAtom) const [ currentWebsiteDomain, setWebsiteDomain ] = useAtom(websiteDomainAtom) const { data, isFetching, isLoading, refetch } = useAtomValue(websiteDomainsAtom) + const { data: groupData, isFetching: isGroupLoading } = useAtomValue(domainGroupsAtom) + const { mutate: deleteWebsiteDomain, isPending: isDeleting } = useAtomValue(deleteWebsiteDomainAtom) const { data: dnsData } = useAtomValue(dnsListAtom) @@ -54,7 +66,7 @@ const WebsiteDomain = () => { onOk: () => { const id = form.getFieldValue('id') const remark = form.getFieldValue('remark') - return saveOrUpdate({ remark, id } as any) + return updateRemark({ remark, id } as any) } }) @@ -70,6 +82,10 @@ const WebsiteDomain = () => { { title: t(`${i18nPrefix}.columns.name`, '域名'), dataIndex: 'name', + width: 300, + fieldProps: { + style: { width: '100%' } + }, render(_text, record) { const edit = { @@ -77,13 +93,22 @@ const WebsiteDomain = () => { openDialog(record) }} style={{ paddingBlockStart: 0 }} type={'EditTwo'} size={14}/> - return - {record.name} - {edit} - + return + + {record.name} + {edit} + + {record.remark} + } }, { + title: t(`${i18nPrefix}.columns.record_count`, '记录数'), + dataIndex: 'record_count', + hideInForm: true, + hideInSearch: true, + }, + { title: t(`${i18nPrefix}.columns.dns_account_id`, 'DNS账号'), dataIndex: 'dns_account_id', valueType: 'select', @@ -118,8 +143,14 @@ const WebsiteDomain = () => { } }, { - title: t(`${i18nPrefix}.columns.nameservers`, 'nameservers'), + title: t(`${i18nPrefix}.columns.nameservers`, 'DNS服务器地址'), dataIndex: 'nameservers', + width: 150, + hideInSearch: true, + hideInForm: true, + render(_dom, record) { + return + } }, { title: t(`${i18nPrefix}.columns.created`, '创建时间'), @@ -133,12 +164,15 @@ const WebsiteDomain = () => { valueType: 'option', fixed: 'right', render: (_, record) => [ - 解析设置, + + /* { - form.setFieldsValue(record) - setOpen(true) - }}>{t('actions.edit')}, + // form.setFieldsValue(record) + // setOpen(true) + + }}>{t('actions.recordSet', '解析设置')},*/ , { type={'primary'}>{t(`${i18nPrefix}.add`, '添加域名')} } + tableAlertRender={(props) => { + return + 确认删除此域名?
删除域名,解析记录会同步删除,且无法恢复。} + onOk={() => { + deleteWebsiteDomain(props.selectedRows?.map(item => item.id)) + }} + > + +
+ +
+ +