horizon源码结构
来源:互联网 发布:pe备份c盘数据 编辑:程序博客网 时间:2024/06/06 06:50
/usr/lib/python2.7/dist-packages/horizon 其他openstack组件也在这里 ...进该目录后,用ll命令查看。该目录的文件有对应的指向 其实就是指向上面的那个目录里的文件
/usr/lib/python2.7/dist-packages/django/conf/project_template/settings.py
/usr/share/pyshared/django/conf/project_template/settings.py
/usr/share/openstack-dashboard/openstack_dashboard/settings.py
/usr/share/openstack-dashboard/settings.py
不同版本文件目录结构不大一样,但是大体能找到在什么地方 。本文以Essex版本介绍
./tests/templates/base.html
./dashboards/settings/templates/settings/base.html
./dashboards/nova/templates/nova/base.html
./dashboards/syspanel/templates/syspanel/base.html
@register.inclusion_tag('horizon/_subnav_list.html', takes_context=True)
def horizon_dashboard_nav(context):
""" Generates sub-navigation entries for the current dashboard. """
if 'request' not in context:
return {}
dashboard = context['request'].horizon['dashboard']
panel_groups = dashboard.get_panel_groups()
non_empty_groups = []
for group in panel_groups.values():
allowed_panels = []
for panel in group:
if callable(panel.nav) and panel.nav(context):
allowed_panels.append(panel)
elif not callable(panel.nav) and panel.nav:
allowed_panels.append(panel)
if allowed_panels:
non_empty_groups.append((group.name, allowed_panels))
return {'components': SortedDict(non_empty_groups),
'user': context['request'].user,
'current': context['request'].horizon['panel'].slug,
'request': context['request']}
from django.utils.translation import ugettext_lazy as _
import horizon
class SystemPanels(horizon.PanelGroup):
slug = "syspanel"
name = _("System Panel")
panels = ('overview', 'instances', 'services', 'flavors', 'images',
'projects', 'users', 'quotas',)
class Syspanel(horizon.Dashboard):
name = _("Admin")
slug = "syspanel"
panels = (SystemPanels,)
default_panel = 'overview'
roles = ('admin',)
horizon.register(Syspanel)
from django.utils.translation import ugettext_lazy as _
import horizon
from horizon.dashboards.syspanel import dashboard
class Quotas(horizon.Panel):
name = _("Quotas") 菜单显示名字
slug = 'quotas' 与dashboard.py中保持一致
dashboard.Syspanel.register(Quotas)
- horizon源码结构
- horizon源码结构
- Horizon Dashboard源码分析
- horizon源码阅读
- openstack-horizon/novaclient源码分析
- Horizon 源码阅读(一)—— Horizon 整体介绍
- Horizon 源码阅读(一)—— Horizon 整体介绍
- horizon源码修改——拆分菜单
- Horizon 源码阅读(二)—— Horizon 模块注册机制
- Horizon 源码阅读(三)—— Horizon 用户登录流程
- Horizon 源码阅读(二)—— Horizon 模块注册机制
- Horizon 源码阅读(三)—— Horizon 用户登录流程
- horizon源码修改——加菜单和菜单汉化
- horizon源码修改——删除菜单和字样
- 如何在eclipse上实现horizon源码的仿真,调试
- Horizon 源码阅读(四)—— 调用Novaclient流程
- Horizon 源码阅读(四)—— 调用Novaclient流程
- OpenStack之Horizon源码架构浅析(一)
- 【BFS+边界】带图的原来也可以一次AC—POJ 1915
- JSP实现验证码
- mingw编译protobuf和openssl
- 画高频PCB的心得
- 改变MFC picture control控件背景色
- horizon源码结构
- dedecms 5.7版 管理员权限bug修复
- iphone-隐藏tabbar会出现空白,不能被其他view使用问题
- vs2008中设置文件编码格式
- struts 1与2的区别
- Android中ImageView无法居中的问题
- 面对互联网海量信息,如何择选适合自己的内容
- 颜色特征(转载)
- G-sensor driver工作的大致流程