diff --git a/backend/setup.js b/backend/setup.js index 26dd3f27..ec6b44fb 100644 --- a/backend/setup.js +++ b/backend/setup.js @@ -75,54 +75,56 @@ const setupDefaultUser = () => { * @returns {Promise} */ const setupDefaultSettings = () => { - return Promise.all([settingModel - .query() - .select(settingModel.raw('COUNT(`id`) as `count`')) - .where({id: 'default-site'}) - .first() - .then((row) => { - if (!row.count) { - settingModel - .query() - .insert({ - id: 'default-site', - name: 'Default Site', - description: 'What to show when Nginx is hit with an unknown Host', - value: 'congratulations', - meta: {}, - }) - .then(() => { - logger.info('Added default-site setting'); - }); - } - if (config.debug()) { - logger.info('Default setting setup not required'); - } - }), - settingModel - .query() - .select(settingModel.raw('COUNT(`id`) as `count`')) - .where({id: 'oidc-config'}) - .first() - .then((row) => { - if (!row.count) { - settingModel - .query() - .insert({ - id: 'oidc-config', - name: 'Open ID Connect', - description: 'Sign in to Nginx Proxy Manager with an external Identity Provider', - value: 'metadata', - meta: {}, - }) - .then(() => { - logger.info('Added oidc-config setting'); - }); - } - if (debug_mode) { - logger.debug('Default setting setup not required'); - } - })]); + return Promise.all([ + settingModel + .query() + .select(settingModel.raw('COUNT(`id`) as `count`')) + .where({id: 'default-site'}) + .first() + .then((row) => { + if (!row.count) { + settingModel + .query() + .insert({ + id: 'default-site', + name: 'Default Site', + description: 'What to show when Nginx is hit with an unknown Host', + value: 'congratulations', + meta: {}, + }) + .then(() => { + logger.info('Added default-site setting'); + }); + } + if (config.debug()) { + logger.info('Default setting setup not required'); + } + }), + settingModel + .query() + .select(settingModel.raw('COUNT(`id`) as `count`')) + .where({id: 'oidc-config'}) + .first() + .then((row) => { + if (!row.count) { + settingModel + .query() + .insert({ + id: 'oidc-config', + name: 'Open ID Connect', + description: 'Sign in to Nginx Proxy Manager with an external Identity Provider', + value: 'metadata', + meta: {}, + }) + .then(() => { + logger.info('Added oidc-config setting'); + }); + } + if (config.debug()) { + logger.info('Default setting setup not required'); + } + }) + ]); }; /** diff --git a/frontend/js/app/settings/list/item.ejs b/frontend/js/app/settings/list/item.ejs index 4f32cd47..9afae591 100644 --- a/frontend/js/app/settings/list/item.ejs +++ b/frontend/js/app/settings/list/item.ejs @@ -1,7 +1,19 @@ -
<%- i18n('settings', 'default-site') %>
+
+ <% if (id === 'default-site') { %> + <%- i18n('settings', 'default-site') %> + <% } %> + <% if (id === 'oidc-config') { %> + <%- i18n('settings', 'oidc-config') %> + <% } %> +
- <%- i18n('settings', 'default-site-description') %> + <% if (id === 'default-site') { %> + <%- i18n('settings', 'default-site-description') %> + <% } %> + <% if (id === 'oidc-config') { %> + <%- i18n('settings', 'oidc-config-description') %> + <% } %>
@@ -12,10 +24,10 @@ <% if (id === 'oidc-config' && meta && meta.name && meta.clientID && meta.clientSecret && meta.issuerURL && meta.redirectURL) { %> <%- meta.name %> <% if (!meta.enabled) { %> - (Disabled) + (<%- i18n('str', 'disabled') %>) <% } %> <% } else if (id === 'oidc-config') { %> - Not configured + <%- i18n('settings', 'oidc-not-configured') %> <% } %> diff --git a/frontend/js/app/settings/oidc-config/main.ejs b/frontend/js/app/settings/oidc-config/main.ejs index 15eb3981..d8d767a0 100644 --- a/frontend/js/app/settings/oidc-config/main.ejs +++ b/frontend/js/app/settings/oidc-config/main.ejs @@ -15,7 +15,7 @@
-
@@ -40,7 +40,7 @@
-
Enabled
+
<%- i18n('str', 'enable') %>
>
diff --git a/frontend/js/i18n/messages.json b/frontend/js/i18n/messages.json index e7dca961..3a3ec055 100644 --- a/frontend/js/i18n/messages.json +++ b/frontend/js/i18n/messages.json @@ -293,8 +293,10 @@ "default-site-html": "Custom Page", "default-site-redirect": "Redirect", "oidc-config": "Open ID Conncect Configuration", + "oidc-config-description": "Sign in to Nginx Proxy Manager with an external Identity Provider", + "oidc-not-configured": "Not configured", "oidc-config-hint-1": "Provide configuration for an IdP that supports Open ID Connect Discovery.", "oidc-config-hint-2": "The 'RedirectURL' must be set to '[base URL]/api/oidc/callback', the IdP must send the 'email' claim and a user with matching email address must exist in Nginx Proxy Manager." } } -} +} \ No newline at end of file