当前位置:网站首页>【thingsboard】替换首页logo的方法
【thingsboard】替换首页logo的方法
2022-07-05 04:06:00 【兔小昀】
参考教程:https://my.oschina.net/sukf/blog/3108354
一、按如下尺寸设计新的LOGO
a. logo.png ----- 128x128,
b. thingsboard.ico ----- 320x320
c. logo_title_white.svg ----- 1536x318 SVG 32-bit
(这个比例亲测后发现有问题,后来改为153*36,但是存在logo偏移的情况,需要另外修改scss文件内容,文章末尾有补充说明)
d. logo_white.svg ----- 320x320 SVG 32-bit
分别替换到以下路径
a. thingsboard-2.4\img\logo.png
b. thingsboard-2.4\ui\src\thingsboard.ico
c. thingsboard-2.4\ui\src\svg\logo_title_white.svg
d. thingsboard-2.4\ui\src\svg\logo_white.svg
二、修改内容
1.分别修改文件 thingsboard-2.4\ui\webpack.config.prod.js 和 webpack.config.dev.js两个文件
搜索 HtmlWebpackPlugin 找到下图的位置
例如:
原标题:Thingsboard >>> 改为 >>> 新标题:XXX
2.修改文件 thingsboard-2.4\ui\src\app\app.run.js
搜素关键字pageTitle找到下图的位置
例如:
原标题:Thingsboard >>> 改为 >>> 新标题:XXXX
3.重命名thingsboard.ico (图省事也可以沿用原文件名 只要覆盖图片文件即可)
原文件名:thingsboard.ico >>> 改为 >>> 新文件名:hsiot.ico
1)重命名文件 thingsboard.ico >>> hsiot.ico
thingsboard-2.4\ui\src\thingsboard.ico
2)修改文件内容 thingsboard.ico >>> hsiot.ico
三、 重新打包
mvn clean package
(这个过程很慢,如果要反复尝试,可以换成UI热编译,详情参考热编译配置的文章
https://blog.csdn.net/liuli283/article/details/93479955)
补充情况:
1.原教程中第六步替换thingsboard.jar
thingsboard\lib\thingsboard.jar(这一步没有看懂,没做也不影响效果,可以忽略)
2.由于在实际修改的时候发现logo_title_white.svg按1536x318比例无法正常显示,改为153*36,但是存在logo偏移的情况,因此附上样式修改scss的步骤。
(1)全局搜索tb-logo-title
找到这三个文件(可以只修改ui\src\app\layout\home.scss但是需要重新编译和清理缓存否则可能会有问题,最好直接手动修改三个文件):
(2)按实际需要修改logo偏移样式。(如果以下参考css代码的显示效果不符合实际需要,可以在浏览器F12,预调整样式获取合适的css代码再作修改)
本人成功调整偏移的代码如下(左侧是修改前右侧是修改后):
md-icon.tb-logo-title{
width:600px;
height:40px;
margin-left:-180px;
}
最后推荐svg的在线编辑网页:
http://tools.jb51.net/static/api/svg/index.html(最为规范,兼容性最好)
https://www.zhangxinxu.com/sp/svg/
边栏推荐
- 线上故障突突突?如何紧急诊断、排查与恢复
- Pyqt5 displays file names and pictures
- 10种寻址方式之间的区别
- The scale of computing power in China ranks second in the world: computing is leaping forward in Intelligent Computing
- As soon as I write the code, President Wang talks with me about the pattern all day
- About the project error reporting solution of mpaas Pb access mode adapting to 64 bit CPU architecture
- What is the reason why the webrtc protocol video cannot be played on the easycvr platform?
- 反絮凝剂-氨碘肽滴眼液
- Get to know MySQL connection query for the first time
- Wechat applet development process (with mind map)
猜你喜欢
Differences among 10 addressing modes
Looking back on 2021, looking forward to 2022 | a year between CSDN and me
The development of mobile IM based on TCP still needs to keep the heartbeat alive
Why can't all browsers on my computer open web pages
基于TCP的移动端IM即时通讯开发仍然需要心跳保活
Threejs Internet of things, 3D visualization of farms (II)
【UNIAPP】系统热更新实现思路
Rust blockchain development - signature encryption and private key public key
3. Package the bottom navigation tabbar
【虚幻引擎UE】实现背景模糊下近景旋转操作物体的方法及踩坑记录
随机推荐
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
Use threejs to create geometry, dynamically add geometry, delete geometry, and add coordinate axes
Differences among 10 addressing modes
Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
Threejs implements labels and displays labels with custom styles
A应用唤醒B应该快速方法
Longyuan war "epidemic" 2021 network security competition web easyjaba
As soon as I write the code, President Wang talks with me about the pattern all day
Why can't all browsers on my computer open web pages
Judge whether the stack order is reasonable according to the stack order
Threejs rendering obj+mtl model source code, 3D factory model
Threejs realizes rain, snow, overcast, sunny, flame
JVM garbage collection
Bit operation skills
PlasticSCM 企业版Crack
25K 入职腾讯的那天,我特么哭了
Learning notes 8
The order of LDS links
On the day 25K joined Tencent, I cried
线上故障突突突?如何紧急诊断、排查与恢复