@@ -13,19 +13,22 @@ module.exports = Mn.View.extend({
13
13
max_file_size : 102400 ,
14
14
15
15
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'
27
30
} ,
28
-
31
+
29
32
events : {
30
33
'change @ui.cloudflare_switch' : function ( ) {
31
34
let checked = this . ui . cloudflare_switch . prop ( 'checked' ) ;
@@ -155,9 +158,20 @@ module.exports = Mn.View.extend({
155
158
this . ui . buttons . prop ( 'disabled' , false ) . removeClass ( 'btn-disabled' ) ;
156
159
this . ui . save . removeClass ( 'btn-loading' ) ;
157
160
} ) ;
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 )
158
170
}
159
171
} ,
160
-
172
+ setFileName ( ui , e ) {
173
+ this . getUI ( ui ) . text ( e . target . files [ 0 ] . name )
174
+ } ,
161
175
templateContext : {
162
176
getLetsencryptEmail : function ( ) {
163
177
return typeof this . meta . letsencrypt_email !== 'undefined' ? this . meta . letsencrypt_email : App . Cache . User . get ( 'email' ) ;
0 commit comments