File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
src/frontend/js/app/nginx/certificates Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ <div class =" modal-content" >
2
+ <div class =" modal-header" >
3
+ <h5 class =" modal-title" ><% - i18n (' certificates' , ' renew-title' ) %> </h5 >
4
+ </div >
5
+ <div class =" modal-body" >
6
+ <div class =" waiting text-center" >
7
+ <%= i18n (' str' , ' please-wait' ) %>
8
+ </div >
9
+ <div class =" alert alert-danger error" role =" alert" ></div >
10
+ </div >
11
+ <div class =" modal-footer" >
12
+ <button type =" button" class =" btn btn-secondary cancel" data-dismiss =" modal" disabled ><% - i18n (' str' , ' close' ) %> </button >
13
+ </div >
14
+ </div >
Original file line number Diff line number Diff line change
1
+ const Mn = require ( 'backbone.marionette' ) ;
2
+ const App = require ( '../../main' ) ;
3
+ const template = require ( './renew.ejs' ) ;
4
+
5
+ module . exports = Mn . View . extend ( {
6
+ template : template ,
7
+ className : 'modal-dialog' ,
8
+
9
+ ui : {
10
+ waiting : '.waiting' ,
11
+ error : '.error' ,
12
+ close : 'button.cancel'
13
+ } ,
14
+
15
+ onRender : function ( ) {
16
+ this . ui . error . hide ( ) ;
17
+
18
+ App . Api . Nginx . Certificates . renew ( this . model . get ( 'id' ) )
19
+ . then ( ( result ) => {
20
+ this . model . set ( result ) ;
21
+ setTimeout ( ( ) => {
22
+ App . UI . closeModal ( ) ;
23
+ } , 1000 ) ;
24
+ } )
25
+ . catch ( ( err ) => {
26
+ this . ui . waiting . hide ( ) ;
27
+ this . ui . error . text ( err . message ) . show ( ) ;
28
+ this . ui . close . prop ( 'disabled' , false ) ;
29
+ } ) ;
30
+ }
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments