Move Horizon to pure plugin loading only

The root cause of 1479018 was the mixed method for loading content in
horizon. This patch moves horizon to load purely from enabled files.
There are a couple of things that were required to allow this change.

1) Adding a mechanism, can_register() to horizon/base.py to handle the
configuration based loading checks that had been accumulating in the
panel.py files. This is an optional static method in Panel to
encapsulate such configuration (read settings) based panel loading
logic. And added testing for and documentation for this addition.

2) Create a numbering scheme for plugins. Moved the base dashboards to
_1000_project.py _2000_admin.py _3000_identity.py _5000_settings.py.
then populated the required panel_group and panel enabled files sparsely
in those ranges. The sparseness is to allow for future additions.
Additionally, I moved the already added Angular based panels next to
their Django counterparts.

Once the configuration loading was normalized, the bug reported in
1479018 was resolved and tests work with plugins panels in all
dashboards.

Close-Bug: #1479018
Partially implements: blueprint plugin-sanity

Change-Id: I657e7ce37b2593a901a859cebf3d6ff8ada91941
This commit is contained in:
David Lyle 2015-08-03 14:23:42 -06:00
parent d6f5c24c06
commit 8303782f1e
103 changed files with 524 additions and 214 deletions

View File

@ -255,6 +255,18 @@ class Panel(HorizonComponent):
The ``name`` argument for the URL pattern which corresponds to
the index view for this ``Panel``. This is the view that
:meth:`.Panel.get_absolute_url` will attempt to reverse.
.. staticmethod:: can_register
This optional static method can be used to specify conditions that
need to be satisfied to load this panel. Unlike ``permissions`` and
``allowed`` this method is intended to handle settings based
conditions rather than user based permission and policy checks.
The return value is boolean. If the method returns ``True``, then the
panel will be registered and available to user (if ``permissions`` and
``allowed`` runtime checks are also satisfied). If the method returns
``False``, then the panel will not be registered and will not be
available via normal navigation or direct URL access.
"""
name = ''
slug = ''
@ -922,6 +934,14 @@ class Site(Registry, HorizonComponent):
LOG.warning("Could not load panel: %s", mod_path)
return
panel = getattr(mod, panel_cls)
# test is can_register method is present and call method if
# it is to determine if the panel should be loaded
if hasattr(panel, 'can_register') and \
callable(getattr(panel, 'can_register')):
if not panel.can_register():
LOG.debug("Load condition failed for panel: %(panel)s",
{'panel': panel_slug})
return
dashboard_cls.register(panel)
if panel_group:
dashboard_cls.get_panel_group(panel_group).\

View File

@ -17,7 +17,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import nova
from openstack_dashboard.dashboards.admin import dashboard
LOG = logging.getLogger(__name__)
@ -39,6 +38,3 @@ class Aggregates(horizon.Panel):
"endpoint. Host Aggregates panel will not be displayed.")
return False
return super(Aggregates, self).allowed(context)
dashboard.Admin.register(Aggregates)

View File

@ -17,19 +17,9 @@ from django.utils.translation import ugettext_lazy as _
import horizon
class SystemPanels(horizon.PanelGroup):
slug = "admin"
name = _("System")
panels = ('overview', 'metering', 'hypervisors', 'aggregates',
'instances', 'volumes', 'flavors', 'images',
'networks', 'routers', 'defaults', 'metadata_defs', 'info')
class Admin(horizon.Dashboard):
name = _("Admin")
slug = "admin"
panels = (SystemPanels,)
default_panel = 'overview'
permissions = ('openstack.roles.admin',)

View File

@ -16,12 +16,7 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Defaults(horizon.Panel):
name = _("Defaults")
slug = 'defaults'
dashboard.Admin.register(Defaults)

View File

@ -20,13 +20,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Flavors(horizon.Panel):
name = _("Flavors")
slug = 'flavors'
permissions = ('openstack.services.compute',)
dashboard.Admin.register(Flavors)

View File

@ -15,13 +15,9 @@
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Hypervisors(horizon.Panel):
name = _("Hypervisors")
slug = 'hypervisors'
permissions = ('openstack.roles.admin', 'openstack.services.compute')
dashboard.Admin.register(Hypervisors)

View File

@ -20,13 +20,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Images(horizon.Panel):
name = _("Images")
slug = 'images'
permissions = ('openstack.services.image',)
dashboard.Admin.register(Images)

View File

@ -20,12 +20,7 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Info(horizon.Panel):
name = _("System Information")
slug = 'info'
dashboard.Admin.register(Info)

View File

@ -20,13 +20,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Instances(horizon.Panel):
name = _("Instances")
slug = 'instances'
permissions = ('openstack.roles.admin', 'openstack.services.compute')
dashboard.Admin.register(Instances)

View File

@ -18,7 +18,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import glance
from openstack_dashboard.dashboards.admin import dashboard
class MetadataDefinitions(horizon.Panel):
@ -26,6 +25,6 @@ class MetadataDefinitions(horizon.Panel):
slug = 'metadata_defs'
permissions = ('openstack.roles.admin',)
if glance.VERSIONS.active >= 2:
dashboard.Admin.register(MetadataDefinitions)
@staticmethod
def can_register():
return glance.VERSIONS.active >= 2

View File

@ -13,7 +13,6 @@
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Metering(horizon.Panel):
@ -23,6 +22,3 @@ class Metering(horizon.Panel):
policy_rules = (('identity', 'identity:list_projects'),
('telemetry', 'telemetry:compute_statistics'),
('telemetry', 'telemetry:get_meter'),)
dashboard.Admin.register(Metering)

View File

@ -16,12 +16,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Networks(horizon.Panel):
name = _("Networks")
slug = 'networks'
permissions = ('openstack.services.network',)
dashboard.Admin.register(Networks)

View File

@ -17,14 +17,13 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Routers(horizon.Panel):
name = _("Routers")
slug = 'routers'
permissions = ('openstack.services.network',)
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
if network_config.get('enable_router', True):
dashboard.Admin.register(Routers)
@staticmethod
def can_register():
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
return network_config.get('enable_router', True)

View File

@ -14,13 +14,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Volumes(horizon.Panel):
name = _("Volumes")
slug = "volumes"
permissions = ('openstack.services.volume',)
dashboard.Admin.register(Volumes)

View File

@ -22,7 +22,6 @@ class Identity(horizon.Dashboard):
name = _("Identity")
slug = "identity"
default_panel = 'projects'
panels = ('domains', 'projects', 'users', 'groups', 'roles',)
horizon.register(Identity)

View File

@ -17,7 +17,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import keystone
from openstack_dashboard.dashboards.identity import dashboard
class Domains(horizon.Panel):
@ -26,6 +25,6 @@ class Domains(horizon.Panel):
policy_rules = (("identity", "identity:get_domain"),
("identity", "identity:list_domains"))
if keystone.VERSIONS.active >= 3:
dashboard.Identity.register(Domains)
@staticmethod
def can_register():
return keystone.VERSIONS.active >= 3

View File

@ -17,7 +17,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import keystone
from openstack_dashboard.dashboards.identity import dashboard
class Groups(horizon.Panel):
@ -25,6 +24,6 @@ class Groups(horizon.Panel):
slug = 'groups'
policy_rules = (("identity", "identity:list_groups"),)
if keystone.VERSIONS.active >= 3:
dashboard.Identity.register(Groups)
@staticmethod
def can_register():
return keystone.VERSIONS.active >= 3

View File

@ -20,14 +20,9 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.identity import dashboard
class Tenants(horizon.Panel):
name = _("Projects")
slug = 'projects'
policy_rules = (("identity", "identity:list_projects"),
("identity", "identity:list_user_projects"))
dashboard.Identity.register(Tenants)

View File

@ -17,7 +17,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import keystone
from openstack_dashboard.dashboards.identity import dashboard
class Roles(horizon.Panel):
@ -25,6 +24,6 @@ class Roles(horizon.Panel):
slug = 'roles'
policy_rules = (("identity", "identity:list_roles"),)
if keystone.VERSIONS.active >= 3:
dashboard.Identity.register(Roles)
@staticmethod
def can_register():
return keystone.VERSIONS.active >= 3

View File

@ -20,14 +20,9 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.identity import dashboard
class Users(horizon.Panel):
name = _("Users")
slug = 'users'
policy_rules = (("identity", "identity:get_user"),
("identity", "identity:list_users"))
dashboard.Identity.register(Users)

View File

@ -17,12 +17,7 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class AccessAndSecurity(horizon.Panel):
name = _("Access & Security")
slug = 'access_and_security'
dashboard.Project.register(AccessAndSecurity)

View File

@ -20,12 +20,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Containers(horizon.Panel):
name = _("Containers")
slug = 'containers'
permissions = ('openstack.services.object-store',)
dashboard.Project.register(Containers)

View File

@ -17,57 +17,9 @@ from django.utils.translation import ugettext_lazy as _
import horizon
class BasePanels(horizon.PanelGroup):
slug = "compute"
name = _("Compute")
panels = ('overview',
'instances',
'volumes',
'images',
'access_and_security',)
class NetworkPanels(horizon.PanelGroup):
slug = "network"
name = _("Network")
panels = ('network_topology',
'networks',
'routers',
'loadbalancers',
'firewalls',
'vpn',)
class ObjectStorePanels(horizon.PanelGroup):
slug = "object_store"
name = _("Object Store")
panels = ('containers',)
class OrchestrationPanels(horizon.PanelGroup):
slug = "orchestration"
name = _("Orchestration")
panels = ('stacks',
'stacks.resource_types',)
class DatabasePanels(horizon.PanelGroup):
slug = "database"
name = _("Database")
panels = ('databases',
'database_backups',)
class Project(horizon.Dashboard):
name = _("Project")
slug = "project"
panels = (
BasePanels,
NetworkPanels,
ObjectStorePanels,
OrchestrationPanels,
DatabasePanels,)
default_panel = 'overview'
horizon.register(Project)

View File

@ -16,14 +16,9 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Backups(horizon.Panel):
name = _("Backups")
slug = 'database_backups'
permissions = ('openstack.services.database',
'openstack.services.object-store',)
dashboard.Project.register(Backups)

View File

@ -16,13 +16,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Databases(horizon.Panel):
name = _("Instances")
slug = 'databases'
permissions = ('openstack.services.database',)
dashboard.Project.register(Databases)

View File

@ -17,7 +17,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import neutron
from openstack_dashboard.dashboards.project import dashboard
LOG = logging.getLogger(__name__)
@ -44,6 +43,3 @@ class Firewall(horizon.Panel):
if not super(Firewall, self).allowed(context):
return False
return True
dashboard.Project.register(Firewall)

View File

@ -17,13 +17,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Images(horizon.Panel):
name = _("Images")
slug = 'images'
permissions = ('openstack.services.image',)
dashboard.Project.register(Images)

View File

@ -16,13 +16,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Instances(horizon.Panel):
name = _("Instances")
slug = 'instances'
permissions = ('openstack.services.compute',)
dashboard.Project.register(Instances)

View File

@ -17,7 +17,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import neutron
from openstack_dashboard.dashboards.project import dashboard
LOG = logging.getLogger(__name__)
@ -44,6 +43,3 @@ class LoadBalancer(horizon.Panel):
if not super(LoadBalancer, self).allowed(context):
return False
return True
dashboard.Project.register(LoadBalancer)

View File

@ -20,13 +20,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class NetworkTopology(horizon.Panel):
name = _("Network Topology")
slug = 'network_topology'
permissions = ('openstack.services.network', )
dashboard.Project.register(NetworkTopology)

View File

@ -16,12 +16,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Networks(horizon.Panel):
name = _("Networks")
slug = 'networks'
permissions = ('openstack.services.network',)
dashboard.Project.register(Networks)

View File

@ -16,13 +16,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class NGImages(horizon.Panel):
name = _("Images")
slug = 'ngimages'
permissions = ('openstack.services.image',)
dashboard.Project.register(NGImages)

View File

@ -20,12 +20,7 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Overview(horizon.Panel):
name = _("Overview")
slug = 'overview'
dashboard.Project.register(Overview)

View File

@ -17,14 +17,13 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Routers(horizon.Panel):
name = _("Routers")
slug = 'routers'
permissions = ('openstack.services.network',)
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
if network_config.get('enable_router', True):
dashboard.Project.register(Routers)
@staticmethod
def can_register():
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
return network_config.get('enable_router', True)

View File

@ -14,12 +14,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Stacks(horizon.Panel):
name = _("Stacks")
slug = "stacks"
permissions = ('openstack.services.orchestration',)
dashboard.Project.register(Stacks)

View File

@ -15,12 +15,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class ResourceTypes(horizon.Panel):
name = _("Resource Types")
slug = "stacks.resource_types"
permissions = ('openstack.services.orchestration',)
dashboard.Project.register(ResourceTypes)

View File

@ -16,13 +16,8 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.project import dashboard
class Volumes(horizon.Panel):
name = _("Volumes")
slug = 'volumes'
permissions = ('openstack.services.volume',)
dashboard.Project.register(Volumes)

View File

@ -19,7 +19,6 @@ from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.api import neutron
from openstack_dashboard.dashboards.project import dashboard
LOG = logging.getLogger(__name__)
@ -46,6 +45,3 @@ class VPN(horizon.Panel):
if not super(VPN, self).allowed(context):
return False
return True
dashboard.Project.register(VPN)

View File

@ -0,0 +1,8 @@
from django.utils.translation import ugettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'compute'
# The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = _('Compute')
# The slug of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP_DASHBOARD = 'project'

View File

@ -0,0 +1,24 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'overview'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'compute'
# If set, it will update the default panel of the PANEL_DASHBOARD.
DEFAULT_PANEL = 'overview'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.overview.panel.Overview'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'instances'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'compute'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.instances.panel.Instances'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'volumes'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'compute'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.volumes.panel.Volumes'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'images'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'compute'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.images.panel.Images'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'access_and_security'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'compute'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.project.'
'access_and_security.panel.AccessAndSecurity')

View File

@ -0,0 +1,8 @@
from django.utils.translation import ugettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'network'
# The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = _('Network')
# The slug of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP_DASHBOARD = 'project'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'network_topology'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'network'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.project.'
'network_topology.panel.NetworkTopology')

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'networks'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'network'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.networks.panel.Networks'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'routers'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'network'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.routers.panel.Routers'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'loadbalancers'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'network'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.project.'
'loadbalancers.panel.LoadBalancer')

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'firewalls'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'network'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.firewalls.panel.Firewall'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'vpn'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'network'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.vpn.panel.VPN'

View File

@ -0,0 +1,8 @@
from django.utils.translation import ugettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'orchestration'
# The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = _('Ochestration')
# The slug of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP_DASHBOARD = 'project'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'stacks'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'orchestration'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.stacks.panel.Stacks'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'stacks.resource_types'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'orchestration'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.project.'
'stacks.resource_types.panel.ResourceTypes')

View File

@ -0,0 +1,8 @@
from django.utils.translation import ugettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'database'
# The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = _('Database')
# The slug of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP_DASHBOARD = 'project'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'databases'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'database'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.project.databases.panel.Databases'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'database_backups'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'database'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.project.'
'database_backups.panel.Backups')

View File

@ -0,0 +1,5 @@
from django.utils.translation import ugettext_lazy as _
PANEL_GROUP = 'object_store'
PANEL_GROUP_NAME = _('Object Store')
PANEL_GROUP_DASHBOARD = 'project'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'containers'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'object_store'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.project.'
'containers.panel.Containers')

View File

@ -0,0 +1,8 @@
from django.utils.translation import ugettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'admin'
# The display name of the PANEL_GROUP. Required.
PANEL_GROUP_NAME = _('System')
# The slug of the dashboard the PANEL_GROUP associated with. Required.
PANEL_GROUP_DASHBOARD = 'admin'

View File

@ -0,0 +1,23 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'overview'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# If set, it will update the default panel of the PANEL_DASHBOARD.
DEFAULT_PANEL = 'overview'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.overview.panel.Overview'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'metering'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.metering.panel.Metering'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'hypervisors'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.admin.'
'hypervisors.panel.Hypervisors')

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'aggregates'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.aggregates.panel.Aggregates'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'instances'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.instances.panel.Instances'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'volumes'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.volumes.panel.Volumes'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'flavors'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.flavors.panel.Flavors'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'images'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.images.panel.Images'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'networks'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.networks.panel.Networks'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'routers'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.routers.panel.Routers'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'defaults'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.defaults.panel.Defaults'

View File

@ -0,0 +1,10 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'metadata_defs'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = ('openstack_dashboard.dashboards.admin.'
'metadata_defs.panel.MetadataDefinitions')

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'info'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'admin'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'admin'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.admin.info.panel.Info'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'domains'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_GROUP = 'default'
# The slug of the panel group the PANEL is associated with.
PANEL_DASHBOARD = 'identity'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.identity.domains.panel.Domains'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'projects'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_GROUP = 'default'
# The slug of the panel group the PANEL is associated with.
PANEL_DASHBOARD = 'identity'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.identity.projects.panel.Tenants'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'users'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_GROUP = 'default'
# The slug of the panel group the PANEL is associated with.
PANEL_DASHBOARD = 'identity'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.identity.users.panel.Users'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'groups'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_GROUP = 'default'
# The slug of the panel group the PANEL is associated with.
PANEL_DASHBOARD = 'identity'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.identity.groups.panel.Groups'

View File

@ -0,0 +1,9 @@
# The slug of the panel to be added to HORIZON_CONFIG. Required.
PANEL = 'roles'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_GROUP = 'default'
# The slug of the panel group the PANEL is associated with.
PANEL_DASHBOARD = 'identity'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'openstack_dashboard.dashboards.identity.roles.panel.Roles'

View File

@ -0,0 +1,22 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import horizon
class NonloadingPanel(horizon.Panel):
name = "NonLoading Plugin Panel"
slug = 'nonloading'
@staticmethod
def can_register():
return False

View File

@ -0,0 +1,11 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}Nonloading Plugin-based Panel{% endblock %}
{% block main %}
<div class="row">
<div class="col-sm-12">
Nonloading Plugin-based Panel
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,21 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_dashboard.test.test_panels.nonloading_panel import views
urlpatterns = patterns(
'',
url(r'^$', views.IndexView.as_view(), name='index'),
)

View File

@ -0,0 +1,18 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from horizon import views
class IndexView(views.HorizonTemplateView):
template_name = 'admin/nonloading_panel/index.html'
page_title = 'Nonloading Plugin-based Panel'

Some files were not shown because too many files have changed in this diff Show More