Added missing dialog for renewing certs
This commit is contained in:
parent
22e8961c80
commit
92fcae9c54
14
src/frontend/js/app/nginx/certificates/renew.ejs
Normal file
14
src/frontend/js/app/nginx/certificates/renew.ejs
Normal file
@ -0,0 +1,14 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><%- i18n('certificates', 'renew-title') %></h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="waiting text-center">
|
||||
<%= i18n('str', 'please-wait') %>
|
||||
</div>
|
||||
<div class="alert alert-danger error" role="alert"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary cancel" data-dismiss="modal" disabled><%- i18n('str', 'close') %></button>
|
||||
</div>
|
||||
</div>
|
31
src/frontend/js/app/nginx/certificates/renew.js
Normal file
31
src/frontend/js/app/nginx/certificates/renew.js
Normal file
@ -0,0 +1,31 @@
|
||||
const Mn = require('backbone.marionette');
|
||||
const App = require('../../main');
|
||||
const template = require('./renew.ejs');
|
||||
|
||||
module.exports = Mn.View.extend({
|
||||
template: template,
|
||||
className: 'modal-dialog',
|
||||
|
||||
ui: {
|
||||
waiting: '.waiting',
|
||||
error: '.error',
|
||||
close: 'button.cancel'
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
this.ui.error.hide();
|
||||
|
||||
App.Api.Nginx.Certificates.renew(this.model.get('id'))
|
||||
.then((result) => {
|
||||
this.model.set(result);
|
||||
setTimeout(() => {
|
||||
App.UI.closeModal();
|
||||
}, 1000);
|
||||
})
|
||||
.catch((err) => {
|
||||
this.ui.waiting.hide();
|
||||
this.ui.error.text(err.message).show();
|
||||
this.ui.close.prop('disabled', false);
|
||||
});
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user