1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Clean up navigation menu

This commit is contained in:
jeremystretch
2023-03-24 22:01:41 -04:00
parent ea1801bad3
commit 37aa07eea1
5 changed files with 48 additions and 20 deletions

View File

@@ -265,17 +265,24 @@ POWER_MENU = Menu(
), ),
) )
OTHER_MENU = Menu( PROVISIONING_MENU = Menu(
label=_('Other'), label=_('Provisioning'),
icon_class='mdi mdi-notification-clear-all', icon_class='mdi mdi-file-document-multiple-outline',
groups=( groups=(
MenuGroup( MenuGroup(
label=_('Logging'), label=_('Configurations'),
items=( items=(
get_model_item('extras', 'journalentry', _('Journal Entries'), actions=[]), get_model_item('extras', 'configcontext', _('Config Contexts'), actions=['add']),
get_model_item('extras', 'objectchange', _('Change Log'), actions=[]), get_model_item('extras', 'configtemplate', _('Config Templates'), actions=['add']),
), ),
), ),
),
)
CUSTOMIZATION_MENU = Menu(
label=_('Customization'),
icon_class='mdi mdi-toolbox-outline',
groups=(
MenuGroup( MenuGroup(
label=_('Customization'), label=_('Customization'),
items=( items=(
@@ -283,13 +290,12 @@ OTHER_MENU = Menu(
get_model_item('extras', 'customlink', _('Custom Links')), get_model_item('extras', 'customlink', _('Custom Links')),
get_model_item('extras', 'exporttemplate', _('Export Templates')), get_model_item('extras', 'exporttemplate', _('Export Templates')),
get_model_item('extras', 'savedfilter', _('Saved Filters')), get_model_item('extras', 'savedfilter', _('Saved Filters')),
get_model_item('extras', 'tag', 'Tags'),
), ),
), ),
MenuGroup( MenuGroup(
label=_('Integrations'), label=_('Reports & Scripts'),
items=( items=(
get_model_item('core', 'datasource', _('Data Sources')),
get_model_item('extras', 'webhook', _('Webhooks')),
MenuItem( MenuItem(
link='extras:report_list', link='extras:report_list',
link_text=_('Reports'), link_text=_('Reports'),
@@ -300,6 +306,25 @@ OTHER_MENU = Menu(
link_text=_('Scripts'), link_text=_('Scripts'),
permissions=['extras.view_script'] permissions=['extras.view_script']
), ),
),
),
),
)
OPERATIONS_MENU = Menu(
label=_('Operations'),
icon_class='mdi mdi-cogs',
groups=(
MenuGroup(
label=_('Integrations'),
items=(
get_model_item('core', 'datasource', _('Data Sources')),
get_model_item('extras', 'webhook', _('Webhooks')),
),
),
MenuGroup(
label=_('Jobs'),
items=(
MenuItem( MenuItem(
link='extras:jobresult_list', link='extras:jobresult_list',
link_text=_('Jobs'), link_text=_('Jobs'),
@@ -308,11 +333,10 @@ OTHER_MENU = Menu(
), ),
), ),
MenuGroup( MenuGroup(
label=_('Other'), label=_('Logging'),
items=( items=(
get_model_item('extras', 'tag', 'Tags'), get_model_item('extras', 'journalentry', _('Journal Entries'), actions=[]),
get_model_item('extras', 'configcontext', _('Config Contexts'), actions=['add']), get_model_item('extras', 'objectchange', _('Change Log'), actions=[]),
get_model_item('extras', 'configtemplate', _('Config Templates'), actions=['add']),
), ),
), ),
), ),
@@ -329,7 +353,9 @@ MENUS = [
VIRTUALIZATION_MENU, VIRTUALIZATION_MENU,
CIRCUITS_MENU, CIRCUITS_MENU,
POWER_MENU, POWER_MENU,
OTHER_MENU, PROVISIONING_MENU,
CUSTOMIZATION_MENU,
OPERATIONS_MENU,
] ]
# #

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -185,6 +185,10 @@
margin-bottom: 0; margin-bottom: 0;
} }
.nav {
margin-bottom: 0.5rem;
}
// Child Link nav-item // Child Link nav-item
.nav .nav-item { .nav .nav-item {
display: flex; display: flex;
@@ -193,8 +197,7 @@
width: 100%; width: 100%;
&.no-buttons { &.no-buttons {
// When there are no buttons, don't extend to the full width of the sidenav. padding-right: 0.5rem;
padding-right: $spacer * 5;
} }
} }
@@ -262,7 +265,6 @@
margin-left: -$sidenav-spacing-x; margin-left: -$sidenav-spacing-x;
.nav-item { .nav-item {
margin-top: 2px;
&.disabled { &.disabled {
cursor: not-allowed; cursor: not-allowed;