feat: customize site banners and login notices
Magent CI/CD / verify (push) Successful in 1m55s
Magent CI/CD / deploy-prod (push) Skipped
Magent CI/CD / deploy-beta (push) Successful in 49s

This commit is contained in:
2026-09-16 14:22:38 +12:00
parent 3465343a69
commit d75f36c691
12 changed files with 239 additions and 20 deletions
+19 -3
View File
@@ -70,6 +70,7 @@ const BOOL_SETTINGS = new Set([
])
const TEXTAREA_SETTINGS = new Set([
'site_banner_message',
'site_login_message',
'site_changelog',
'magent_ssl_certificate_pem',
'magent_ssl_private_key_pem',
@@ -266,14 +267,21 @@ const SITE_SECTION_GROUPS: Array<{
{
key: 'site-banner',
title: 'Site Banner',
description: 'Control the sitewide banner message, tone, and visibility.',
keys: ['site_banner_enabled', 'site_banner_tone', 'site_banner_message'],
description: 'Control the sitewide banner message, preset tone, surrounding background and border colours, and visibility.',
keys: [
'site_banner_enabled',
'site_banner_tone',
'site_banner_background_color',
'site_banner_border_color',
'site_banner_message',
],
},
{
key: 'site-login',
title: 'Login Page Behaviour',
description: 'Control which sign-in and recovery options are shown on the logged-out login page.',
keys: [
'site_login_message',
'site_login_show_jellyfin_login',
'site_login_show_local_login',
'site_login_show_forgot_password',
@@ -517,6 +525,7 @@ const SETTING_LABEL_OVERRIDES: Record<string, string> = {
log_level: 'Application log level',
log_file: 'Active log file',
site_login_show_jellyfin_login: 'Login page: Jellyfin sign-in',
site_login_message: 'Logged-out login page message',
site_login_show_local_login: 'Login page: local Magent sign-in',
site_login_show_forgot_password: 'Login page: forgot password',
site_login_show_signup_link: 'Login page: invite signup link',
@@ -551,6 +560,9 @@ const labelFromKey = (key: string) =>
.replace('site banner enabled', 'Sitewide banner enabled')
.replace('site banner message', 'Sitewide banner message')
.replace('site banner tone', 'Sitewide banner tone')
.replace('site banner background color', 'Banner background colour')
.replace('site banner border color', 'Banner border colour')
.replace('site login message', 'Logged-out login page message')
.replace('site nav show requests', 'Top navigation: New Requests')
.replace('site changelog', 'Changelog text')
@@ -1051,7 +1063,10 @@ export default function SettingsPage({ section }: SettingsPageProps) {
site_build_number: 'Build number shown in the account menu (auto-set from releases).',
site_banner_enabled: 'Enable a sitewide banner for announcements.',
site_banner_message: 'Short banner message for maintenance or updates.',
site_banner_tone: 'Visual tone for the banner.',
site_banner_tone: 'Preset visual tone used whenever custom colours are blank.',
site_banner_background_color: 'Optional six-digit hex colour behind the banner message. Clear it to use the selected tone.',
site_banner_border_color: 'Optional six-digit hex colour around the banner. Clear it to use the selected tone.',
site_login_message: 'Optional message shown only on the logged-out login page. Leave blank to hide it.',
site_login_show_jellyfin_login: 'Show the Jellyfin login button on the login page.',
site_login_show_local_login: 'Show the local Magent login button on the login page.',
site_login_show_forgot_password: 'Show the forgot-password link on the login page.',
@@ -1097,6 +1112,7 @@ export default function SettingsPage({ section }: SettingsPageProps) {
radarr_base_url: 'https://radarr.example.com or 10.30.1.81:7878',
prowlarr_base_url: 'https://prowlarr.example.com or 10.30.1.81:9696',
qbittorrent_base_url: 'https://qb.example.com or 10.30.1.81:8080',
site_login_message: 'Sign-in information, an outage notice, or help for users…',
}
const parseActionError = (err: unknown, fallback: string) => {