自定义OpenStack dashboard页面

发布时间 2023-10-16 17:44:46作者: 这是个佚名

OpenStack dashboard界面替换图片

一、dashboard界面Logo的路径及文件

dashboard的Logo存放(在Controller节点)的路径:

/usr/share/openstack-dashboard/openstack_dashboard/static/dashboard/img/

涉及需要修改的文件(3个):

favicon.ico  //浏览器窗口的小图标
logo.svg  //认证以后,项目左上角的图片
logo-splash.svg   //首页的图片

svg 格式是图片的一种,png 图片可以在该网站进行在线转换。

二、dashboard页面修改

可以直接替换img文件夹,也可单独替换上述三个文件

如果图片变更其他名称,需要修改对应的两个页面;如果图片名称不变,此步省略

1、登陆页面对应的HTML页面文件:

vi /usr/lib/python2.7/site-packages/horizon/templates/auth/_splash.html

{% load themes %}
<div class="text-center">
  <img class="splash-logo" src={% themable_asset "img/logo-splash.svg" %} height="133" width="133">
  <h3 style="text-align:center;font-family:微软雅黑">云计算基础架构平台</h3>
</div>

2、登陆后页面对应的HTML页面文件:

vi /usr/share/openstack-dashboard/openstack_dashboard/templates/header/_brand.html

{% load themes %}
{% load branding %}
<a class="navbar-brand" href="{% site_branding_link %}" target="_self" style="
    height: 50px;
">
  <img class="openstack-logo" src="{% themable_asset 'img/logo.svg' %}" alt="{% site_branding %}" style="
    width: 350px;
    height: 55px;
">
</a>

三、重启httpd服务

systemctl restart httpd