request via cloudflare dns working

This commit is contained in:
Jaap-Jan de Wit
2020-08-23 12:50:41 +00:00
parent b9a95840e0
commit ff1770204c
4 changed files with 55 additions and 4 deletions

View File

@ -25,7 +25,7 @@
<div class="col-sm-12 col-md-12">
<div class="form-group">
<label class="custom-switch">
<input type="checkbox" class="custom-switch-input" name="use_cloudflare" value="1">
<input type="checkbox" class="custom-switch-input" name="meta[cloudflare_use]" value="1">
<span class="custom-switch-indicator"></span>
<span class="custom-switch-description"><%= i18n('ssl', 'use-cloudflare') %></span>
</label>
@ -34,7 +34,7 @@
<div class="col-sm-12 col-md-12 cloudflare">
<div class="form-group">
<label class="form-label">CloudFlare DNS API Token <span class="form-required">*</span></label>
<input type="text" name="cloudflare_dns_api_token" class="form-control" id="input-domains" required>
<input type="text" name="meta[cloudflare_token]" class="form-control" id="cloudflare_token" required>
</div>
</div>

View File

@ -21,7 +21,7 @@ module.exports = Mn.View.extend({
other_certificate: '#other_certificate',
other_certificate_key: '#other_certificate_key',
other_intermediate_certificate: '#other_intermediate_certificate',
cloudflare_switch: 'input[name="use_cloudflare"]',
cloudflare_switch: 'input[name="meta[cloudflare_use]"]',
cloudflare: '.cloudflare'
},
@ -50,6 +50,9 @@ module.exports = Mn.View.extend({
if (typeof data.meta !== 'undefined' && typeof data.meta.letsencrypt_agree !== 'undefined') {
data.meta.letsencrypt_agree = !!data.meta.letsencrypt_agree;
}
if (typeof data.meta !== 'undefined' && typeof data.meta.cloudflare_use !== 'undefined') {
data.meta.cloudflare_use = !!data.meta.cloudflare_use;
}
if (typeof data.domain_names === 'string' && data.domain_names) {
data.domain_names = data.domain_names.split(',');
@ -140,6 +143,10 @@ module.exports = Mn.View.extend({
getLetsencryptAgree: function () {
return typeof this.meta.letsencrypt_agree !== 'undefined' ? this.meta.letsencrypt_agree : false;
},
getCloudflareUse: function () {
return typeof this.meta.cloudflare_use !== 'undefined' ? this.meta.cloudflare_use : false;
}
},