1. 程式人生 > >openstack二次開發:如何定製自己(企業)openstack圖示、標題等內容

openstack二次開發:如何定製自己(企業)openstack圖示、標題等內容

問題導讀1.如何修改dasboard網站顏色?2.如何修改openstack dasboard網站標題?3.如何定製自己的logo,及品牌連線?本文定製包含以下內容:網站顏色Logo網站標題站點品牌連結幫助連線Logo和網站顏色1.建立兩個logo檔案,png格式,具有透明背景,使用以下大小:登入螢幕:365 x 50登入橫幅: 216 x 352.上傳圖片到下列位置/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/3.建立css樣式,在下面目錄/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/css/

4.建立css樣式,在下面目錄更該顏色和檔名,下面是定製css樣式例子  

[CSS] 純文字檢視 複製程式碼

<span style="color:#444444">/*
* New theme colors for dashboard that override the defaults:
*  dark blue: #355796 / rgb(53, 87, 150)
*  light blue: #BAD3E1 / rgb(186, 211, 225)
*
* By Preston Lee <[email][email protected][/email]>
*/
h1.brand {
background: #355796 repeat-x top left;
border-bottom: 2px solid #BAD3E1;
}
h1.brand a {
background: url(../img/my_cloud_logo_small.png) top left no-repeat;
}
#splash .login {
background: #355796 url(../img/my_cloud_logo_medium.png) no-repeat center 35px;
}
#splash .login .modal-header {
border-top: 1px solid #BAD3E1;
}
.btn-primary {
background-image: none !important;
background-color: #355796 !important;
border: none !important;
box-shadow: none;
}
.btn-primary:hover,
.btn-primary:active {
border: none;
box-shadow: none;
background-color: #BAD3E1 !important;
text-decoration: none;
}</span>

5.選擇編輯html模板/usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html6.新增一行包括您的新建立的樣式表。例如 custom.css檔案

[CSS] 純文字檢視 複製程式碼

<span style="color:#444444">...
    <link href='{{ STATIC_URL }}bootstrap/css/bootstrap.min.css' media='screen' rel='stylesheet' />
    <link href='{{ STATIC_URL }}dashboard/css/{% choose_css %}' media='screen' rel='stylesheet' />
    <link href='{{ STATIC_URL }}dashboard/css/custom.css' media='screen' rel='stylesheet' />
    ...</span>

7.重啟ApacheUbuntu

[Bash shell] 純文字檢視 複製程式碼

?

1

service apache2 restart

Fedora, RHEL, CentOS

[Bash shell] 純文字檢視 複製程式碼

?

1

service httpd restart

openSUSE

[Bash shell] 純文字檢視 複製程式碼

?

1

service apache2 restart

8.重啟Apache檢視效果,檢視修改網站標題在瀏覽器頂部, 在 local_settings.py新增下面一行

[Bash shell] 純文字檢視 複製程式碼

?

1

SITE_BRANDING = "Example, Inc. Cloud"

重啟Apache檢視效果站點品牌連結logo可以作為品牌連線,預設連線到 horizon:user_home,如系那個改變在 local_settings.py中新增下面一行

[Bash shell] 純文字檢視 複製程式碼

?

1

SITE_BRANDING_LINK = "http://www.aboutyun.com"

重啟Apache檢視效果幫助連線1.預設幫助連線指向http://docs.openstack.org.在 local_settings.py中改成自己定製連線

[Bash shell] 純文字檢視 複製程式碼

?

1

'help_url': "http://www.aboutyun.com",

重啟Apache檢視效果