<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hi,</div>
<div>Our Networking panels are bit different from Stock Horizon. Until our blueprints are approved merged to Neutron/Horizon, we have created a separate package for our extra Horizon code and we register it to stock Horizon.</div>
<div><br>
</div>
<div>I am running into couple of issues here:</div>
<ol>
<li>My Networking panels come under “Other” in menu. I want to bring them under “Manage Networking”.</li><li>The menu items under other sometimes keep flipping their positions.</li></ol>
<div>Can someone please help me with the API’s required to add a menu item and add my panels under those. Also I am pasting snippet of my code, please let me know if there is a better way to fix this. Please note that at this moment I cannot modify base Horizon
 code. I am based of Havana.</div>
<div><br>
</div>
<div>Snippet for Menu/Panel registrations:</div>
<div><br>
</div>
<div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">from django.utils.translation import ugettext_lazy as _</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">import horizon</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">from contrail_openstack_dashboard.openstack_dashboard.dashboards.project.networking.panel import Networking</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">from contrail_openstack_dashboard.openstack_dashboard.dashboards.admin.networking.panel import AdminNetworking</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">from contrail_openstack_dashboard.openstack_dashboard.dashboards.project.networking_topology.panel import NetworkingTopology</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">class NetworkingPanel(horizon.Panel):</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    name = "Networking"</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    slug = "networking"</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    urls = 'contrail_openstack_dashboard.openstack_dashboard.dashboards.project.networking.urls'</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">class AdminNetworkingPanel(horizon.Panel):</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    name = "Networking"</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    slug = "networking"</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    urls = 'contrail_openstack_dashboard.openstack_dashboard.dashboards.admin.networking.urls'</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">class NetworkingTopology(horizon.Panel):</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    name = _("Networking Topology")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    slug = 'networking_topology'</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    urls = 'contrail_openstack_dashboard.openstack_dashboard.dashboards.project.networking_topology.urls'</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    projects_dashboard = horizon.get_dashboard("project")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        topology_panel = projects_dashboard.get_panel("network_topology")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        projects_dashboard.unregister(topology_panel.__class__)</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    except:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        pass</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        network_panel = projects_dashboard.get_panel("networks")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        projects_dashboard.unregister(network_panel.__class__)</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    except:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        pass</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        routers_panel = projects_dashboard.get_panel("routers")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        projects_dashboard.unregister(routers_panel.__class__)</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    except:</p>
</div>
<div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        lb_panel = projects_dashboard.get_panel("loadbalancers")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        projects_dashboard.unregister(lb_panel.__class__)</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    except:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        pass</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">except:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    pass</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    admin_dashboard = horizon.get_dashboard("admin")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        admin_net_panel = admin_dashboard.get_panel("networks")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        admin_dashboard.unregister(admin_net_panel.__class__)</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    except:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        pass</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    try:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        admin_router_panel = admin_dashboard.get_panel("routers")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        admin_dashboard.unregister(admin_router_panel.__class__)</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    except:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">        pass</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">except:</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    pass</p>
</div>
<div><br>
</div>
<div><br>
</div>
<div>My Panel definitions:</div>
<div>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">class Networking(horizon.Panel):</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    name = _("Networking")</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    slug = 'networking'</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">    permissions = ('openstack.services.network',)</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px;"><br>
</p>
<p style="margin: 0px; font-size: 11px; font-family: Menlo;">dashboard.Project.register(Networking)</p>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> <img src="cid:9477E9A9-CAF6-4F43-9C36-B44ED1D9E11C" type="image/png"><img src="cid:31018469-AEFE-4546-B43A-8CAE7D54FDA7" type="image/png"></div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</body>
</html>