Skip to content

Commit 2c5eac9

Browse files
committed
Merge branch 'master' of github.com:jc21/nginx-proxy-manager into develop
2 parents 87f61b8 + 74bfe49 commit 2c5eac9

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

frontend/js/app/nginx/certificates/form.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<div class="form-label"><%- i18n('certificates', 'other-certificate-key') %><span class="form-required">*</span></div>
6161
<div class="custom-file">
6262
<input type="file" class="custom-file-input" name="meta[other_certificate_key]" id="other_certificate_key" required>
63-
<label class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
63+
<label id="other_certificate_key_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
6464
</div>
6565
</div>
6666
</div>
@@ -69,7 +69,7 @@
6969
<div class="form-label"><%- i18n('certificates', 'other-certificate') %><span class="form-required">*</span></div>
7070
<div class="custom-file">
7171
<input type="file" class="custom-file-input" name="meta[other_certificate]" id="other_certificate">
72-
<label class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
72+
<label id="other_certificate_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
7373
</div>
7474
</div>
7575
</div>
@@ -78,7 +78,7 @@
7878
<div class="form-label"><%- i18n('certificates', 'other-intermediate-certificate') %></div>
7979
<div class="custom-file">
8080
<input type="file" class="custom-file-input" name="meta[other_intermediate_certificate]" id="other_intermediate_certificate">
81-
<label class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
81+
<label id="other_intermediate_certificate_label" class="custom-file-label"><%- i18n('str', 'choose-file') %></label>
8282
</div>
8383
</div>
8484
</div>

frontend/js/app/nginx/certificates/form.js

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,22 @@ module.exports = Mn.View.extend({
1313
max_file_size: 102400,
1414

1515
ui: {
16-
form: 'form',
17-
domain_names: 'input[name="domain_names"]',
18-
buttons: '.modal-footer button',
19-
cancel: 'button.cancel',
20-
save: 'button.save',
21-
other_certificate: '#other_certificate',
22-
other_certificate_key: '#other_certificate_key',
23-
other_intermediate_certificate: '#other_intermediate_certificate',
24-
cloudflare_switch: 'input[name="meta[cloudflare_use]"]',
25-
cloudflare_token: 'input[name="meta[cloudflare_token]"',
26-
cloudflare: '.cloudflare'
16+
form: 'form',
17+
domain_names: 'input[name="domain_names"]',
18+
buttons: '.modal-footer button',
19+
cancel: 'button.cancel',
20+
save: 'button.save',
21+
other_certificate: '#other_certificate',
22+
other_certificate_label: '#other_certificate_label',
23+
other_certificate_key: '#other_certificate_key',
24+
cloudflare_switch: 'input[name="meta[cloudflare_use]"]',
25+
cloudflare_token: 'input[name="meta[cloudflare_token]"',
26+
cloudflare: '.cloudflare',
27+
other_certificate_key_label: '#other_certificate_key_label',
28+
other_intermediate_certificate: '#other_intermediate_certificate',
29+
other_intermediate_certificate_label: '#other_intermediate_certificate_label'
2730
},
28-
31+
2932
events: {
3033
'change @ui.cloudflare_switch': function() {
3134
let checked = this.ui.cloudflare_switch.prop('checked');
@@ -155,9 +158,20 @@ module.exports = Mn.View.extend({
155158
this.ui.buttons.prop('disabled', false).removeClass('btn-disabled');
156159
this.ui.save.removeClass('btn-loading');
157160
});
161+
},
162+
'change @ui.other_certificate_key': function(e){
163+
this.setFileName("other_certificate_key_label", e)
164+
},
165+
'change @ui.other_certificate': function(e){
166+
this.setFileName("other_certificate_label", e)
167+
},
168+
'change @ui.other_intermediate_certificate': function(e){
169+
this.setFileName("other_intermediate_certificate_label", e)
158170
}
159171
},
160-
172+
setFileName(ui, e){
173+
this.getUI(ui).text(e.target.files[0].name)
174+
},
161175
templateContext: {
162176
getLetsencryptEmail: function () {
163177
return typeof this.meta.letsencrypt_email !== 'undefined' ? this.meta.letsencrypt_email : App.Cache.User.get('email');

0 commit comments

Comments
 (0)