Ask Your Question
0

How to add new dashboard on Horizon?

asked 2013-08-06 04:32:18 -0500

chengjia-su gravatar image

Hello,

I write _init_.py, dashboard.py, models.py and some codes to create dashboard and panel. This is document I refer : http://docs.openstack.org/developer/horizon/topics/tutorial.html (http://docs.openstack.org/developer/h...)

But I don't know how to make my dashboard show on webpage.

edit retag flag offensive close merge delete

8 answers

Sort by ยป oldest newest most voted
0

answered 2013-08-09 06:43:21 -0500

lin-hua-cheng gravatar image

Try adding some debug to validate if the dashboard is being loaded.

I wonder if the fourth dashboard is not showing up due to the limited space in the tabbed menu, also try hitting the dashboard url directly for the new dashboard.

Is there a folder /usr/share/pyshared/openstack_dashboard in your directory? If yes, you need to put the code in there to be accessible from Python path.

edit flag offensive delete link more
0

answered 2013-08-07 06:44:37 -0500

chengjia-su gravatar image

I add it in bottom of my dashboard.py

from django.utils.translation import ugettext_lazy as _ import horizon

class TestPanels(horizon.PanelGroup): slug = "intrusion_detection" name = _("Intrusion detection system") panels = ('test',)

class Ids(horizon.Dashboard): name = _("IDS") slug = "ids" panels = (TestPanels,) default_panel = 'test' permissions = ('openstack.roles.admin',)

horizon.register(Ids)

edit flag offensive delete link more
0

answered 2013-08-07 05:50:31 -0500

lin-hua-cheng gravatar image

Did you register the new dashboard after adding the code?

From the tutorial:

"Once our dashboard class is complete, all we need to do is register it:

horizon.register(VizDash)

The typical place for that would be the bottom of the dashboard.py file, but it could also go elsewhere."

edit flag offensive delete link more
0

answered 2013-08-06 23:33:48 -0500

david-lyle gravatar image

At this point, it is difficult to diagnose from the information given. There are several possible problems, but without access to your directory structure and source. The circular registration between the panel and the dashboard, a urls.py issue, whether __init__.py has two underscores or one. I would suggest hopping in the #openstack-horizon IRC room https://wiki.openstack.org/wiki/IRC and seek more interactive help there.

edit flag offensive delete link more
0

answered 2013-08-06 20:25:43 -0500

chengjia-su gravatar image

I also add my dashboard in INSTALLED_APPS. like this:

INSTALLED_APPS = ( 'openstack_dashboard', 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'compressor', 'horizon', 'openstack_dashboard.dashboards.project', 'openstack_dashboard.dashboards.admin', 'openstack_dashboard.dashboards.settings', 'openstack_auth', 'openstack_dashboard.dashboards.ids', )

edit flag offensive delete link more
0

answered 2013-08-06 15:34:07 -0500

david-lyle gravatar image

There are two places where it needs to be added in the settings file... This first place is in HORIZON_CONFIG, the second is in INSTALLED_APPS. This is also detailed in the above link.

edit flag offensive delete link more
0

answered 2013-08-06 08:06:23 -0500

chengjia-su gravatar image

I add my dashboard in /usr/share/openstack-dashboard/openstack_dashboard/settings.py HORIZON_CONFIG but, when I restart apache2, I got error message in log file:

[Tue Aug 06 16:01:34 2013] [error] [client 1.168.150.54] File does not exist: /var/www/favicon.ico [Tue Aug 06 08:01:34 2013] [error] [client 1.168.150.54] mod_wsgi (pid=5162): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'. [Tue Aug 06 08:01:34 2013] [error] [client 1.168.150.54] Traceback (most recent call last): [Tue Aug 06 08:01:34 2013] [error] [client 1.168.150.54] File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 219, in __call__ [Tue Aug 06 08:01:34 2013] [error] [client 1.168.150.54] self.load_middleware() [Tue Aug 06 08:01:34 2013] [error] [client 1.168.150.54] File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 47, in load_middleware [Tue Aug 06 08:01:34 2013] [error] [client 1.168.150.54] raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e)) [Tue Aug 06 08:01:34 2013] [error] [client 1.168.150.54] ImproperlyConfigured: Error importing middleware horizon.middleware: "No module named ids" [Tue Aug 06 16:01:34 2013] [error] [client 1.168.150.54] File does not exist: /var/www/favicon.ico

edit flag offensive delete link more
0

answered 2013-08-06 06:25:56 -0500

david-lyle gravatar image

Your new dashboard needs to also be referenced in the settings file. See: http://docs.openstack.org/developer/horizon/topics/tutorial.html#the-settings-file (http://docs.openstack.org/developer/h...)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-08-06 04:32:18 -0500

Seen: 551 times

Last updated: Aug 09 '13