Openstack视界UI自定义

时间:2015-03-18 15:19:00

标签: openstack openstack-horizon

我有OpenStack Juno正在运行,并且根据我们的要求,我试图在Project下“隐藏”整个网络面板。例如它有

Project
  **Network**
    Routers
    Networks

我们需要隐藏Panel Network。我已经查看了openstack上的自定义文档,并一直在尝试应用overrides.py。从文档中我可以执行以下操作。

projects_dashboard = horizon.get_dashboard("project")
volumes_panel = projects_dashboard.get_panel("volumes")
images_panel = projects_dashboard.get_panel("images")
as_panel =  projects_dashboard.get_panel("access_and_security")

permissions = list(getattr(volumes_panel, 'permissions', []))
permissions.append('openstack.roles.admin')
volumes_panel.permissions = tuple(permissions)

这很好用。但我无法找到代表网络面板的正确对象。这是我第一次进入Openstack,我将发布所需的任何其他信息。

1 个答案:

答案 0 :(得分:0)

在档案/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/dashboard.py,

在Project类定义中注释掉NetworkPanel对我来说很有用。

class Project(horizon.Dashboard):
    name = _("Project")
    slug = "project"
    panels = (
        BasePanels,
    #    NetworkPanels,
        ObjectStorePanels,
        OrchestrationPanels,
        DatabasePanels,)
    default_panel = 'overview'
    supports_tenants = True