DNSCredential.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <script setup lang="tsx">
  2. import type { CustomRenderProps } from '@/components/StdDesign/StdDataDisplay/StdTableTransformer'
  3. import type { Column } from '@/components/StdDesign/types'
  4. import dns_credential from '@/api/dns_credential'
  5. import StdCurd from '@/components/StdDesign/StdDataDisplay/StdCurd.vue'
  6. import { datetime } from '@/components/StdDesign/StdDataDisplay/StdTableTransformer'
  7. import { input } from '@/components/StdDesign/StdDataEntry'
  8. import DNSChallenge from './DNSChallenge.vue'
  9. const columns: Column[] = [{
  10. title: () => $gettext('Name'),
  11. dataIndex: 'name',
  12. sorter: true,
  13. pithy: true,
  14. edit: {
  15. type: input,
  16. },
  17. }, {
  18. title: () => $gettext('Provider'),
  19. dataIndex: ['config', 'name'],
  20. customRender: (args: CustomRenderProps) => {
  21. return args.record.provider
  22. },
  23. sorter: true,
  24. pithy: true,
  25. }, {
  26. title: () => $gettext('Updated at'),
  27. dataIndex: 'updated_at',
  28. customRender: datetime,
  29. sorter: true,
  30. pithy: true,
  31. }, {
  32. title: () => $gettext('Action'),
  33. dataIndex: 'action',
  34. }]
  35. </script>
  36. <template>
  37. <StdCurd
  38. :title="$gettext('DNS Credentials')"
  39. :api="dns_credential"
  40. :columns="columns"
  41. >
  42. <template #beforeEdit>
  43. <AAlert
  44. class="mb-4"
  45. type="info"
  46. show-icon
  47. :message="$gettext('Note')"
  48. >
  49. <template #description>
  50. <p>
  51. {{ $gettext('Please fill in the API authentication credentials provided by your DNS provider.') }}
  52. </p>
  53. <p>
  54. {{ $gettext('We will add one or more TXT records to the DNS records of your domain for ownership verification.') }}
  55. </p>
  56. <p>
  57. {{ $gettext('Once the verification is complete, the records will be removed.') }}
  58. </p>
  59. <p>
  60. {{ $gettext('Please note that the unit of time configurations below are all in seconds.') }}
  61. </p>
  62. </template>
  63. </AAlert>
  64. </template>
  65. <template #edit>
  66. <DNSChallenge />
  67. </template>
  68. </StdCurd>
  69. </template>
  70. <style lang="less" scoped>
  71. </style>