folsom版本horizon架构剖析
OpenStack Folsom版本出来也一段时间了,整理了一下界面dashboards项目horizon整体内容,部分节选自计划出版的《云计算与OpenStack》。 在整个OpenStack应用体系框架中,Horizon就是整个应用的入口。他提供了一个模块化的基于WEB的图形化界面服务门户。用户可以通过浏览器使用这个WEB UI来访问、控制控制他们的计算、存储和网络资源,如启动实
OpenStack Folsom版本出来也一段时间了,整理了一下界面dashboards项目horizon整体内容,部分节选自计划出版的《云计算与OpenStack》。
- 云管理员
-
终端用户
1. 功能架构
2.开发架构
之后在nova里面instances对应虚拟机管理,volumes对应弹性硬盘EBS
3定制Horizon
3.1修改WEB应用的标题
3.2修改Horizon的logo
#splash .modal { background: #fff url(../images/logo.png) no-repeat center 35px; h1.brand a { background: url(../images/logo.png) top left no-repeat; |
3.3 修改Dashboard和Panel
HORIZON_CONFIG = { } |
from django.utils.translation import ugettext_lazy as _ import horizon # Rename "OpenStack Credentials" to "OS Credentials" settings = horizon.get_dashboard("settings") project_panel = settings.get_panel("project") project_panel.name = _("OS Credentials") |
3.4 国际化
自从Folsom版本之后,Horizon已经支持汉化,有部分翻译没有完全做好,可以进一步汉化。Horizon的汉化还是比较简单的,根据django框架增加和修改对应的国际化属性文件就可以了。安装完毕folsom后可以通过2个目录找到horizon
/usr/share/openstack_dashboard /usr/lib/python2.7/dist-packags/horizon |
基本上修改locale中的po文件,例如:
/horizon-2012.2/horizon/locale/zh_CN/LC_MESSAGES/django.po /horizon-2012.2/horizon/locale/zh_CN/LC_MESSAGES/djangojs.po |
#: dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_update.html:7 #: dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/_update.html:22 #: dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/update.html:3 #: dashboards/nova/images_and_snapshots/templates/images_and_snapshots/images/update.html:6 #: dashboards/syspanel/images/templates/images/_update.html:8 #: dashboards/syspanel/images/templates/images/_update.html:23 #: dashboards/syspanel/images/templates/images/update.html:4 #: dashboards/syspanel/images/templates/images/update.html:7 msgid "Update Image" msgstr "更新镜像" |
root@essex1:/usr/lib/python2.7/dist-packages/horizon# django-admin compilemessages processing file django.po in /usr/lib/python2.7/dist-packages/horizon/locale/es/LC_MESSAGES processing file django.po in /usr/lib/python2.7/dist-packages/horizon/locale/zh_TW/LC_MESSAGES processing file django.po in /usr/lib/python2.7/dist-packages/horizon/locale/pl/LC_MESSAGES processing file django.po in /usr/lib/python2.7/dist-packages/horizon/locale/pt/LC_MESSAGES processing file django.po in /usr/lib/python2.7/dist-packages/horizon/locale/fr/LC_MESSAGES processing file django.po in /usr/lib/python2.7/dist-packages/horizon/locale/ja/LC_MESSAGES processing file django.po in /usr/lib/python2.7/dist-packages/horizon/locale/zh_CN/LC_MESSAGES |
更多推荐
所有评论(0)