mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Automatically sort DNS challenge providers by display name on render
This commit is contained in:
parent
24d8cd57da
commit
4c3632d3e7
@ -4,11 +4,20 @@ const App = require('../../main');
|
||||
const CertificateModel = require('../../../models/certificate');
|
||||
const template = require('./form.ejs');
|
||||
const i18n = require('../../i18n');
|
||||
const dns_providers = require('../../../../../global/certbot-dns-plugins');
|
||||
const dns_providers = sortProvidersAlphabetically(require('../../../../../global/certbot-dns-plugins'));
|
||||
|
||||
require('jquery-serializejson');
|
||||
require('selectize');
|
||||
|
||||
function sortProvidersAlphabetically(obj) {
|
||||
return Object.entries(obj)
|
||||
.sort((a,b) => a[1].display_name.toLowerCase() > b[1].display_name.toLowerCase())
|
||||
.reduce((result, entry) => {
|
||||
result[entry[0]] = entry[1];
|
||||
return result;
|
||||
}, {});
|
||||
}
|
||||
|
||||
module.exports = Mn.View.extend({
|
||||
template: template,
|
||||
className: 'modal-dialog',
|
||||
|
Loading…
Reference in New Issue
Block a user