@@ -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