|
|
@ -10,7 +10,7 @@ import { |
|
|
|
dnsPageAtom, |
|
|
|
DNSTypeEnum, |
|
|
|
DNSTypes, |
|
|
|
saveOrUpdateDNSAtom |
|
|
|
saveOrUpdateDNSAtom, syncDNSAtom |
|
|
|
} from '@/store/websites/dns.ts' |
|
|
|
import { WebSite } from '@/types' |
|
|
|
|
|
|
@ -154,6 +154,7 @@ const DNSList = () => { |
|
|
|
const { data, isLoading, isFetching, refetch } = useAtomValue(dnsListAtom) |
|
|
|
const { mutate: saveOrUpdate, isPending: isSubmitting, isSuccess } = useAtomValue(saveOrUpdateDNSAtom) |
|
|
|
const { mutate: deleteDNS, isPending: isDeleting } = useAtomValue(deleteDNSAtom) |
|
|
|
const { mutate: asyncDNS, isPending: isAsyncing } = useAtomValue(syncDNSAtom) |
|
|
|
const [ open, setOpen ] = useState(false) |
|
|
|
|
|
|
|
const columns = useMemo<ProColumns<WebSite.IDnsAccount>[]>(() => { |
|
|
@ -206,13 +207,20 @@ const DNSList = () => { |
|
|
|
return [ |
|
|
|
<Action key="edit" |
|
|
|
as={'a'} |
|
|
|
disabled={record.status === 2} |
|
|
|
onClick={() => { |
|
|
|
form.setFieldsValue(record) |
|
|
|
setOpen(true) |
|
|
|
}}>{t('actions.edit')}</Action>, |
|
|
|
<Action key="sync" |
|
|
|
as={'a'} |
|
|
|
disabled={isAsyncing || record.status === 2} |
|
|
|
onClick={() => { |
|
|
|
asyncDNS(record) |
|
|
|
}}>{t('actions.sync', '同步')}</Action>, |
|
|
|
<Popconfirm |
|
|
|
key={'del_confirm'} |
|
|
|
disabled={isDeleting} |
|
|
|
disabled={isDeleting || record.status === 2} |
|
|
|
onConfirm={() => { |
|
|
|
deleteDNS(record.id) |
|
|
|
}} |
|
|
@ -245,6 +253,7 @@ const DNSList = () => { |
|
|
|
headerTitle={ |
|
|
|
<Button |
|
|
|
onClick={() => { |
|
|
|
form.resetFields() |
|
|
|
form.setFieldsValue({ |
|
|
|
id: 0, |
|
|
|
type: DNSTypeEnum.DnsPod, |
|
|
|