瀏覽代碼

Closes #16988: Move rack nav menu items to a dedicated section

Jeremy Stretch 1 年之前
父節點
當前提交
22319b2cce
共有 1 個文件被更改,包括 26 次插入13 次删除
  1. 26 13
      netbox/netbox/navigation/menu.py

+ 26 - 13
netbox/netbox/navigation/menu.py

@@ -20,11 +20,33 @@ ORGANIZATION_MENU = Menu(
                 get_model_item('dcim', 'location', _('Locations')),
                 get_model_item('dcim', 'location', _('Locations')),
             ),
             ),
         ),
         ),
+        MenuGroup(
+            label=_('Tenancy'),
+            items=(
+                get_model_item('tenancy', 'tenant', _('Tenants')),
+                get_model_item('tenancy', 'tenantgroup', _('Tenant Groups')),
+            ),
+        ),
+        MenuGroup(
+            label=_('Contacts'),
+            items=(
+                get_model_item('tenancy', 'contact', _('Contacts')),
+                get_model_item('tenancy', 'contactgroup', _('Contact Groups')),
+                get_model_item('tenancy', 'contactrole', _('Contact Roles')),
+                get_model_item('tenancy', 'contactassignment', _('Contact Assignments'), actions=['import']),
+            ),
+        ),
+    ),
+)
+
+RACKS_MENU = Menu(
+    label=_('Racks'),
+    icon_class='mdi mdi-door-sliding',
+    groups=(
         MenuGroup(
         MenuGroup(
             label=_('Racks'),
             label=_('Racks'),
             items=(
             items=(
                 get_model_item('dcim', 'rack', _('Racks')),
                 get_model_item('dcim', 'rack', _('Racks')),
-                get_model_item('dcim', 'racktype', _('Rack Types')),
                 get_model_item('dcim', 'rackrole', _('Rack Roles')),
                 get_model_item('dcim', 'rackrole', _('Rack Roles')),
                 get_model_item('dcim', 'rackreservation', _('Reservations')),
                 get_model_item('dcim', 'rackreservation', _('Reservations')),
                 MenuItem(
                 MenuItem(
@@ -35,19 +57,9 @@ ORGANIZATION_MENU = Menu(
             ),
             ),
         ),
         ),
         MenuGroup(
         MenuGroup(
-            label=_('Tenancy'),
+            label=_('Rack Types'),
             items=(
             items=(
-                get_model_item('tenancy', 'tenant', _('Tenants')),
-                get_model_item('tenancy', 'tenantgroup', _('Tenant Groups')),
-            ),
-        ),
-        MenuGroup(
-            label=_('Contacts'),
-            items=(
-                get_model_item('tenancy', 'contact', _('Contacts')),
-                get_model_item('tenancy', 'contactgroup', _('Contact Groups')),
-                get_model_item('tenancy', 'contactrole', _('Contact Roles')),
-                get_model_item('tenancy', 'contactassignment', _('Contact Assignments'), actions=['import']),
+                get_model_item('dcim', 'racktype', _('Rack Types')),
             ),
             ),
         ),
         ),
     ),
     ),
@@ -460,6 +472,7 @@ ADMIN_MENU = Menu(
 
 
 MENUS = [
 MENUS = [
     ORGANIZATION_MENU,
     ORGANIZATION_MENU,
+    RACKS_MENU,
     DEVICES_MENU,
     DEVICES_MENU,
     CONNECTIONS_MENU,
     CONNECTIONS_MENU,
     WIRELESS_MENU,
     WIRELESS_MENU,