changes as per review

This commit is contained in:
Abhimanyu Saharan 2023-05-12 18:45:42 +05:30
parent eedf8a1068
commit 3e38c10b81
3 changed files with 20 additions and 20 deletions

View File

@ -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

View File

@ -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', {

View File

@ -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'),