mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
adds BANNER_MAINTENANCE config #12554
This commit is contained in:
parent
b7f028fba3
commit
eedf8a1068
@ -121,6 +121,15 @@ 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
|
||||
|
@ -39,7 +39,10 @@ class ConfigRevisionAdmin(admin.ModelAdmin):
|
||||
'fields': ('DEFAULT_USER_PREFERENCES',),
|
||||
}),
|
||||
('Miscellaneous', {
|
||||
'fields': ('MAINTENANCE_MODE', 'GRAPHQL_ENABLED', 'CHANGELOG_RETENTION', 'JOB_RETENTION', 'MAPS_URL'),
|
||||
'fields': (
|
||||
'MAINTENANCE_MODE', 'BANNER_MAINTENANCE', 'GRAPHQL_ENABLED', 'CHANGELOG_RETENTION', 'JOB_RETENTION',
|
||||
'MAPS_URL'
|
||||
),
|
||||
}),
|
||||
('Config Revision', {
|
||||
'fields': ('comment',),
|
||||
|
@ -199,6 +199,13 @@ 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'),
|
||||
|
@ -77,10 +77,10 @@ Blocks:
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if config.MAINTENANCE_MODE %}
|
||||
{% if config.MAINTENANCE_MODE and config.BANNER_MAINTENANCE %}
|
||||
<div class="alert alert-warning text-center mx-3" role="alert">
|
||||
<h5><i class="mdi mdi-alert"></i> Maintenance Mode</h5>
|
||||
NetBox is currently in maintenance mode. Functionality may be limited.
|
||||
{{ config.BANNER_MAINTENANCE|escape }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user