From 8303782f1e67c00f3000acf12773a7df7581fc61 Mon Sep 17 00:00:00 2001 From: David Lyle Date: Mon, 3 Aug 2015 14:23:42 -0600 Subject: [PATCH] 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 --- horizon/base.py | 20 ++++++++ .../dashboards/admin/aggregates/panel.py | 4 -- .../dashboards/admin/dashboard.py | 10 ---- .../dashboards/admin/defaults/panel.py | 5 -- .../dashboards/admin/flavors/panel.py | 5 -- .../dashboards/admin/hypervisors/panel.py | 4 -- .../dashboards/admin/images/panel.py | 5 -- .../dashboards/admin/info/panel.py | 5 -- .../dashboards/admin/instances/panel.py | 5 -- .../dashboards/admin/metadata_defs/panel.py | 7 ++- .../dashboards/admin/metering/panel.py | 4 -- .../dashboards/admin/networks/panel.py | 4 -- .../dashboards/admin/routers/panel.py | 9 ++-- .../dashboards/admin/volumes/panel.py | 5 -- .../dashboards/identity/dashboard.py | 1 - .../dashboards/identity/domains/panel.py | 7 ++- .../dashboards/identity/groups/panel.py | 7 ++- .../dashboards/identity/projects/panel.py | 5 -- .../dashboards/identity/roles/panel.py | 7 ++- .../dashboards/identity/users/panel.py | 5 -- .../project/access_and_security/panel.py | 5 -- .../dashboards/project/containers/panel.py | 4 -- .../dashboards/project/dashboard.py | 48 ------------------- .../project/database_backups/panel.py | 5 -- .../dashboards/project/databases/panel.py | 5 -- .../dashboards/project/firewalls/panel.py | 4 -- .../dashboards/project/images/panel.py | 5 -- .../dashboards/project/instances/panel.py | 5 -- .../dashboards/project/loadbalancers/panel.py | 4 -- .../project/network_topology/panel.py | 5 -- .../dashboards/project/networks/panel.py | 4 -- .../dashboards/project/ngimages/panel.py | 5 -- .../dashboards/project/overview/panel.py | 5 -- .../dashboards/project/routers/panel.py | 9 ++-- .../dashboards/project/stacks/panel.py | 4 -- .../project/stacks/resource_types/panel.py | 4 -- .../dashboards/project/volumes/panel.py | 5 -- .../dashboards/project/vpn/panel.py | 4 -- .../{_10_project.py => _1000_project.py} | 0 .../enabled/_1010_compute_panel_group.py | 8 ++++ .../enabled/_1020_project_overview_panel.py | 24 ++++++++++ .../enabled/_1030_project_instances_panel.py | 9 ++++ .../enabled/_1040_project_volumes_panel.py | 9 ++++ .../enabled/_1050_project_images_panel.py | 9 ++++ ...el.py => _1051_project_ng_images_panel.py} | 0 .../enabled/_1060_project_access_panel.py | 10 ++++ .../enabled/_1410_network_panel_group.py | 8 ++++ .../_1420_project_network_topology_panel.py | 10 ++++ .../enabled/_1430_project_network_panel.py | 9 ++++ .../enabled/_1440_project_routers_panel.py | 9 ++++ .../_1450_project_loadbalancers_panel.py | 10 ++++ .../enabled/_1460_project_firewalls_panel.py | 9 ++++ .../enabled/_1470_project_vpn_panel.py | 9 ++++ .../_1610_orchestration_panel_group.py | 8 ++++ .../enabled/_1620_project_stacks_panel.py | 9 ++++ .../_1630_project_resource_types_panel.py | 10 ++++ .../enabled/_1710_database_panel_group.py | 8 ++++ .../enabled/_1720_project_databases_panel.py | 9 ++++ .../_1730_project_database_backups_panel.py | 10 ++++ ...y => _1810_data_processing_panel_group.py} | 0 ... => _1815_data_processing_wizard_panel.py} | 0 ...> _1820_data_processing_clusters_panel.py} | 0 ...5_data_processing_job_executions_panel.py} | 0 ...ata_processing_cluster_templates_panel.py} | 0 ...a_processing_nodegroup_templates_panel.py} | 0 ...py => _1840_data_processing_jobs_panel.py} | 0 ...845_data_processing_job_binaries_panel.py} | 0 ...850_data_processing_data_sources_panel.py} | 0 ...a_processing_data_image_registry_panel.py} | 0 ...860_data_processing_data_plugins_panel.py} | 0 .../enabled/_1910_object_store_panel_group.py | 5 ++ .../enabled/_1920_project_containers_panel.py | 10 ++++ .../enabled/{_20_admin.py => _2000_admin.py} | 0 .../enabled/_2010_admin_system_panel_group.py | 8 ++++ .../enabled/_2020_admin_overview_panel.py | 23 +++++++++ .../enabled/_2030_admin_metering_panel.py | 9 ++++ .../enabled/_2040_admin_hypervisors_panel.py | 10 ++++ .../enabled/_2050_admin_aggregates_panel.py | 9 ++++ .../enabled/_2060_admin_instances_panel.py | 9 ++++ .../enabled/_2070_admin_volumes_panel.py | 9 ++++ .../enabled/_2080_admin_flavors_panel.py | 9 ++++ .../enabled/_2090_admin_images_panel.py | 9 ++++ .../enabled/_2100_admin_networks_panel.py | 9 ++++ .../enabled/_2110_admin_routers_panel.py | 9 ++++ .../enabled/_2120_admin_defaults_panel.py | 9 ++++ .../_2130_admin_metadata_defs_panel.py | 10 ++++ .../enabled/_2140_admin_info_panel.py | 9 ++++ .../{_25_identity.py => _3000_identity.py} | 0 .../enabled/_3010_identity_domains_panel.py | 9 ++++ .../enabled/_3020_identity_projects_panel.py | 9 ++++ .../enabled/_3030_identity_users_panel.py | 9 ++++ ...panel.py => _3031_identity_users_panel.py} | 0 .../enabled/_3040_identity_groups_panel.py | 9 ++++ .../enabled/_3050_identity_roles_panel.py | 9 ++++ .../{_30_settings.py => _5000_settings.py} | 0 .../test_panels/nonloading_panel/__init__.py | 0 .../test_panels/nonloading_panel/panel.py | 22 +++++++++ .../templates/nonloading_panel/index.html | 11 +++++ .../test/test_panels/nonloading_panel/urls.py | 21 ++++++++ .../test_panels/nonloading_panel/views.py | 18 +++++++ .../test/test_panels/second_panel/panel.py | 4 ++ .../_40_admin_nonloading_panel.py | 13 +++++ .../test/test_plugins/panel_tests.py | 7 +++ 103 files changed, 524 insertions(+), 214 deletions(-) rename openstack_dashboard/enabled/{_10_project.py => _1000_project.py} (100%) create mode 100644 openstack_dashboard/enabled/_1010_compute_panel_group.py create mode 100644 openstack_dashboard/enabled/_1020_project_overview_panel.py create mode 100644 openstack_dashboard/enabled/_1030_project_instances_panel.py create mode 100644 openstack_dashboard/enabled/_1040_project_volumes_panel.py create mode 100644 openstack_dashboard/enabled/_1050_project_images_panel.py rename openstack_dashboard/enabled/{_203_project_images_panel.py => _1051_project_ng_images_panel.py} (100%) create mode 100644 openstack_dashboard/enabled/_1060_project_access_panel.py create mode 100644 openstack_dashboard/enabled/_1410_network_panel_group.py create mode 100644 openstack_dashboard/enabled/_1420_project_network_topology_panel.py create mode 100644 openstack_dashboard/enabled/_1430_project_network_panel.py create mode 100644 openstack_dashboard/enabled/_1440_project_routers_panel.py create mode 100644 openstack_dashboard/enabled/_1450_project_loadbalancers_panel.py create mode 100644 openstack_dashboard/enabled/_1460_project_firewalls_panel.py create mode 100644 openstack_dashboard/enabled/_1470_project_vpn_panel.py create mode 100644 openstack_dashboard/enabled/_1610_orchestration_panel_group.py create mode 100644 openstack_dashboard/enabled/_1620_project_stacks_panel.py create mode 100644 openstack_dashboard/enabled/_1630_project_resource_types_panel.py create mode 100644 openstack_dashboard/enabled/_1710_database_panel_group.py create mode 100644 openstack_dashboard/enabled/_1720_project_databases_panel.py create mode 100644 openstack_dashboard/enabled/_1730_project_database_backups_panel.py rename openstack_dashboard/enabled/{_100_data_processing_panel_group.py => _1810_data_processing_panel_group.py} (100%) rename openstack_dashboard/enabled/{_101_data_processing_wizard_panel.py => _1815_data_processing_wizard_panel.py} (100%) rename openstack_dashboard/enabled/{_102_data_processing_clusters_panel.py => _1820_data_processing_clusters_panel.py} (100%) rename openstack_dashboard/enabled/{_103_data_processing_job_executions_panel.py => _1825_data_processing_job_executions_panel.py} (100%) rename openstack_dashboard/enabled/{_104_data_processing_cluster_templates_panel.py => _1830_data_processing_cluster_templates_panel.py} (100%) rename openstack_dashboard/enabled/{_105_data_processing_nodegroup_templates_panel.py => _1835_data_processing_nodegroup_templates_panel.py} (100%) rename openstack_dashboard/enabled/{_106_data_processing_jobs_panel.py => _1840_data_processing_jobs_panel.py} (100%) rename openstack_dashboard/enabled/{_107_data_processing_job_binaries_panel.py => _1845_data_processing_job_binaries_panel.py} (100%) rename openstack_dashboard/enabled/{_108_data_processing_data_sources_panel.py => _1850_data_processing_data_sources_panel.py} (100%) rename openstack_dashboard/enabled/{_109_data_processing_data_image_registry_panel.py => _1855_data_processing_data_image_registry_panel.py} (100%) rename openstack_dashboard/enabled/{_110_data_processing_data_plugins_panel.py => _1860_data_processing_data_plugins_panel.py} (100%) create mode 100644 openstack_dashboard/enabled/_1910_object_store_panel_group.py create mode 100644 openstack_dashboard/enabled/_1920_project_containers_panel.py rename openstack_dashboard/enabled/{_20_admin.py => _2000_admin.py} (100%) create mode 100644 openstack_dashboard/enabled/_2010_admin_system_panel_group.py create mode 100644 openstack_dashboard/enabled/_2020_admin_overview_panel.py create mode 100644 openstack_dashboard/enabled/_2030_admin_metering_panel.py create mode 100644 openstack_dashboard/enabled/_2040_admin_hypervisors_panel.py create mode 100644 openstack_dashboard/enabled/_2050_admin_aggregates_panel.py create mode 100644 openstack_dashboard/enabled/_2060_admin_instances_panel.py create mode 100644 openstack_dashboard/enabled/_2070_admin_volumes_panel.py create mode 100644 openstack_dashboard/enabled/_2080_admin_flavors_panel.py create mode 100644 openstack_dashboard/enabled/_2090_admin_images_panel.py create mode 100644 openstack_dashboard/enabled/_2100_admin_networks_panel.py create mode 100644 openstack_dashboard/enabled/_2110_admin_routers_panel.py create mode 100644 openstack_dashboard/enabled/_2120_admin_defaults_panel.py create mode 100644 openstack_dashboard/enabled/_2130_admin_metadata_defs_panel.py create mode 100644 openstack_dashboard/enabled/_2140_admin_info_panel.py rename openstack_dashboard/enabled/{_25_identity.py => _3000_identity.py} (100%) create mode 100644 openstack_dashboard/enabled/_3010_identity_domains_panel.py create mode 100644 openstack_dashboard/enabled/_3020_identity_projects_panel.py create mode 100644 openstack_dashboard/enabled/_3030_identity_users_panel.py rename openstack_dashboard/enabled/{_250_identity_users_panel.py => _3031_identity_users_panel.py} (100%) create mode 100644 openstack_dashboard/enabled/_3040_identity_groups_panel.py create mode 100644 openstack_dashboard/enabled/_3050_identity_roles_panel.py rename openstack_dashboard/enabled/{_30_settings.py => _5000_settings.py} (100%) create mode 100644 openstack_dashboard/test/test_panels/nonloading_panel/__init__.py create mode 100644 openstack_dashboard/test/test_panels/nonloading_panel/panel.py create mode 100644 openstack_dashboard/test/test_panels/nonloading_panel/templates/nonloading_panel/index.html create mode 100644 openstack_dashboard/test/test_panels/nonloading_panel/urls.py create mode 100644 openstack_dashboard/test/test_panels/nonloading_panel/views.py create mode 100644 openstack_dashboard/test/test_plugins/panel_config/_40_admin_nonloading_panel.py diff --git a/horizon/base.py b/horizon/base.py index ced053728c..f5d895e18b 100644 --- a/horizon/base.py +++ b/horizon/base.py @@ -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).\ diff --git a/openstack_dashboard/dashboards/admin/aggregates/panel.py b/openstack_dashboard/dashboards/admin/aggregates/panel.py index b153afb116..fd9cfd8c80 100644 --- a/openstack_dashboard/dashboards/admin/aggregates/panel.py +++ b/openstack_dashboard/dashboards/admin/aggregates/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/dashboard.py b/openstack_dashboard/dashboards/admin/dashboard.py index f6f031c169..c8cdc63db9 100644 --- a/openstack_dashboard/dashboards/admin/dashboard.py +++ b/openstack_dashboard/dashboards/admin/dashboard.py @@ -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',) diff --git a/openstack_dashboard/dashboards/admin/defaults/panel.py b/openstack_dashboard/dashboards/admin/defaults/panel.py index 56fe532acb..7a222a2139 100644 --- a/openstack_dashboard/dashboards/admin/defaults/panel.py +++ b/openstack_dashboard/dashboards/admin/defaults/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/flavors/panel.py b/openstack_dashboard/dashboards/admin/flavors/panel.py index b2d0e4e8d7..d8ba030324 100644 --- a/openstack_dashboard/dashboards/admin/flavors/panel.py +++ b/openstack_dashboard/dashboards/admin/flavors/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/hypervisors/panel.py b/openstack_dashboard/dashboards/admin/hypervisors/panel.py index 7e5d27533c..c1f8edd709 100644 --- a/openstack_dashboard/dashboards/admin/hypervisors/panel.py +++ b/openstack_dashboard/dashboards/admin/hypervisors/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/images/panel.py b/openstack_dashboard/dashboards/admin/images/panel.py index 5983aa6a4c..1171211f9f 100644 --- a/openstack_dashboard/dashboards/admin/images/panel.py +++ b/openstack_dashboard/dashboards/admin/images/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/info/panel.py b/openstack_dashboard/dashboards/admin/info/panel.py index 8f626e63e7..9c5fe7a05c 100644 --- a/openstack_dashboard/dashboards/admin/info/panel.py +++ b/openstack_dashboard/dashboards/admin/info/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/instances/panel.py b/openstack_dashboard/dashboards/admin/instances/panel.py index 39a0047a7a..23a040180a 100644 --- a/openstack_dashboard/dashboards/admin/instances/panel.py +++ b/openstack_dashboard/dashboards/admin/instances/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/metadata_defs/panel.py b/openstack_dashboard/dashboards/admin/metadata_defs/panel.py index b9dc7e5746..2e1cd8a05a 100644 --- a/openstack_dashboard/dashboards/admin/metadata_defs/panel.py +++ b/openstack_dashboard/dashboards/admin/metadata_defs/panel.py @@ -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 diff --git a/openstack_dashboard/dashboards/admin/metering/panel.py b/openstack_dashboard/dashboards/admin/metering/panel.py index cda6225acb..14dfebe98e 100644 --- a/openstack_dashboard/dashboards/admin/metering/panel.py +++ b/openstack_dashboard/dashboards/admin/metering/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/networks/panel.py b/openstack_dashboard/dashboards/admin/networks/panel.py index 49f9f7a1c5..43976ec1d3 100644 --- a/openstack_dashboard/dashboards/admin/networks/panel.py +++ b/openstack_dashboard/dashboards/admin/networks/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/routers/panel.py b/openstack_dashboard/dashboards/admin/routers/panel.py index 5a52cb8db5..fa7b159c42 100644 --- a/openstack_dashboard/dashboards/admin/routers/panel.py +++ b/openstack_dashboard/dashboards/admin/routers/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/admin/volumes/panel.py b/openstack_dashboard/dashboards/admin/volumes/panel.py index 8a80057751..8877641df3 100644 --- a/openstack_dashboard/dashboards/admin/volumes/panel.py +++ b/openstack_dashboard/dashboards/admin/volumes/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/identity/dashboard.py b/openstack_dashboard/dashboards/identity/dashboard.py index 6b02140451..a5b9e640ec 100644 --- a/openstack_dashboard/dashboards/identity/dashboard.py +++ b/openstack_dashboard/dashboards/identity/dashboard.py @@ -22,7 +22,6 @@ class Identity(horizon.Dashboard): name = _("Identity") slug = "identity" default_panel = 'projects' - panels = ('domains', 'projects', 'users', 'groups', 'roles',) horizon.register(Identity) diff --git a/openstack_dashboard/dashboards/identity/domains/panel.py b/openstack_dashboard/dashboards/identity/domains/panel.py index e5c1cb7b75..ee8705eb3a 100644 --- a/openstack_dashboard/dashboards/identity/domains/panel.py +++ b/openstack_dashboard/dashboards/identity/domains/panel.py @@ -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 diff --git a/openstack_dashboard/dashboards/identity/groups/panel.py b/openstack_dashboard/dashboards/identity/groups/panel.py index 301ba124eb..458dcb1146 100644 --- a/openstack_dashboard/dashboards/identity/groups/panel.py +++ b/openstack_dashboard/dashboards/identity/groups/panel.py @@ -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 diff --git a/openstack_dashboard/dashboards/identity/projects/panel.py b/openstack_dashboard/dashboards/identity/projects/panel.py index 595f3a2fb8..26a34f2247 100644 --- a/openstack_dashboard/dashboards/identity/projects/panel.py +++ b/openstack_dashboard/dashboards/identity/projects/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/identity/roles/panel.py b/openstack_dashboard/dashboards/identity/roles/panel.py index cc1a2a3e15..43bca73e85 100644 --- a/openstack_dashboard/dashboards/identity/roles/panel.py +++ b/openstack_dashboard/dashboards/identity/roles/panel.py @@ -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 diff --git a/openstack_dashboard/dashboards/identity/users/panel.py b/openstack_dashboard/dashboards/identity/users/panel.py index 465994c573..7c5b7b8968 100644 --- a/openstack_dashboard/dashboards/identity/users/panel.py +++ b/openstack_dashboard/dashboards/identity/users/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/access_and_security/panel.py b/openstack_dashboard/dashboards/project/access_and_security/panel.py index c71e31e71b..d8a7b01dc6 100644 --- a/openstack_dashboard/dashboards/project/access_and_security/panel.py +++ b/openstack_dashboard/dashboards/project/access_and_security/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/containers/panel.py b/openstack_dashboard/dashboards/project/containers/panel.py index 6cd83ae19a..d71d2435ec 100644 --- a/openstack_dashboard/dashboards/project/containers/panel.py +++ b/openstack_dashboard/dashboards/project/containers/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/dashboard.py b/openstack_dashboard/dashboards/project/dashboard.py index 9bd6c5fe5f..e3995e21f1 100644 --- a/openstack_dashboard/dashboards/project/dashboard.py +++ b/openstack_dashboard/dashboards/project/dashboard.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/database_backups/panel.py b/openstack_dashboard/dashboards/project/database_backups/panel.py index 0b31f204e8..0e3d6f9497 100644 --- a/openstack_dashboard/dashboards/project/database_backups/panel.py +++ b/openstack_dashboard/dashboards/project/database_backups/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/databases/panel.py b/openstack_dashboard/dashboards/project/databases/panel.py index 2dd81cdd40..9180477717 100644 --- a/openstack_dashboard/dashboards/project/databases/panel.py +++ b/openstack_dashboard/dashboards/project/databases/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/firewalls/panel.py b/openstack_dashboard/dashboards/project/firewalls/panel.py index e6ff6ee47d..1e916a6c60 100644 --- a/openstack_dashboard/dashboards/project/firewalls/panel.py +++ b/openstack_dashboard/dashboards/project/firewalls/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/images/panel.py b/openstack_dashboard/dashboards/project/images/panel.py index 7203f506d3..ae7e9d5fcd 100644 --- a/openstack_dashboard/dashboards/project/images/panel.py +++ b/openstack_dashboard/dashboards/project/images/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/instances/panel.py b/openstack_dashboard/dashboards/project/instances/panel.py index acade3c519..085b9e99dc 100644 --- a/openstack_dashboard/dashboards/project/instances/panel.py +++ b/openstack_dashboard/dashboards/project/instances/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/loadbalancers/panel.py b/openstack_dashboard/dashboards/project/loadbalancers/panel.py index 29494d3404..3174ceb8a6 100644 --- a/openstack_dashboard/dashboards/project/loadbalancers/panel.py +++ b/openstack_dashboard/dashboards/project/loadbalancers/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/network_topology/panel.py b/openstack_dashboard/dashboards/project/network_topology/panel.py index 014f2d0cd4..593530dd4c 100644 --- a/openstack_dashboard/dashboards/project/network_topology/panel.py +++ b/openstack_dashboard/dashboards/project/network_topology/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/networks/panel.py b/openstack_dashboard/dashboards/project/networks/panel.py index 627fa31c9e..43976ec1d3 100644 --- a/openstack_dashboard/dashboards/project/networks/panel.py +++ b/openstack_dashboard/dashboards/project/networks/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/ngimages/panel.py b/openstack_dashboard/dashboards/project/ngimages/panel.py index 0a3708b921..93e1833d7a 100644 --- a/openstack_dashboard/dashboards/project/ngimages/panel.py +++ b/openstack_dashboard/dashboards/project/ngimages/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/overview/panel.py b/openstack_dashboard/dashboards/project/overview/panel.py index 0a555b4254..d856021f08 100644 --- a/openstack_dashboard/dashboards/project/overview/panel.py +++ b/openstack_dashboard/dashboards/project/overview/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/routers/panel.py b/openstack_dashboard/dashboards/project/routers/panel.py index e2ea70e537..fa7b159c42 100644 --- a/openstack_dashboard/dashboards/project/routers/panel.py +++ b/openstack_dashboard/dashboards/project/routers/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/stacks/panel.py b/openstack_dashboard/dashboards/project/stacks/panel.py index 6fecbe4554..f9e8800381 100644 --- a/openstack_dashboard/dashboards/project/stacks/panel.py +++ b/openstack_dashboard/dashboards/project/stacks/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/stacks/resource_types/panel.py b/openstack_dashboard/dashboards/project/stacks/resource_types/panel.py index 78aba43694..0410aff7c2 100644 --- a/openstack_dashboard/dashboards/project/stacks/resource_types/panel.py +++ b/openstack_dashboard/dashboards/project/stacks/resource_types/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/volumes/panel.py b/openstack_dashboard/dashboards/project/volumes/panel.py index 879035e24d..0280de720c 100644 --- a/openstack_dashboard/dashboards/project/volumes/panel.py +++ b/openstack_dashboard/dashboards/project/volumes/panel.py @@ -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) diff --git a/openstack_dashboard/dashboards/project/vpn/panel.py b/openstack_dashboard/dashboards/project/vpn/panel.py index 5577671f00..9ce2fc2de8 100644 --- a/openstack_dashboard/dashboards/project/vpn/panel.py +++ b/openstack_dashboard/dashboards/project/vpn/panel.py @@ -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) diff --git a/openstack_dashboard/enabled/_10_project.py b/openstack_dashboard/enabled/_1000_project.py similarity index 100% rename from openstack_dashboard/enabled/_10_project.py rename to openstack_dashboard/enabled/_1000_project.py diff --git a/openstack_dashboard/enabled/_1010_compute_panel_group.py b/openstack_dashboard/enabled/_1010_compute_panel_group.py new file mode 100644 index 0000000000..c90bc8850a --- /dev/null +++ b/openstack_dashboard/enabled/_1010_compute_panel_group.py @@ -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' diff --git a/openstack_dashboard/enabled/_1020_project_overview_panel.py b/openstack_dashboard/enabled/_1020_project_overview_panel.py new file mode 100644 index 0000000000..5ee55ac0fc --- /dev/null +++ b/openstack_dashboard/enabled/_1020_project_overview_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1030_project_instances_panel.py b/openstack_dashboard/enabled/_1030_project_instances_panel.py new file mode 100644 index 0000000000..dd23963fc1 --- /dev/null +++ b/openstack_dashboard/enabled/_1030_project_instances_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1040_project_volumes_panel.py b/openstack_dashboard/enabled/_1040_project_volumes_panel.py new file mode 100644 index 0000000000..5f92f42a8c --- /dev/null +++ b/openstack_dashboard/enabled/_1040_project_volumes_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1050_project_images_panel.py b/openstack_dashboard/enabled/_1050_project_images_panel.py new file mode 100644 index 0000000000..503357788b --- /dev/null +++ b/openstack_dashboard/enabled/_1050_project_images_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_203_project_images_panel.py b/openstack_dashboard/enabled/_1051_project_ng_images_panel.py similarity index 100% rename from openstack_dashboard/enabled/_203_project_images_panel.py rename to openstack_dashboard/enabled/_1051_project_ng_images_panel.py diff --git a/openstack_dashboard/enabled/_1060_project_access_panel.py b/openstack_dashboard/enabled/_1060_project_access_panel.py new file mode 100644 index 0000000000..6ef2538c7d --- /dev/null +++ b/openstack_dashboard/enabled/_1060_project_access_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_1410_network_panel_group.py b/openstack_dashboard/enabled/_1410_network_panel_group.py new file mode 100644 index 0000000000..7dba5a04af --- /dev/null +++ b/openstack_dashboard/enabled/_1410_network_panel_group.py @@ -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' diff --git a/openstack_dashboard/enabled/_1420_project_network_topology_panel.py b/openstack_dashboard/enabled/_1420_project_network_topology_panel.py new file mode 100644 index 0000000000..5776840971 --- /dev/null +++ b/openstack_dashboard/enabled/_1420_project_network_topology_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_1430_project_network_panel.py b/openstack_dashboard/enabled/_1430_project_network_panel.py new file mode 100644 index 0000000000..a5faf0dd8e --- /dev/null +++ b/openstack_dashboard/enabled/_1430_project_network_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1440_project_routers_panel.py b/openstack_dashboard/enabled/_1440_project_routers_panel.py new file mode 100644 index 0000000000..7338b34cd5 --- /dev/null +++ b/openstack_dashboard/enabled/_1440_project_routers_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1450_project_loadbalancers_panel.py b/openstack_dashboard/enabled/_1450_project_loadbalancers_panel.py new file mode 100644 index 0000000000..1aa8311a75 --- /dev/null +++ b/openstack_dashboard/enabled/_1450_project_loadbalancers_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_1460_project_firewalls_panel.py b/openstack_dashboard/enabled/_1460_project_firewalls_panel.py new file mode 100644 index 0000000000..5465422448 --- /dev/null +++ b/openstack_dashboard/enabled/_1460_project_firewalls_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1470_project_vpn_panel.py b/openstack_dashboard/enabled/_1470_project_vpn_panel.py new file mode 100644 index 0000000000..135f019f27 --- /dev/null +++ b/openstack_dashboard/enabled/_1470_project_vpn_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1610_orchestration_panel_group.py b/openstack_dashboard/enabled/_1610_orchestration_panel_group.py new file mode 100644 index 0000000000..bd762ec057 --- /dev/null +++ b/openstack_dashboard/enabled/_1610_orchestration_panel_group.py @@ -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' diff --git a/openstack_dashboard/enabled/_1620_project_stacks_panel.py b/openstack_dashboard/enabled/_1620_project_stacks_panel.py new file mode 100644 index 0000000000..b044fcca9d --- /dev/null +++ b/openstack_dashboard/enabled/_1620_project_stacks_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1630_project_resource_types_panel.py b/openstack_dashboard/enabled/_1630_project_resource_types_panel.py new file mode 100644 index 0000000000..8b048924f5 --- /dev/null +++ b/openstack_dashboard/enabled/_1630_project_resource_types_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_1710_database_panel_group.py b/openstack_dashboard/enabled/_1710_database_panel_group.py new file mode 100644 index 0000000000..86574b29aa --- /dev/null +++ b/openstack_dashboard/enabled/_1710_database_panel_group.py @@ -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' diff --git a/openstack_dashboard/enabled/_1720_project_databases_panel.py b/openstack_dashboard/enabled/_1720_project_databases_panel.py new file mode 100644 index 0000000000..1c40a34267 --- /dev/null +++ b/openstack_dashboard/enabled/_1720_project_databases_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_1730_project_database_backups_panel.py b/openstack_dashboard/enabled/_1730_project_database_backups_panel.py new file mode 100644 index 0000000000..d3d1ae55b0 --- /dev/null +++ b/openstack_dashboard/enabled/_1730_project_database_backups_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_100_data_processing_panel_group.py b/openstack_dashboard/enabled/_1810_data_processing_panel_group.py similarity index 100% rename from openstack_dashboard/enabled/_100_data_processing_panel_group.py rename to openstack_dashboard/enabled/_1810_data_processing_panel_group.py diff --git a/openstack_dashboard/enabled/_101_data_processing_wizard_panel.py b/openstack_dashboard/enabled/_1815_data_processing_wizard_panel.py similarity index 100% rename from openstack_dashboard/enabled/_101_data_processing_wizard_panel.py rename to openstack_dashboard/enabled/_1815_data_processing_wizard_panel.py diff --git a/openstack_dashboard/enabled/_102_data_processing_clusters_panel.py b/openstack_dashboard/enabled/_1820_data_processing_clusters_panel.py similarity index 100% rename from openstack_dashboard/enabled/_102_data_processing_clusters_panel.py rename to openstack_dashboard/enabled/_1820_data_processing_clusters_panel.py diff --git a/openstack_dashboard/enabled/_103_data_processing_job_executions_panel.py b/openstack_dashboard/enabled/_1825_data_processing_job_executions_panel.py similarity index 100% rename from openstack_dashboard/enabled/_103_data_processing_job_executions_panel.py rename to openstack_dashboard/enabled/_1825_data_processing_job_executions_panel.py diff --git a/openstack_dashboard/enabled/_104_data_processing_cluster_templates_panel.py b/openstack_dashboard/enabled/_1830_data_processing_cluster_templates_panel.py similarity index 100% rename from openstack_dashboard/enabled/_104_data_processing_cluster_templates_panel.py rename to openstack_dashboard/enabled/_1830_data_processing_cluster_templates_panel.py diff --git a/openstack_dashboard/enabled/_105_data_processing_nodegroup_templates_panel.py b/openstack_dashboard/enabled/_1835_data_processing_nodegroup_templates_panel.py similarity index 100% rename from openstack_dashboard/enabled/_105_data_processing_nodegroup_templates_panel.py rename to openstack_dashboard/enabled/_1835_data_processing_nodegroup_templates_panel.py diff --git a/openstack_dashboard/enabled/_106_data_processing_jobs_panel.py b/openstack_dashboard/enabled/_1840_data_processing_jobs_panel.py similarity index 100% rename from openstack_dashboard/enabled/_106_data_processing_jobs_panel.py rename to openstack_dashboard/enabled/_1840_data_processing_jobs_panel.py diff --git a/openstack_dashboard/enabled/_107_data_processing_job_binaries_panel.py b/openstack_dashboard/enabled/_1845_data_processing_job_binaries_panel.py similarity index 100% rename from openstack_dashboard/enabled/_107_data_processing_job_binaries_panel.py rename to openstack_dashboard/enabled/_1845_data_processing_job_binaries_panel.py diff --git a/openstack_dashboard/enabled/_108_data_processing_data_sources_panel.py b/openstack_dashboard/enabled/_1850_data_processing_data_sources_panel.py similarity index 100% rename from openstack_dashboard/enabled/_108_data_processing_data_sources_panel.py rename to openstack_dashboard/enabled/_1850_data_processing_data_sources_panel.py diff --git a/openstack_dashboard/enabled/_109_data_processing_data_image_registry_panel.py b/openstack_dashboard/enabled/_1855_data_processing_data_image_registry_panel.py similarity index 100% rename from openstack_dashboard/enabled/_109_data_processing_data_image_registry_panel.py rename to openstack_dashboard/enabled/_1855_data_processing_data_image_registry_panel.py diff --git a/openstack_dashboard/enabled/_110_data_processing_data_plugins_panel.py b/openstack_dashboard/enabled/_1860_data_processing_data_plugins_panel.py similarity index 100% rename from openstack_dashboard/enabled/_110_data_processing_data_plugins_panel.py rename to openstack_dashboard/enabled/_1860_data_processing_data_plugins_panel.py diff --git a/openstack_dashboard/enabled/_1910_object_store_panel_group.py b/openstack_dashboard/enabled/_1910_object_store_panel_group.py new file mode 100644 index 0000000000..11a8231892 --- /dev/null +++ b/openstack_dashboard/enabled/_1910_object_store_panel_group.py @@ -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' diff --git a/openstack_dashboard/enabled/_1920_project_containers_panel.py b/openstack_dashboard/enabled/_1920_project_containers_panel.py new file mode 100644 index 0000000000..1332b1d4c5 --- /dev/null +++ b/openstack_dashboard/enabled/_1920_project_containers_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_20_admin.py b/openstack_dashboard/enabled/_2000_admin.py similarity index 100% rename from openstack_dashboard/enabled/_20_admin.py rename to openstack_dashboard/enabled/_2000_admin.py diff --git a/openstack_dashboard/enabled/_2010_admin_system_panel_group.py b/openstack_dashboard/enabled/_2010_admin_system_panel_group.py new file mode 100644 index 0000000000..b0f70158d5 --- /dev/null +++ b/openstack_dashboard/enabled/_2010_admin_system_panel_group.py @@ -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' diff --git a/openstack_dashboard/enabled/_2020_admin_overview_panel.py b/openstack_dashboard/enabled/_2020_admin_overview_panel.py new file mode 100644 index 0000000000..8538f2b3ee --- /dev/null +++ b/openstack_dashboard/enabled/_2020_admin_overview_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2030_admin_metering_panel.py b/openstack_dashboard/enabled/_2030_admin_metering_panel.py new file mode 100644 index 0000000000..7ca2ddd2ee --- /dev/null +++ b/openstack_dashboard/enabled/_2030_admin_metering_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2040_admin_hypervisors_panel.py b/openstack_dashboard/enabled/_2040_admin_hypervisors_panel.py new file mode 100644 index 0000000000..db9d689e33 --- /dev/null +++ b/openstack_dashboard/enabled/_2040_admin_hypervisors_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_2050_admin_aggregates_panel.py b/openstack_dashboard/enabled/_2050_admin_aggregates_panel.py new file mode 100644 index 0000000000..c908304b97 --- /dev/null +++ b/openstack_dashboard/enabled/_2050_admin_aggregates_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2060_admin_instances_panel.py b/openstack_dashboard/enabled/_2060_admin_instances_panel.py new file mode 100644 index 0000000000..78a7883909 --- /dev/null +++ b/openstack_dashboard/enabled/_2060_admin_instances_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2070_admin_volumes_panel.py b/openstack_dashboard/enabled/_2070_admin_volumes_panel.py new file mode 100644 index 0000000000..204762076c --- /dev/null +++ b/openstack_dashboard/enabled/_2070_admin_volumes_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2080_admin_flavors_panel.py b/openstack_dashboard/enabled/_2080_admin_flavors_panel.py new file mode 100644 index 0000000000..ee4001895a --- /dev/null +++ b/openstack_dashboard/enabled/_2080_admin_flavors_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2090_admin_images_panel.py b/openstack_dashboard/enabled/_2090_admin_images_panel.py new file mode 100644 index 0000000000..1340113ac4 --- /dev/null +++ b/openstack_dashboard/enabled/_2090_admin_images_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2100_admin_networks_panel.py b/openstack_dashboard/enabled/_2100_admin_networks_panel.py new file mode 100644 index 0000000000..d4323a06af --- /dev/null +++ b/openstack_dashboard/enabled/_2100_admin_networks_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2110_admin_routers_panel.py b/openstack_dashboard/enabled/_2110_admin_routers_panel.py new file mode 100644 index 0000000000..3c2c635b27 --- /dev/null +++ b/openstack_dashboard/enabled/_2110_admin_routers_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2120_admin_defaults_panel.py b/openstack_dashboard/enabled/_2120_admin_defaults_panel.py new file mode 100644 index 0000000000..92244c53cf --- /dev/null +++ b/openstack_dashboard/enabled/_2120_admin_defaults_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_2130_admin_metadata_defs_panel.py b/openstack_dashboard/enabled/_2130_admin_metadata_defs_panel.py new file mode 100644 index 0000000000..0977ef4bdc --- /dev/null +++ b/openstack_dashboard/enabled/_2130_admin_metadata_defs_panel.py @@ -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') diff --git a/openstack_dashboard/enabled/_2140_admin_info_panel.py b/openstack_dashboard/enabled/_2140_admin_info_panel.py new file mode 100644 index 0000000000..470a4ac9a3 --- /dev/null +++ b/openstack_dashboard/enabled/_2140_admin_info_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_25_identity.py b/openstack_dashboard/enabled/_3000_identity.py similarity index 100% rename from openstack_dashboard/enabled/_25_identity.py rename to openstack_dashboard/enabled/_3000_identity.py diff --git a/openstack_dashboard/enabled/_3010_identity_domains_panel.py b/openstack_dashboard/enabled/_3010_identity_domains_panel.py new file mode 100644 index 0000000000..c225600732 --- /dev/null +++ b/openstack_dashboard/enabled/_3010_identity_domains_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_3020_identity_projects_panel.py b/openstack_dashboard/enabled/_3020_identity_projects_panel.py new file mode 100644 index 0000000000..bef72a85f6 --- /dev/null +++ b/openstack_dashboard/enabled/_3020_identity_projects_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_3030_identity_users_panel.py b/openstack_dashboard/enabled/_3030_identity_users_panel.py new file mode 100644 index 0000000000..785afe3f39 --- /dev/null +++ b/openstack_dashboard/enabled/_3030_identity_users_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_250_identity_users_panel.py b/openstack_dashboard/enabled/_3031_identity_users_panel.py similarity index 100% rename from openstack_dashboard/enabled/_250_identity_users_panel.py rename to openstack_dashboard/enabled/_3031_identity_users_panel.py diff --git a/openstack_dashboard/enabled/_3040_identity_groups_panel.py b/openstack_dashboard/enabled/_3040_identity_groups_panel.py new file mode 100644 index 0000000000..b584ac4e24 --- /dev/null +++ b/openstack_dashboard/enabled/_3040_identity_groups_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_3050_identity_roles_panel.py b/openstack_dashboard/enabled/_3050_identity_roles_panel.py new file mode 100644 index 0000000000..7a055ce72b --- /dev/null +++ b/openstack_dashboard/enabled/_3050_identity_roles_panel.py @@ -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' diff --git a/openstack_dashboard/enabled/_30_settings.py b/openstack_dashboard/enabled/_5000_settings.py similarity index 100% rename from openstack_dashboard/enabled/_30_settings.py rename to openstack_dashboard/enabled/_5000_settings.py diff --git a/openstack_dashboard/test/test_panels/nonloading_panel/__init__.py b/openstack_dashboard/test/test_panels/nonloading_panel/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openstack_dashboard/test/test_panels/nonloading_panel/panel.py b/openstack_dashboard/test/test_panels/nonloading_panel/panel.py new file mode 100644 index 0000000000..345db00b2e --- /dev/null +++ b/openstack_dashboard/test/test_panels/nonloading_panel/panel.py @@ -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 diff --git a/openstack_dashboard/test/test_panels/nonloading_panel/templates/nonloading_panel/index.html b/openstack_dashboard/test/test_panels/nonloading_panel/templates/nonloading_panel/index.html new file mode 100644 index 0000000000..4d89e53811 --- /dev/null +++ b/openstack_dashboard/test/test_panels/nonloading_panel/templates/nonloading_panel/index.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} +{% load i18n %} +{% block title %}Nonloading Plugin-based Panel{% endblock %} + +{% block main %} +
+
+ Nonloading Plugin-based Panel +
+
+{% endblock %} diff --git a/openstack_dashboard/test/test_panels/nonloading_panel/urls.py b/openstack_dashboard/test/test_panels/nonloading_panel/urls.py new file mode 100644 index 0000000000..31b24bf81a --- /dev/null +++ b/openstack_dashboard/test/test_panels/nonloading_panel/urls.py @@ -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'), +) diff --git a/openstack_dashboard/test/test_panels/nonloading_panel/views.py b/openstack_dashboard/test/test_panels/nonloading_panel/views.py new file mode 100644 index 0000000000..e4aae723fb --- /dev/null +++ b/openstack_dashboard/test/test_panels/nonloading_panel/views.py @@ -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' diff --git a/openstack_dashboard/test/test_panels/second_panel/panel.py b/openstack_dashboard/test/test_panels/second_panel/panel.py index 52f61b9818..e63d8c57b9 100644 --- a/openstack_dashboard/test/test_panels/second_panel/panel.py +++ b/openstack_dashboard/test/test_panels/second_panel/panel.py @@ -16,3 +16,7 @@ import horizon class SecondPanel(horizon.Panel): name = "Second Plugin Panel" slug = 'second_panel' + + @staticmethod + def can_register(): + return True diff --git a/openstack_dashboard/test/test_plugins/panel_config/_40_admin_nonloading_panel.py b/openstack_dashboard/test/test_plugins/panel_config/_40_admin_nonloading_panel.py new file mode 100644 index 0000000000..40d7141564 --- /dev/null +++ b/openstack_dashboard/test/test_plugins/panel_config/_40_admin_nonloading_panel.py @@ -0,0 +1,13 @@ +# The name of the panel to be added to HORIZON_CONFIG. Required. +PANEL = 'nonloading_panel' +# The name of the dashboard the PANEL associated with. Required. +PANEL_DASHBOARD = 'admin' +# The name 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.test.test_panels.nonloading_panel.panel.NonloadingPanel' + +# A list of Django applications to be prepended to ``INSTALLED_APPS`` +ADD_INSTALLED_APPS = ['openstack_dashboard.test.test_panels.nonloading_panel'] diff --git a/openstack_dashboard/test/test_plugins/panel_tests.py b/openstack_dashboard/test/test_plugins/panel_tests.py index c6a8a1a0d9..c65f10b21e 100644 --- a/openstack_dashboard/test/test_plugins/panel_tests.py +++ b/openstack_dashboard/test/test_plugins/panel_tests.py @@ -21,6 +21,8 @@ from openstack_dashboard.dashboards.admin.info import panel as info_panel from openstack_dashboard.test import helpers as test from openstack_dashboard.test.test_panels.plugin_panel \ import panel as plugin_panel +from openstack_dashboard.test.test_panels.nonloading_panel \ + import panel as nonloading_panel from openstack_dashboard.test.test_plugins import panel_config from openstack_dashboard.utils import settings as util_settings @@ -70,3 +72,8 @@ class PanelPluginTests(test.PluginTestCase): def test_default_panel(self): dashboard = horizon.get_dashboard("admin") self.assertEqual('defaults', dashboard.default_panel) + + def test_panel_not_added(self): + dashboard = horizon.get_dashboard("admin") + self.assertNotIn(nonloading_panel.NonloadingPanel, + [p.__class__ for p in dashboard.get_panels()])