Remove the term 'syspanel' from docs
Since the refactorization of syspanel occurred at the very early Folsom days, the docs should reflect this too. Change-Id: I8539b0b8bda2f63366c6de75b1a010f52f07fd0e
This commit is contained in:
parent
813c04fd5e
commit
a209ed40f4
@ -9,7 +9,7 @@ Horizon
|
|||||||
|
|
||||||
Dashboard
|
Dashboard
|
||||||
|
|
||||||
A Python class representing a top-level navigation item (e.g. "syspanel")
|
A Python class representing a top-level navigation item (e.g. "project")
|
||||||
which provides a consistent API for Horizon-compatible applications.
|
which provides a consistent API for Horizon-compatible applications.
|
||||||
|
|
||||||
Panel
|
Panel
|
||||||
|
@ -92,11 +92,13 @@ At the project level you add Horizon and any desired dashboards to your
|
|||||||
``settings.INSTALLED_APPS``::
|
``settings.INSTALLED_APPS``::
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
'django',
|
'openstack_dashboard',
|
||||||
...
|
...
|
||||||
'horizon',
|
'horizon',
|
||||||
'horizon.dash',
|
'openstack_dashboard.dashboards.project',
|
||||||
'horizon.syspanel',
|
'openstack_dashboard.dashboards.admin',
|
||||||
|
'openstack_dashboard.dashboards.settings',
|
||||||
|
...
|
||||||
)
|
)
|
||||||
|
|
||||||
URLs
|
URLs
|
||||||
@ -141,22 +143,19 @@ Structure
|
|||||||
An application would have the following structure (we'll use syspanel as
|
An application would have the following structure (we'll use syspanel as
|
||||||
an example)::
|
an example)::
|
||||||
|
|
||||||
syspanel/
|
project/
|
||||||
|---__init__.py
|
|---__init__.py
|
||||||
|---dashboard.py <-----Registers the app with Horizon and sets dashboard properties
|
|---dashboard.py <-----Registers the app with Horizon and sets dashboard properties
|
||||||
|---templates/
|
|
||||||
|---templatetags/
|
|
||||||
|---overview/
|
|---overview/
|
||||||
|---services/
|
|---images_and_snapshots/
|
||||||
|---images/
|
|-- images
|
||||||
|---__init__.py
|
|-- __init__.py
|
||||||
|---panel.py <-----Registers the panel in the app and defines panel properties
|
|---panel.py <-----Registers the panel in the app and defines panel properties
|
||||||
|---urls.py
|
|-- snapshots/
|
||||||
|---views.py
|
|-- templates/
|
||||||
|---forms.py
|
|-- tests.py
|
||||||
|---tests.py
|
|-- urls.py
|
||||||
|---api.py <-------Optional additional API methods for non-core services
|
|-- views.py
|
||||||
|---templates/
|
|
||||||
...
|
...
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -168,18 +167,26 @@ process::
|
|||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
|
|
||||||
|
....
|
||||||
|
# ObjectStorePanels is an example for a PanelGroup
|
||||||
|
# for panel classes in general, see below
|
||||||
|
class ObjectStorePanels(horizon.PanelGroup):
|
||||||
|
slug = "object_store"
|
||||||
|
name = _("Object Store")
|
||||||
|
panels = ('containers',)
|
||||||
|
|
||||||
class Syspanel(horizon.Dashboard):
|
|
||||||
name = "Syspanel" # Appears in navigation
|
class Project(horizon.Dashboard):
|
||||||
slug = 'syspanel' # Appears in url
|
name = _("Project") # Appears in navigation
|
||||||
panels = ('overview', 'services', 'instances', 'flavors', 'images',
|
slug = "project" # Appears in URL
|
||||||
'tenants', 'users', 'quotas',)
|
# panels may be strings or refer to classes, such as
|
||||||
|
# ObjectStorePanels
|
||||||
|
panels = (BasePanels, NetworkPanels, ObjectStorePanels)
|
||||||
default_panel = 'overview'
|
default_panel = 'overview'
|
||||||
permissions = ('openstack.roles.admin',)
|
supports_tenants = True
|
||||||
...
|
...
|
||||||
|
|
||||||
|
horizon.register(Project)
|
||||||
horizon.register(Syspanel)
|
|
||||||
|
|
||||||
Panel Classes
|
Panel Classes
|
||||||
-------------
|
-------------
|
||||||
@ -189,7 +196,7 @@ you register it in a ``panels.py`` file like so::
|
|||||||
|
|
||||||
import horizon
|
import horizon
|
||||||
|
|
||||||
from horizon.dashboard.syspanel import dashboard
|
from openstack_dashboard.dashboards.project import dashboard
|
||||||
|
|
||||||
|
|
||||||
class Images(horizon.Panel):
|
class Images(horizon.Panel):
|
||||||
@ -199,7 +206,7 @@ you register it in a ``panels.py`` file like so::
|
|||||||
|
|
||||||
|
|
||||||
# You could also register your panel with another application's dashboard
|
# You could also register your panel with another application's dashboard
|
||||||
dashboard.Syspanel.register(Images)
|
dashboard.Project.register(Images)
|
||||||
|
|
||||||
By default a :class:`~horizon.Panel` class looks for a ``urls.py`` file in the
|
By default a :class:`~horizon.Panel` class looks for a ``urls.py`` file in the
|
||||||
same directory as ``panel.py`` to include in the rollup of url patterns from
|
same directory as ``panel.py`` to include in the rollup of url patterns from
|
||||||
|
@ -404,7 +404,7 @@ We need three templates here: one for the view, and one for each of our two
|
|||||||
tabs. The view template (in this case) can inherit from one of the other
|
tabs. The view template (in this case) can inherit from one of the other
|
||||||
dashboards::
|
dashboards::
|
||||||
|
|
||||||
{% extends 'syspanel/base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block title %}{% trans "Flocking" %}{% endblock %}
|
{% block title %}{% trans "Flocking" %}{% endblock %}
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ dashboards::
|
|||||||
{% include "horizon/common/_page_header.html" with title=_("Flocking") %}
|
{% include "horizon/common/_page_header.html" with title=_("Flocking") %}
|
||||||
{% endblock page_header %}
|
{% endblock page_header %}
|
||||||
|
|
||||||
{% block syspanel_main %}
|
{% block main %}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
{{ tab_group.render }}
|
{{ tab_group.render }}
|
||||||
@ -475,9 +475,20 @@ The most basic thing to do is to add your own custom dashboard using the
|
|||||||
``HORIZON_CONFIG`` dictionary in the settings file::
|
``HORIZON_CONFIG`` dictionary in the settings file::
|
||||||
|
|
||||||
HORIZON_CONFIG = {
|
HORIZON_CONFIG = {
|
||||||
'dashboards': ('nova', 'syspanel', 'visualizations', 'settings',),
|
'dashboards': ('project', 'admin', 'settings',),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Please note, the dashboards also must be added to settings.py::
|
||||||
|
INSTALLED_APPS = (
|
||||||
|
'openstack_dashboard',
|
||||||
|
...
|
||||||
|
'horizon',
|
||||||
|
'openstack_dashboard.dashboards.project',
|
||||||
|
'openstack_dashboard.dashboards.admin',
|
||||||
|
'openstack_dashboard.dashboards.settings',
|
||||||
|
...
|
||||||
|
)
|
||||||
|
|
||||||
In this case, we've taken the default Horizon ``'dashboards'`` config and
|
In this case, we've taken the default Horizon ``'dashboards'`` config and
|
||||||
added our ``visualizations`` dashboard to it. Note that the name here is the
|
added our ``visualizations`` dashboard to it. Note that the name here is the
|
||||||
name of the dashboard's module on the python path. It will find our
|
name of the dashboard's module on the python path. It will find our
|
||||||
|
Loading…
Reference in New Issue
Block a user