form.ejs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <div class="modal-content">
  2. <div class="modal-header">
  3. <h5 class="modal-title"><%- i18n('certificates', 'form-title', {provider: provider}) %></h5>
  4. <button type="button" class="close cancel" aria-label="Close" data-dismiss="modal">&nbsp;</button>
  5. </div>
  6. <div class="modal-body">
  7. <form>
  8. <div class="row">
  9. <% if (provider === 'letsencrypt') { %>
  10. <div class="col-sm-12 col-md-12">
  11. <div class="form-group">
  12. <label class="form-label"><%- i18n('all-hosts', 'domain-names') %> <span class="form-required">*</span></label>
  13. <input type="text" name="domain_names" class="form-control" id="input-domains" value="<%- domain_names.join(',') %>" required>
  14. <div class="text-blue"><i class="fe fe-alert-triangle"></i> <%- i18n('ssl', 'hosts-warning') %></div>
  15. </div>
  16. </div>
  17. <div class="col-sm-12 col-md-12">
  18. <div class="form-group">
  19. <label class="form-label"><%- i18n('ssl', 'letsencrypt-email') %> <span class="form-required">*</span></label>
  20. <input name="meta[letsencrypt_email]" type="email" class="form-control" placeholder="" value="<%- getLetsencryptEmail() %>" required>
  21. </div>
  22. </div>
  23. <!-- DNS challenge -->
  24. <div class="col-sm-12 col-md-12">
  25. <div class="form-group">
  26. <label class="custom-switch">
  27. <input
  28. type="checkbox"
  29. class="custom-switch-input"
  30. name="meta[dns_challenge]"
  31. value="1"
  32. <%- getUseDnsChallenge() ? 'checked' : '' %>
  33. >
  34. <span class="custom-switch-indicator"></span>
  35. <span class="custom-switch-description"><%= i18n('ssl', 'dns-challenge') %></span>
  36. </label>
  37. </div>
  38. </div>
  39. <div class="col-sm-12 col-md-12">
  40. <fieldset class="form-fieldset dns-challenge">
  41. <div class="text-red mb-4"><i class="fe fe-alert-triangle"></i> <%= i18n('ssl', 'certbot-warning') %></div>
  42. <!-- Certbot DNS plugin selection -->
  43. <div class="row">
  44. <div class="col-sm-12 col-md-12">
  45. <div class="form-group">
  46. <label class="form-label"><%- i18n('ssl', 'dns-provider') %> <span class="form-required">*</span></label>
  47. <select
  48. name="meta[dns_provider]"
  49. id="dns_provider"
  50. class="form-control custom-select"
  51. >
  52. <option
  53. value=""
  54. disabled
  55. hidden
  56. <%- getDnsProvider() === null ? 'selected' : '' %>
  57. >Please Choose...</option>
  58. <% _.each(dns_plugins, function(plugin_info, plugin_name){ %>
  59. <option
  60. value="<%- plugin_name %>"
  61. <%- getDnsProvider() === plugin_name ? 'selected' : '' %>
  62. ><%- plugin_info.display_name %></option>
  63. <% }); %>
  64. </select>
  65. </div>
  66. </div>
  67. </div>
  68. <!-- Certbot credentials file content -->
  69. <div class="row credentials-file-content">
  70. <div class="col-sm-12 col-md-12">
  71. <div class="form-group">
  72. <label class="form-label"><%- i18n('ssl', 'credentials-file-content') %> <span class="form-required">*</span></label>
  73. <textarea
  74. name="meta[dns_provider_credentials]"
  75. class="form-control text-monospace"
  76. id="dns_provider_credentials"
  77. ><%- getDnsProviderCredentials() %></textarea>
  78. <div class="text-secondary small">
  79. <i class="fe fe-info"></i>
  80. <%= i18n('ssl', 'credentials-file-content-info') %>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- DNS propagation delay -->
  86. <div class="row">
  87. <div class="col-sm-12 col-md-12">
  88. <div class="form-group mb-0">
  89. <label class="form-label"><%- i18n('ssl', 'propagation-seconds') %></label>
  90. <input
  91. type="number"
  92. min="0"
  93. name="meta[propagation_seconds]"
  94. class="form-control"
  95. id="propagation_seconds"
  96. value="<%- getPropagationSeconds() %>"
  97. >
  98. <div class="text-secondary small">
  99. <i class="fe fe-info"></i>
  100. <%= i18n('ssl', 'propagation-seconds-info') %>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </fieldset>
  106. </div>
  107. <div class="col-sm-12 col-md-12">
  108. <div class="form-group">
  109. <label class="custom-switch">
  110. <input type="checkbox" class="custom-switch-input" name="meta[letsencrypt_agree]" value="1" required<%- getLetsencryptAgree() ? ' checked' : '' %>>
  111. <span class="custom-switch-indicator"></span>
  112. <span class="custom-switch-description"><%= i18n('ssl', 'letsencrypt-agree', {url: 'https://letsencrypt.org/repository/'}) %> <span class="form-required">*</span></span>
  113. </label>
  114. </div>
  115. </div>
  116. <% } else if (provider === 'other') { %>
  117. <!-- Other -->
  118. <div class="col-sm-12 col-md-12">
  119. <div class="form-group">
  120. <label class="form-label"><%- i18n('str', 'name') %> <span class="form-required">*</span></label>
  121. <input name="nice_name" type="text" class="form-control" placeholder="" value="<%- nice_name %>" required>
  122. </div>
  123. </div>
  124. <div class="col-sm-12 col-md-12 other-ssl">
  125. <div class="form-group">
  126. <div class="form-label"><%- i18n('certificates', 'other-certificate-key') %><span class="form-required">*</span></div>
  127. <div class="custom-file">
  128. <input type="file" class="custom-file-input" name="meta[other_certificate_key]" id="other_certificate_key" required>
  129. <label id="other_certificate_key_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  130. </div>
  131. </div>
  132. </div>
  133. <div class="col-sm-12 col-md-12 other-ssl">
  134. <div class="form-group">
  135. <div class="form-label"><%- i18n('certificates', 'other-certificate') %><span class="form-required">*</span></div>
  136. <div class="custom-file">
  137. <input type="file" class="custom-file-input" name="meta[other_certificate]" id="other_certificate">
  138. <label id="other_certificate_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="col-sm-12 col-md-12 other-ssl">
  143. <div class="form-group">
  144. <div class="form-label"><%- i18n('certificates', 'other-intermediate-certificate') %></div>
  145. <div class="custom-file">
  146. <input type="file" class="custom-file-input" name="meta[other_intermediate_certificate]" id="other_intermediate_certificate">
  147. <label id="other_intermediate_certificate_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  148. </div>
  149. </div>
  150. </div>
  151. <% } %>
  152. </div>
  153. </form>
  154. </div>
  155. <div class="modal-footer">
  156. <button type="button" class="btn btn-secondary cancel" data-dismiss="modal"><%- i18n('str', 'cancel') %></button>
  157. <button type="button" class="btn btn-teal save"><%- i18n('str', 'save') %></button>
  158. </div>
  159. </div>