Compare commits

..

1 Commits

Author SHA1 Message Date
jc21
c5a319cb20 Merge pull request #4347 from NginxProxyManager/develop
v2.12.3
2025-02-06 20:25:09 +10:00
13 changed files with 38 additions and 73 deletions

View File

@@ -12,11 +12,7 @@ Model.knex(db);
const boolFields = [ const boolFields = [
'is_deleted', 'is_deleted',
'ssl_forced',
'http2_support',
'enabled', 'enabled',
'hsts_enabled',
'hsts_subdomains',
]; ];
class DeadHost extends Model { class DeadHost extends Model {

View File

@@ -8,8 +8,8 @@ const now = require('./now_helper');
Model.knex(db); Model.knex(db);
const boolFields = [ const boolFields = [
'is_deleted',
'enabled', 'enabled',
'is_deleted',
'tcp_forwarding', 'tcp_forwarding',
'udp_forwarding', 'udp_forwarding',
]; ];

View File

@@ -22,7 +22,8 @@
"enabled", "enabled",
"locations", "locations",
"hsts_enabled", "hsts_enabled",
"hsts_subdomains" "hsts_subdomains",
"certificate"
], ],
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {

View File

@@ -9,15 +9,6 @@
"url": "http://127.0.0.1:81/api" "url": "http://127.0.0.1:81/api"
} }
], ],
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
"paths": { "paths": {
"/": { "/": {
"get": { "get": {

View File

@@ -6,10 +6,6 @@ if (subtitle) { %>
<p class="h4 text-muted font-weight-normal mb-7"><%- subtitle %></p> <p class="h4 text-muted font-weight-normal mb-7"><%- subtitle %></p>
<% } <% }
if (links && links.length) { %> if (link) { %>
<% links.forEach(function(link, index) { %> <a class="btn btn-<%- btn_color %>" href="#"><%- link %></a>
<div style="margin-bottom: 10px;">
<a class="btn btn-<%- btn_color %>" href="#" data-index="<%- index %>"><%- link %></a>
</div>
<% }); %>
<% } %> <% } %>

View File

@@ -6,9 +6,7 @@ module.exports = Mn.View.extend({
template: template, template: template,
options: { options: {
btn_color: 'teal', btn_color: 'teal'
links: [], // Added to accept multiple links
actions: [] // Added to accept multiple actions
}, },
ui: { ui: {
@@ -18,19 +16,17 @@ module.exports = Mn.View.extend({
events: { events: {
'click @ui.action': function (e) { 'click @ui.action': function (e) {
e.preventDefault(); e.preventDefault();
const index = $(e.currentTarget).data('index'); this.getOption('action')();
this.getOption('actions')[index]();
} }
}, },
templateContext: function () { templateContext: function () {
return { return {
title: this.getOption('title'), title: this.getOption('title'),
subtitle: this.getOption('subtitle'), subtitle: this.getOption('subtitle'),
links: this.getOption('links'), // Changed to array link: this.getOption('link'),
actions: this.getOption('actions'), // Changed to array action: typeof this.getOption('action') === 'function',
hasActions: this.getOption('actions').length > 0, btn_color: this.getOption('btn_color')
btn_color: this.getOption('btn_color')
}; };
} }

View File

@@ -45,14 +45,12 @@ module.exports = Mn.View.extend({
this.showChildView('list_region', new EmptyView({ this.showChildView('list_region', new EmptyView({
title: App.i18n('access-lists', 'empty'), title: App.i18n('access-lists', 'empty'),
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}), subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
links: manage ? [App.i18n('access-lists', 'add')] : [], link: manage ? App.i18n('access-lists', 'add') : null,
btn_color: 'teal', btn_color: 'teal',
permission: 'access_lists', permission: 'access_lists',
actions: [ action: function () {
function () { App.Controller.showNginxAccessListForm();
App.Controller.showNginxAccessListForm(); }
}
]
})); }));
}, },

View File

@@ -45,16 +45,12 @@ module.exports = Mn.View.extend({
this.showChildView('list_region', new EmptyView({ this.showChildView('list_region', new EmptyView({
title: App.i18n('certificates', 'empty'), title: App.i18n('certificates', 'empty'),
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}), subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
links: manage ? [App.i18n('certificates', 'add-letsencrypt'), App.i18n('certificates', 'add-custom')] : [], link: manage ? App.i18n('certificates', 'add') : null,
actions: [
function () {
App.Controller.showNginxCertificateForm();
},
function () {
App.Controller.showNginxCertificateForm(new CertificateModel.Model({provider: 'custom'}));
}],
btn_color: 'pink', btn_color: 'pink',
permission: 'certificates' permission: 'certificates',
action: function () {
App.Controller.showNginxCertificateForm();
}
})); }));
}, },

View File

@@ -45,14 +45,12 @@ module.exports = Mn.View.extend({
this.showChildView('list_region', new EmptyView({ this.showChildView('list_region', new EmptyView({
title: App.i18n('dead-hosts', 'empty'), title: App.i18n('dead-hosts', 'empty'),
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}), subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
links: manage ? [App.i18n('dead-hosts', 'add')] : [], link: manage ? App.i18n('dead-hosts', 'add') : null,
btn_color: 'danger', btn_color: 'danger',
permission: 'dead_hosts', permission: 'dead_hosts',
actions: [ action: function () {
function () { App.Controller.showNginxDeadForm();
App.Controller.showNginxDeadForm(); }
}
]
})); }));
}, },

View File

@@ -41,17 +41,16 @@ module.exports = Mn.View.extend({
showEmpty: function() { showEmpty: function() {
let manage = App.Cache.User.canManage('proxy_hosts'); let manage = App.Cache.User.canManage('proxy_hosts');
this.showChildView('list_region', new EmptyView({ this.showChildView('list_region', new EmptyView({
title: App.i18n('proxy-hosts', 'empty'), title: App.i18n('proxy-hosts', 'empty'),
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}), subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
links: manage ? [App.i18n('proxy-hosts', 'add')] : [], link: manage ? App.i18n('proxy-hosts', 'add') : null,
actions: [
function () {
App.Controller.showNginxProxyForm();
}
],
btn_color: 'success', btn_color: 'success',
permission: 'proxy_hosts', permission: 'proxy_hosts',
action: function () {
App.Controller.showNginxProxyForm();
}
})); }));
}, },

View File

@@ -44,14 +44,12 @@ module.exports = Mn.View.extend({
this.showChildView('list_region', new EmptyView({ this.showChildView('list_region', new EmptyView({
title: App.i18n('redirection-hosts', 'empty'), title: App.i18n('redirection-hosts', 'empty'),
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}), subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
links: manage ? [App.i18n('redirection-hosts', 'add')] : [], link: manage ? App.i18n('redirection-hosts', 'add') : null,
btn_color: 'yellow', btn_color: 'yellow',
permission: 'redirection_hosts', permission: 'redirection_hosts',
actions: [ action: function () {
function () { App.Controller.showNginxRedirectionForm();
App.Controller.showNginxRedirectionForm(); }
}
]
})); }));
}, },

View File

@@ -45,14 +45,12 @@ module.exports = Mn.View.extend({
this.showChildView('list_region', new EmptyView({ this.showChildView('list_region', new EmptyView({
title: App.i18n('streams', 'empty'), title: App.i18n('streams', 'empty'),
subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}), subtitle: App.i18n('all-hosts', 'empty-subtitle', {manage: manage}),
links: manage ? [App.i18n('streams', 'add')] : [], link: manage ? App.i18n('streams', 'add') : null,
btn_color: 'blue', btn_color: 'blue',
permission: 'streams', permission: 'streams',
actions: [ action: function () {
function () { App.Controller.showNginxStreamForm();
App.Controller.showNginxStreamForm(); }
}
]
})); }));
}, },

View File

@@ -187,8 +187,6 @@
"title": "SSL Certificates", "title": "SSL Certificates",
"empty": "There are no SSL Certificates", "empty": "There are no SSL Certificates",
"add": "Add SSL Certificate", "add": "Add SSL Certificate",
"add-letsencrypt": "Add SSL Certificate with Let's Encrypt",
"add-custom": "Add Custom SSL Certificate",
"form-title": "Add {provider, select, letsencrypt{Let's Encrypt} other{Custom}} Certificate", "form-title": "Add {provider, select, letsencrypt{Let's Encrypt} other{Custom}} Certificate",
"delete": "Delete SSL Certificate", "delete": "Delete SSL Certificate",
"delete-confirm": "Are you sure you want to delete this SSL Certificate? Any hosts using it will need to be updated later.", "delete-confirm": "Are you sure you want to delete this SSL Certificate? Any hosts using it will need to be updated later.",