Radomir Dopieralski ffbf33370c Group related panels in packages (resources)
This is a part of a larger patch, split to make it less
confusing. This patch deals with moving the files into
the "resources/" direcotry.

Make the file structure of the source reflect the logical
structure of the application (and its menus) by grouping
related panels into packages. This gives us a place to put
common code shared by those panels, and lets us find the
source code for a specific panel based on where it is in
the menu.

Because Horizon was not initially designed for autodiscovery
of panels that are not immediate children of the dashboard,
the URLs of those panels will have the form of
/infrastructure/resources.archived/. That can be amended by
a simple patch to Horizon later on.

Change-Id: I843efc86b582fb7b9e2d046dc83edefbebb5a861
2013-12-10 12:22:39 +01:00

65 lines
1.6 KiB
Python

# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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.utils.translation import ugettext_lazy as _ # noqa
import horizon
class InfrastructureOverview(horizon.PanelGroup):
slug = "infrastructure_overview"
name = _("Overview")
panels = (
'overview',
)
class Deployment(horizon.PanelGroup):
slug = "deploy"
name = _("Deployment")
panels = (
'deploy_overview',
'deploy_controller',
'deploy_compute',
'deploy_object_storage',
'deploy_block_storage',
)
class Resources(horizon.PanelGroup):
slug = "resources"
name = _("Resources")
panels = (
'resources.overview',
'resources.resource',
'resources.management',
'resources.unallocated',
'resources.archived',
)
class Infrastructure(horizon.Dashboard):
name = _("Infrastructure")
slug = "infrastructure"
panels = (
InfrastructureOverview,
Deployment,
Resources,
)
default_panel = 'overview'
permissions = ('openstack.roles.admin',)
horizon.register(Infrastructure)