zoukankan      html  css  js  c++  java
  • openstack horizon 学习(1) 总览

    关于Horizon的设计理念:

    来自官网(http://docs.openstack.org/developer/horizon/intro.html):

    Horizon holds several key values at the core of its design and architecture:

    Core Support: Out-of-the-box support for all core OpenStack projects.
    Extensible: Anyone can add a new component as a “first-class citizen”.
    Manageable: The core codebase should be simple and easy-to-navigate.
    Consistent: Visual and interaction paradigms are maintained throughout.
    Stable: A reliable API with an emphasis on backwards-compatibility.
    Usable: Providing an awesome interface that people want to use.

    The only way to attain and uphold those ideals is to make it easy for developers to implement those values.

    官网中特别强调了一句话:

    At its core, Horizon should be a registration pattern for applications to hook into

    Horizon要像积木一样,(除了Core以外的)应用是可拔插的。灵活,看上去也Cool。

    来看下Horizon的结构:

    This project is a bit different from other OpenStack projects in that it has two very distinct components underneath it: horizon, and openstack_dashboard.

    The horizon directory holds the generic libraries and components that can be used in any Django project.

    The openstack_dashboard directory contains a reference Django project that uses horizon.

    Horizon的设计基于Django框架,遵循DRY原则。

    首先我们先看看 horizon/ 这个目录。horizon这个目录包括了具体应用可能需要用到的公共组件,如table,form等等。

    另外一个重要的目录就是 openstack_dashboard/ 这个目录,具体的应用视图是定义在这个目录下的,比如networks的dashboard目录就是 openstack_dashboard/project/networks/ ,每个具体应用的目录结构跟django的app结构相似:

    project/
    |---__init__.py
    |---dashboard.py <-----Registers the app with Horizon and sets dashboard properties
    |---overview/
    |---images/
        |-- images
        |-- __init__.py
        |---panel.py <-----Registers the panel in the app and defines panel properties
        |-- snapshots/
        |-- templates/
        |-- tests.py
        |-- urls.py
        |-- views.py
        ...
    ...

    其他细节,等需要用到在详细介绍。

  • 相关阅读:
    [转]十个让你变成糟糕的程序员的行为
    [转]CKEDITOR 使用说明
    [转]惹恼程序员的十件事
    基本权限管理框架配套代码生成器!
    Easy UI 点击TAB 标签 刷新内容
    jQuery.easyui 与 jQuery.Valiedate 验证控件组合使用实例!
    [转]十条不错的编程观点
    dos 改 ip
    今天碰到了几个老同学,哎,,感觉
    猛玩War3中
  • 原文地址:https://www.cnblogs.com/mcflurry/p/4624986.html
Copyright © 2011-2022 走看看