form.ejs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <div class="modal-content">
  2. <div class="modal-header">
  3. <h5 class="modal-title"><%- i18n('proxy-hosts', 'form-title', {id: id}) %></h5>
  4. <button type="button" class="close cancel" aria-label="Close" data-dismiss="modal">&nbsp;</button>
  5. </div>
  6. <div class="modal-body has-tabs">
  7. <form>
  8. <ul class="nav nav-tabs" role="tablist">
  9. <li role="presentation" class="nav-item"><a href="#details" aria-controls="tab1" role="tab" data-toggle="tab" class="nav-link active"><i class="fe fe-zap"></i> <%- i18n('all-hosts', 'details') %></a></li>
  10. <li role="presentation" class="nav-item"><a href="#ssl-options" aria-controls="tab2" role="tab" data-toggle="tab" class="nav-link"><i class="fe fe-shield"></i> <%- i18n('str', 'ssl') %></a></li>
  11. </ul>
  12. <div class="tab-content">
  13. <!-- Details -->
  14. <div role="tabpanel" class="tab-pane active" id="details">
  15. <div class="row">
  16. <div class="col-sm-12 col-md-12">
  17. <div class="form-group">
  18. <label class="form-label"><%- i18n('all-hosts', 'domain-names') %> <span class="form-required">*</span></label>
  19. <input type="text" name="domain_names" class="form-control" id="input-domains" value="<%- domain_names.join(',') %>" required>
  20. </div>
  21. </div>
  22. <div class="col-sm-8 col-md-8">
  23. <div class="form-group">
  24. <label class="form-label"><%- i18n('proxy-hosts', 'forward-ip') %><span class="form-required">*</span></label>
  25. <input type="text" name="forward_ip" class="form-control text-monospace" placeholder="000.000.000.000" value="<%- forward_ip %>" autocomplete="off" maxlength="15" required>
  26. </div>
  27. </div>
  28. <div class="col-sm-4 col-md-4">
  29. <div class="form-group">
  30. <label class="form-label"><%- i18n('proxy-hosts', 'forward-port') %> <span class="form-required">*</span></label>
  31. <input name="forward_port" type="number" class="form-control text-monospace" placeholder="80" value="<%- forward_port %>" required>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <!-- SSL -->
  37. <div role="tabpanel" class="tab-pane" id="ssl-options">
  38. <div class="row">
  39. <div class="col-sm-6 col-md-6">
  40. <div class="form-group">
  41. <label class="custom-switch">
  42. <input type="checkbox" class="custom-switch-input" name="ssl_enabled" value="1"<%- ssl_enabled ? ' checked' : '' %>>
  43. <span class="custom-switch-indicator"></span>
  44. <span class="custom-switch-description"><%- i18n('all-hosts', 'enable-ssl') %></span>
  45. </label>
  46. </div>
  47. </div>
  48. <div class="col-sm-6 col-md-6">
  49. <div class="form-group">
  50. <label class="custom-switch">
  51. <input type="checkbox" class="custom-switch-input" name="ssl_forced" value="1"<%- ssl_forced ? ' checked' : '' %><%- ssl_enabled ? '' : ' disabled' %>>
  52. <span class="custom-switch-indicator"></span>
  53. <span class="custom-switch-description"><%- i18n('all-hosts', 'force-ssl') %></span>
  54. </label>
  55. </div>
  56. </div>
  57. <div class="col-sm-12 col-md-12">
  58. <div class="form-group">
  59. <label class="form-label"><%- i18n('all-hosts', 'cert-provider') %></label>
  60. <div class="selectgroup w-100">
  61. <label class="selectgroup-item">
  62. <input type="radio" name="ssl_provider" value="letsencrypt" class="selectgroup-input"<%- ssl_provider !== 'other' ? ' checked' : '' %>>
  63. <span class="selectgroup-button"><%- i18n('ssl', 'letsencrypt') %></span>
  64. </label>
  65. <label class="selectgroup-item">
  66. <input type="radio" name="ssl_provider" value="other" class="selectgroup-input"<%- ssl_provider === 'other' ? ' checked' : '' %>>
  67. <span class="selectgroup-button"><%- i18n('ssl', 'other') %></span>
  68. </label>
  69. </div>
  70. </div>
  71. </div>
  72. <!-- Lets encrypt -->
  73. <div class="col-sm-12 col-md-12 letsencrypt-ssl">
  74. <div class="form-group">
  75. <label class="form-label"><%- i18n('ssl', 'letsencrypt-email') %> <span class="form-required">*</span></label>
  76. <input name="meta[letsencrypt_email]" type="email" class="form-control" placeholder="" value="<%- getLetsencryptEmail() %>" required>
  77. </div>
  78. </div>
  79. <div class="col-sm-12 col-md-12 letsencrypt-ssl">
  80. <div class="form-group">
  81. <label class="custom-switch">
  82. <input type="checkbox" class="custom-switch-input" name="meta[letsencrypt_agree]" value="1" required<%- getLetsencryptAgree() ? ' checked' : '' %>>
  83. <span class="custom-switch-indicator"></span>
  84. <span class="custom-switch-description"><%= i18n('ssl', 'letsencrypt-agree', {url: 'https://letsencrypt.org/repository/'}) %> <span class="form-required">*</span></span>
  85. </label>
  86. </div>
  87. </div>
  88. <!-- Other -->
  89. <div class="col-sm-12 col-md-12 other-ssl">
  90. <div class="form-group">
  91. <div class="form-label"><%- i18n('all-hosts', 'other-certificate') %></div>
  92. <div class="custom-file">
  93. <input type="file" class="custom-file-input" name="meta[other_ssl_certificate]" id="other_ssl_certificate">
  94. <label class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="col-sm-12 col-md-12 other-ssl">
  99. <div class="form-group">
  100. <div class="form-label"><%- i18n('all-hosts', 'other-certificate-key') %></div>
  101. <div class="custom-file">
  102. <input type="file" class="custom-file-input" name="meta[other_ssl_certificate_key]" id="other_ssl_certificate_key">
  103. <label class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </form>
  111. </div>
  112. <div class="modal-footer">
  113. <button type="button" class="btn btn-secondary cancel" data-dismiss="modal"><%- i18n('str', 'cancel') %></button>
  114. <button type="button" class="btn btn-teal save"><%- i18n('str', 'save') %></button>
  115. </div>
  116. </div>