diff --git a/docs/configuration/miscellaneous.md b/docs/configuration/miscellaneous.md index f86086d53..e3728acab 100644 --- a/docs/configuration/miscellaneous.md +++ b/docs/configuration/miscellaneous.md @@ -29,6 +29,17 @@ This defines custom content to be displayed on the login page above the login fo --- +## BANNER_MAINTENANCE + +!!! tip "Dynamic Configuration Parameter" + +!!! note + This parameter was added in NetBox v3.5. + +This adds a banner to the top of every page when maintenance mode is enabled. HTML is allowed. + +--- + ## BANNER_TOP !!! tip "Dynamic Configuration Parameter" @@ -121,15 +132,6 @@ Default: False Setting this to True will display a "maintenance mode" banner at the top of every page. Additionally, NetBox will no longer update a user's "last active" time upon login. This is to allow new logins when the database is in a read-only state. Recording of login times will resume when maintenance mode is disabled. -## BANNER_MAINTENANCE - -!!! tip "Dynamic Configuration Parameter" - -!!! note - This parameter was added in NetBox v3.5. - -This adds a banner to the top of every page when maintenance mode is enabled. HTML is allowed. - --- ## MAPS_URL diff --git a/netbox/extras/admin.py b/netbox/extras/admin.py index 6cc503096..e78a46cc5 100644 --- a/netbox/extras/admin.py +++ b/netbox/extras/admin.py @@ -25,7 +25,7 @@ class ConfigRevisionAdmin(admin.ModelAdmin): 'fields': ('ALLOWED_URL_SCHEMES',), }), ('Banners', { - 'fields': ('BANNER_LOGIN', 'BANNER_TOP', 'BANNER_BOTTOM'), + 'fields': ('BANNER_LOGIN', 'BANNER_MAINTENANCE', 'BANNER_TOP', 'BANNER_BOTTOM'), 'classes': ('monospace',), }), ('Pagination', { @@ -39,9 +39,7 @@ class ConfigRevisionAdmin(admin.ModelAdmin): 'fields': ('DEFAULT_USER_PREFERENCES',), }), ('Miscellaneous', { - 'fields': ( - 'MAINTENANCE_MODE', 'BANNER_MAINTENANCE', 'GRAPHQL_ENABLED', 'CHANGELOG_RETENTION', 'JOB_RETENTION', - 'MAPS_URL' + 'fields': ('MAINTENANCE_MODE', 'GRAPHQL_ENABLED', 'CHANGELOG_RETENTION', 'JOB_RETENTION', 'MAPS_URL' ), }), ('Config Revision', { diff --git a/netbox/netbox/config/parameters.py b/netbox/netbox/config/parameters.py index 228cbd4f7..4cc93c161 100644 --- a/netbox/netbox/config/parameters.py +++ b/netbox/netbox/config/parameters.py @@ -28,6 +28,13 @@ PARAMS = ( ), }, ), + ConfigParam( + name='BANNER_MAINTENANCE', + label=_('Maintenance banner'), + default='NetBox is currently in maintenance mode. Functionality may be limited.', + description=_('Additional content to display when in maintenance mode'), + field=forms.CharField, + ), ConfigParam( name='BANNER_TOP', label=_('Top banner'), @@ -199,13 +206,6 @@ PARAMS = ( description=_("Enable maintenance mode"), field=forms.BooleanField ), - ConfigParam( - name='BANNER_MAINTENANCE', - label=_('Maintenance banner'), - default=None, - description=_('Additional content to display when in maintenance mode'), - field=forms.CharField, - ), ConfigParam( name='GRAPHQL_ENABLED', label=_('GraphQL enabled'),