[frontend] certificate download changes
This commit is contained in:
@ -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>
|
||||
|
@ -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'))
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user