AutoCertStepOne.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <script setup lang="ts">
  2. import { useGettext } from 'vue3-gettext'
  3. import type { Ref } from 'vue'
  4. import type { DnsChallenge } from '@/api/auto_cert'
  5. import DNSChallenge from '@/views/domain/cert/components/DNSChallenge.vue'
  6. defineProps<{
  7. hideNote?: boolean
  8. }>()
  9. const { $gettext } = useGettext()
  10. const no_server_name = inject('no_server_name')
  11. // Provide by ObtainCert.vue
  12. const data = inject('data') as Ref<DnsChallenge>
  13. </script>
  14. <template>
  15. <div>
  16. <template v-if="no_server_name">
  17. <AAlert
  18. :message="$gettext('Warning')"
  19. type="warning"
  20. show-icon
  21. >
  22. <template #description>
  23. <span v-if="no_server_name">
  24. {{ $gettext('server_name parameter is required') }}
  25. </span>
  26. </template>
  27. </AAlert>
  28. <br>
  29. </template>
  30. <AAlert
  31. v-if="!hideNote"
  32. type="info"
  33. show-icon
  34. :message="$gettext('Note')"
  35. class="mb-4"
  36. >
  37. <template #description>
  38. <p>
  39. {{ $gettext('The server_name'
  40. + ' in the current configuration must be the domain name you need to get the certificate, support'
  41. + 'multiple domains.') }}
  42. </p>
  43. <p>
  44. {{ $gettext('The certificate for the domain will be checked 5 minutes, '
  45. + 'and will be renewed if it has been more than 1 week since it was last issued.') }}
  46. </p>
  47. <p v-if="data.challenge_method === 'http01'">
  48. {{ $gettext('Make sure you have configured a reverse proxy for .well-known '
  49. + 'directory to HTTPChallengePort before obtaining the certificate.') }}
  50. </p>
  51. <p v-else-if="data.challenge_method === 'dns01'">
  52. {{ $gettext('Please first add credentials in Certification > DNS Credentials, '
  53. + 'and then select one of the credentials'
  54. + 'below to request the API of the DNS provider.') }}
  55. </p>
  56. </template>
  57. </AAlert>
  58. <AForm layout="vertical">
  59. <AFormItem :label="$gettext('Challenge Method')">
  60. <ASelect v-model:value="data.challenge_method">
  61. <ASelectOption value="http01">
  62. {{ $gettext('HTTP01') }}
  63. </ASelectOption>
  64. <ASelectOption value="dns01">
  65. {{ $gettext('DNS01') }}
  66. </ASelectOption>
  67. </ASelect>
  68. </AFormItem>
  69. </AForm>
  70. <DNSChallenge v-if="data.challenge_method === 'dns01'" />
  71. </div>
  72. </template>
  73. <style lang="less" scoped>
  74. </style>