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