提交 1f3e1d01 编写于 作者: S stephenconnolly

Health reports were not working in safari. Replaced <img title=""> with a <a>...

Health reports were not working in safari.  Replaced <img title=""> with a <a> containing a div that is displaied with an a:hover css rule


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3943 71c3de6d-444a-0410-be80-ed276b4c234a
上级 5c531ccd
......@@ -505,28 +505,28 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
* the health report. Never returns null
*/
public HealthReport getBuildHealth() {
HealthReport buildHealth = null;
List<HealthReport> reports = getBuildHealthReports();
return reports.isEmpty() ? new HealthReport() : reports.get(0);
}
public List<HealthReport> getBuildHealthReports() {
List<HealthReport> reports = new ArrayList<HealthReport>();
RunT lastBuild = getLastBuild();
if (lastBuild != null && lastBuild.isBuilding()) {
// show the previous build's report until the current one is finished building.
// show the previous build's report until the current one is finished building.
lastBuild = lastBuild.getPreviousBuild();
}
if (lastBuild != null) {
for (HealthReportingAction healthReportingAction : lastBuild.getActions(HealthReportingAction.class)) {
buildHealth = HealthReport.min(buildHealth, healthReportingAction.getBuildHealth());
reports.add(healthReportingAction.getBuildHealth());
}
// if all else fails, use the stability health report.
buildHealth = HealthReport.min(buildHealth, getBuildStabilityHealthReport());
reports.add(getBuildStabilityHealthReport());
}
if (buildHealth == null)
buildHealth = new HealthReport();
return buildHealth;
Collections.sort(reports);
return reports;
}
private HealthReport getBuildStabilityHealthReport() {
......
......@@ -38,9 +38,33 @@
<tr class="${h.ifThenElse(job.disabled,'disabledJob',null)}">
<t:ballColorTd it="${job.iconColor}" />
<td data="${buildHealth.score}">
<img src="${rootURL}${h.ifThenElse(buildHealth.iconUrl.startsWith('/'),'','/images/'+iconSize+'/')}${buildHealth.iconUrl}"
alt="${buildHealth.score}%"
title="${buildHealth.description}" />
<a class="healthReport" href="${jobBaseUrl}${job.shortUrl}lastBuild">
<img src="${rootURL}${h.ifThenElse(buildHealth.iconUrl.startsWith('/'),'','/images/'+iconSize+'/')}${buildHealth.iconUrl}"
alt="${buildHealth.score}%"/>
<div>
<table border="0">
<thead>
<tr>
<th align="left">W</th>
<th align="left">Description</th>
<th align="right">%</th>
</tr>
</thead>
<tbody>
<j:forEach var="rpt" items="${job.buildHealthReports}">
<tr>
<td align="left">
<img src="${rootURL}${h.ifThenElse(rpt.iconUrl.startsWith('/'),'','/images/16x16/')}${rpt.iconUrl}"
alt="" title="" />
</td>
<td>${rpt.description}</td>
<td align="right">${rpt.score}</td>
</tr>
</j:forEach>
</tbody>
</table>
</div>
</a>
</td>
<td>
<a href="${jobBaseUrl}${job.shortUrl}">
......
......@@ -419,6 +419,36 @@ th.pane {
white-space: nowrap;
}
/* ============================ health report hover ========================== */
/* I was using div's but the IE bugs got the better of me anyway, nicer to */
/* have a link to the latest build (which is the source of the health report */
/* that you are viewing) */
/* IE does not render this as nicely as I'd like, but least amount of hacky. */
a.healthReport {
text-decoration: none;
}
a.healthReport div {
display: none;
}
a.healthReport:hover { /* fix IE6 bug with :hover */
background: transparent;
}
a.healthReport:hover div {
display: block;
position: absolute;
background-color: #ffe;
border: 1 solid #bbb;
margin-left: 32px; /* move it across a bit */
}
a.healthReport div table {
border-collapse: collapse;
width: 450px; /* fix IE bug with width */
}
/* ========================= editable combobox style ========================= */
.comboBoxList {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册