[frontend] certificate download changes

This commit is contained in:
Rahul Somasundaram
2021-08-23 15:47:03 +05:30
parent ac3df6dd77
commit a8f4699816
4 changed files with 65 additions and 1 deletions

View File

@ -41,6 +41,7 @@
<span class="dropdown-header"><%- i18n('audit-log', 'certificate') %> #<%- id %></span>
<% if (provider === 'letsencrypt') { %>
<a href="#" class="renew dropdown-item"><i class="dropdown-icon fe fe-refresh-cw"></i> <%- i18n('certificates', 'force-renew') %></a>
<a href="#" class="download dropdown-item"><i class="dropdown-icon fe fe-download"></i><%- i18n('certificates', 'download') %></a>
<div class="dropdown-divider"></div>
<% } %>
<a href="#" class="delete dropdown-item"><i class="dropdown-icon fe fe-trash-2"></i> <%- i18n('str', 'delete') %></a>

View File

@ -11,7 +11,8 @@ module.exports = Mn.View.extend({
ui: {
host_link: '.host-link',
renew: 'a.renew',
delete: 'a.delete'
delete: 'a.delete',
download: 'a.download'
},
events: {
@ -29,6 +30,10 @@ module.exports = Mn.View.extend({
e.preventDefault();
let win = window.open($(e.currentTarget).attr('rel'), '_blank');
win.focus();
},
'click @ui.download': function (e) {
e.preventDefault();
App.Api.Nginx.Certificates.download(this.model.get('id'))
}
},