mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-07 02:09:38 +00:00
Add button to add custom certificate in certificate list
This commit is contained in:
@ -6,6 +6,10 @@ if (subtitle) { %>
|
||||
<p class="h4 text-muted font-weight-normal mb-7"><%- subtitle %></p>
|
||||
<% }
|
||||
|
||||
if (link) { %>
|
||||
<a class="btn btn-<%- btn_color %>" href="#"><%- link %></a>
|
||||
if (links && links.length) { %>
|
||||
<% links.forEach(function(link, index) { %>
|
||||
<div style="margin-bottom: 10px;">
|
||||
<a class="btn btn-<%- btn_color %>" href="#" data-index="<%- index %>"><%- link %></a>
|
||||
</div>
|
||||
<% }); %>
|
||||
<% } %>
|
||||
|
@ -6,7 +6,9 @@ module.exports = Mn.View.extend({
|
||||
template: template,
|
||||
|
||||
options: {
|
||||
btn_color: 'teal'
|
||||
btn_color: 'teal',
|
||||
links: [], // Added to accept multiple links
|
||||
actions: [] // Added to accept multiple actions
|
||||
},
|
||||
|
||||
ui: {
|
||||
@ -16,17 +18,19 @@ module.exports = Mn.View.extend({
|
||||
events: {
|
||||
'click @ui.action': function (e) {
|
||||
e.preventDefault();
|
||||
this.getOption('action')();
|
||||
const index = $(e.currentTarget).data('index');
|
||||
this.getOption('actions')[index]();
|
||||
}
|
||||
},
|
||||
|
||||
templateContext: function () {
|
||||
return {
|
||||
title: this.getOption('title'),
|
||||
subtitle: this.getOption('subtitle'),
|
||||
link: this.getOption('link'),
|
||||
action: typeof this.getOption('action') === 'function',
|
||||
btn_color: this.getOption('btn_color')
|
||||
title: this.getOption('title'),
|
||||
subtitle: this.getOption('subtitle'),
|
||||
links: this.getOption('links'), // Changed to array
|
||||
actions: this.getOption('actions'), // Changed to array
|
||||
hasActions: this.getOption('actions').length > 0,
|
||||
btn_color: this.getOption('btn_color')
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user