|

2.1、配置插件
Manage Jenkins > Configure System > Theme
我把css和png文件都存放在JENKINS_HOME/userContent/Jenkins_Theme下面,这样可以用过URL来访问:http://jenkins_server/userContent/Jenkins_Theme,省得安装apache。
2.2、编写css文件
如果没有css基础的话,没关系,花上10几分钟,看看http://learning.artech.cn/20080621.mastering-javascript-jQuery.html的第三课和第四课,简单的了解下css基础即可。然后我们要了解一下jenkins页面的结构,这里需要借用firebug来查看,很方便的一个工具。(练习下,找一下自己想修改的元素如何用css表达。)
然后就要写css文件了,我结合我的一些修改来讲一下:
首先我想换一下jenkins的logo。这个很多人都不知道怎么换,以为非要改jenkins源文件才行,其实不用这么麻烦。
/* change logo
*/
#top-panel td > a {
background: url("http://135.242.102.36:8080/userContent/Jenkins_Theme/logo.png") 0 0 no-repeat;
display: block;
height: 65px;
width: 276px;
}
#top-panel td > a img {
display: none; }
这里我们需要分两步,先加载我的logo,然后隐藏原来的title,It's done!
接着,修改网页顶部的蓝条。由于公司的logo背景是白色的,所以,只需简单地隐藏一下top-panel即可。
/* behide top-panel background */
#top-panel {
background: none; }
一直觉得jenkins背景大叔很猥琐,我已经迫不及待想换下他了。照着Simple Theme Plugin插件介绍,将其改成了一只可爱的雪兔。
/* change background picture */
#main-table {
background-image: url("http://135.242.102.36:8080/userContent/Jenkins_Theme/snowrabbit.png") !important;
}
注意,!important的出现就是为了让用户自己设置被执行语句的优先级。不过它在IE6里面是不支持的。
为了练习下css,我又给任务队列和任务状态加上边框。
/* add a border for buildQueue, executors */
table#buildQueue.pane, table#executors.pane {
border-color: #ab5b9f;
border-width: 2px;
}
大功告成!
原文转载:猛击这里 |
|
|