From 8944609b63ed623d6e0c9b16b30c19f75b23cc93 Mon Sep 17 00:00:00 2001 From: Rahul Somasundaram Date: Tue, 24 Aug 2021 07:28:17 +0530 Subject: [PATCH] fixed linting --- backend/internal/certificate.js | 11 ++++------- frontend/js/app/nginx/certificates/list/item.ejs | 2 +- frontend/js/app/nginx/certificates/list/item.js | 1 + frontend/js/i18n/messages.json | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/backend/internal/certificate.js b/backend/internal/certificate.js index 1e7a1086..7e118cf9 100644 --- a/backend/internal/certificate.js +++ b/backend/internal/certificate.js @@ -343,7 +343,6 @@ const internalCertificate = { * @returns {Promise} */ download: (access, data) => { - return new Promise((resolve, reject) => { access.can('certificates:get', data) .then(() => { @@ -366,8 +365,6 @@ const internalCertificate = { fileName: opName }; resolve(resp); - }).catch((err) => { - reject(err); }); } else { throw new error.ValidationError('Only Let\'sEncrypt certificates can be renewed'); @@ -377,10 +374,10 @@ const internalCertificate = { }, /** - * @param {String} source - * @param {String} out - * @returns {Promise} - */ + * @param {String} source + * @param {String} out + * @returns {Promise} + */ zipDirectory(source, out) { const archive = archiver('zip', { zlib: { level: 9 } }); const stream = fs.createWriteStream(out); diff --git a/frontend/js/app/nginx/certificates/list/item.ejs b/frontend/js/app/nginx/certificates/list/item.ejs index 85b56eb0..1a73605b 100644 --- a/frontend/js/app/nginx/certificates/list/item.ejs +++ b/frontend/js/app/nginx/certificates/list/item.ejs @@ -41,7 +41,7 @@ <%- i18n('audit-log', 'certificate') %> #<%- id %> <% if (provider === 'letsencrypt') { %> <%- i18n('certificates', 'force-renew') %> - <%- i18n('certificates', 'download') %> + <%- i18n('certificates', 'download') %> <% } %> <%- i18n('str', 'delete') %> diff --git a/frontend/js/app/nginx/certificates/list/item.js b/frontend/js/app/nginx/certificates/list/item.js index 7c2530dd..ca167fae 100644 --- a/frontend/js/app/nginx/certificates/list/item.js +++ b/frontend/js/app/nginx/certificates/list/item.js @@ -31,6 +31,7 @@ module.exports = Mn.View.extend({ 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')) diff --git a/frontend/js/i18n/messages.json b/frontend/js/i18n/messages.json index 4b486818..9feb82d2 100644 --- a/frontend/js/i18n/messages.json +++ b/frontend/js/i18n/messages.json @@ -188,7 +188,7 @@ "other-certificate-key": "Certificate Key", "other-intermediate-certificate": "Intermediate Certificate", "force-renew": "Renew Now", - "download":"Download", + "download": "Download", "renew-title": "Renew Let'sEncrypt Certificate" }, "access-lists": {