提交 bced2c75 编写于 作者: T tfennelly

divification of pane tag

上级 b2a98f6b
......@@ -67,6 +67,9 @@ Upcoming changes</a>
<li class="rfe">
Added option to increase impact of test failures on the weather report.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-24006">issue 24006</a>)
<li class="rfe">
Modernized sidebar <code>&lt;l:pane&gt;</code>s and making them work better with new layout.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23810">issue 23810</a>)
</ul>
</div><!--=TRUNK-END=-->
......
......@@ -27,7 +27,7 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<l:ajax>
<table>
<table class="pane">
<st:include page="entries.jelly" />
</table>
</l:ajax>
......
......@@ -29,17 +29,34 @@ THE SOFTWARE.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt">
<j:set var="link" value="${it.baseUrl}/${build.number}/" />
<j:set var="transitive" value="${(it.firstTransientBuildKey!=null and (it.adapter.compare(build,it.firstTransientBuildKey) ge 0)) ? 'transitive' : null}" />
<tr class="build-row no-wrap ${transitive}">
<td>
<tr class="build-row ${transitive}">
<td class="pane build-name">
<a class="build-status-link" href="${link}console"><img class="build-status-icon" width="16" height="16" src="${imagesURL}/16x16/${build.buildStatusUrl}" alt="${build.iconColor.description} &gt; ${%Console Output}" tooltip="${build.iconColor.description} &gt; ${%Console Output}" /></a><st:nbsp/>
${build.displayName}
</td>
<td style="padding-right:0">
<td class="pane build-details">
<a class="tip model-link inside" href="${link}">
<i:formatDate value="${build.timestamp.time}" type="both" dateStyle="medium" timeStyle="medium"/>
</a>
<j:if test="${build.building}">
<j:set target="${it}" property="nextBuildNumberToFetch" value="${build.number}"/>
<t:buildProgressBar build="${build}"/>
</j:if>
<j:if test="${!empty build.description}">
<div class="desc">
<j:out value="${app.markupFormatter.translate(build.truncatedDescription)}"/>
</div>
</j:if>
</td>
<td class="pane build-stop">
<j:if test="${build.building}">
<!-- Check ABORT permission for Project, Admin permission otherwise -->
<j:if test="${empty(it.owner.ABORT) ? h.hasPermission(app.ADMINISTER) : it.owner.hasPermission(it.owner.ABORT)}">
<l:stopButton href="${link}stop" alt="[cancel]"/>
</j:if>
</j:if>
</td>
<td class="middle-align">
<td class="pane middle-align build-badge">
<j:set var="badges" value="${build.badgeActions}"/>
<j:if test="${!empty(badges)}">
<st:nbsp/>
......@@ -49,27 +66,4 @@ THE SOFTWARE.
</j:if>
</td>
</tr>
<j:if test="${build.building}">
<j:set target="${it}" property="nextBuildNumberToFetch" value="${build.number}"/>
<tr class="transitive build-progress-bar"><td></td><td colspan="2" style="padding:0">
<table class="middle-align">
<tr><td>
<t:buildProgressBar build="${build}"/>
</td><td style="padding:0">
<!-- Check ABORT permission for Project, Admin permission otherwise -->
<j:if test="${empty(it.owner.ABORT) ? h.hasPermission(app.ADMINISTER) : it.owner.hasPermission(it.owner.ABORT)}">
<l:stopButton href="${link}stop" alt="[cancel]"/>
</j:if>
</td></tr>
</table>
</td></tr>
</j:if>
<j:if test="${!empty build.description}">
<tr class="${transitive}">
<td></td>
<td colspan="2" class="desc">
<j:out value="${app.markupFormatter.translate(build.truncatedDescription)}"/>
</td>
</tr>
</j:if>
</j:jelly>
......@@ -31,11 +31,27 @@ THE SOFTWARE.
<j:arg value="hudson.model.Job"/>
</j:invoke>
<j:if test="${jobClass.isAssignableFrom(it.owner.class)}">
<div style="float:right">(<a href="${it.baseUrl}/buildTimeTrend">${%trend}</a>)</div>
<div style="float:right"><a href="${it.baseUrl}/buildTimeTrend">${%trend}</a></div>
<t:buildHealth job="${it.owner}" iconSize="16x16" link="${it.baseUrl}/lastBuild"/>
</j:if>
</j:parse>
<l:pane width="3" title="${h.runScript(paneTitle)}${it.displayName}" id="buildHistory">
<j:parse var="paneFooter">
<!--
RSS link
-->
<span class="build-rss-links">
<a class="build-rss-all-icon" href="${it.baseUrl}/rssAll"><img src="${imagesURL}/atom.gif" border="0" alt="Feed" height="16" width="16"/></a>
<st:nbsp/>
<a class="build-rss-all-link" href="${it.baseUrl}/rssAll">RSS ${%for all}</a>
<st:nbsp/>
<a class="build-rss-failed-icon" href="${it.baseUrl}/rssFailed"><img src="${imagesURL}/atom.gif" border="0" alt="Feed" height="16" width="16"/></a>
<st:nbsp/>
<a class="build-rss-failed-link" href="${it.baseUrl}/rssFailed">RSS ${%for failures}</a>
</span>
</j:parse>
<l:pane width="3" title="${h.runScript(paneTitle)}${it.displayName}" footer="${h.runScript(paneFooter)}" id="buildHistory" class="stripped">
<!-- build history -->
<st:include page="entries.jelly" />
......@@ -83,20 +99,6 @@ THE SOFTWARE.
</td>
</tr>
</j:if>
<!--
RSS link
-->
<tr class="build-row build-rss-links">
<td colspan="3" align="right">
<a class="build-rss-all-icon" href="${it.baseUrl}/rssAll"><img src="${imagesURL}/atom.gif" border="0" alt="Feed" height="16" width="16"/></a>
<st:nbsp/>
<a class="build-rss-all-link" href="${it.baseUrl}/rssAll">RSS ${%for all}</a>
<st:nbsp/>
<a class="build-rss-failed-icon" href="${it.baseUrl}/rssFailed"><img src="${imagesURL}/atom.gif" border="0" alt="Feed" height="16" width="16"/></a>
<st:nbsp/>
<a class="build-rss-failed-link" href="${it.baseUrl}/rssFailed">RSS ${%for failures}</a>
</td>
</tr>
</l:pane>
<script defer="true">
updateBuildHistory("${it.baseUrl}/buildHistory/ajax",${it.nextBuildNumberToFetch});
......
......@@ -33,7 +33,8 @@ THE SOFTWARE.
</st:documentation>
<d:taglib uri="local">
<d:tag name="computerCaption">
<a href="${rootURL}/${c.url}" class="model-link inside">${title}</a>
<a href="${rootURL}/${c.url}" class="model-link inside"><img src="${imagesURL}/16x16/computer${c.offline?'-x':''}.png"/><st:nbsp/>${title}</a>
<j:if test="${c.offline}"> <st:nbsp/> (${%offline})</j:if>
<j:if test="${!c.acceptingTasks}"> <st:nbsp/> (${%suspended})</j:if>
</d:tag>
......@@ -52,6 +53,7 @@ THE SOFTWARE.
</a>
</td>
<td class="pane"/>
<td class="pane"/>
</j:when>
<j:when test="${e.idle}">
<td class="pane">
......@@ -65,13 +67,14 @@ THE SOFTWARE.
</j:choose>
</td>
<td class="pane"/>
<td class="pane"/>
</j:when>
<j:otherwise>
<!-- not actually optional, but it helps with backward compatibility -->
<j:set var="executor" value="${e}" />
<st:include it="${e.currentExecutable}" page="executorCell.jelly" optional="true">
<td class="pane">
<div style="white-space: normal">${%Building}
<div style="white-space: normal">
<j:set var="exe" value="${e.currentExecutable}" />
<j:invokeStatic var="exeparent"
className="hudson.model.queue.Executables" method="getParentOf">
......@@ -79,7 +82,7 @@ THE SOFTWARE.
</j:invokeStatic>
<j:choose>
<j:when test="${h.hasPermission(exeparent,exeparent.READ)}">
<a href="${rootURL}/${exeparent.url}"><l:breakable value="${exeparent.fullDisplayName}"/></a>&#160;<a href="${rootURL}/${exe.url}" class="model-link inside"><l:breakable value="${exe.displayName}"/></a>
<a href="${rootURL}/${exeparent.url}"><l:breakable value="${exeparent.fullDisplayName}"/></a>
<t:buildProgressBar build="${exe}" executor="${executor}"/>
</j:when>
<j:otherwise>
......@@ -88,6 +91,11 @@ THE SOFTWARE.
</j:choose>
</div>
</td>
<td class="pane">
<j:if test="${h.hasPermission(exeparent,exeparent.READ)}">
<a href="${rootURL}/${exe.url}" class="model-link inside"><l:breakable value="${exe.displayName}"/></a>
</j:if>
</td>
</st:include>
<td class="pane" align="center" valign="middle">
<j:if test="${e.hasStopPermission()}">
......@@ -107,15 +115,6 @@ THE SOFTWARE.
collapsedText="${%Computers(computers.size() - 1, app.unlabeledLoad.computeTotalExecutors() - app.unlabeledLoad.computeIdleExecutors(), app.unlabeledLoad.computeTotalExecutors())}">
<colgroup><col width="30"/><col width="200*"/><col width="24"/></colgroup>
<tr>
<th class="pane">#</th>
<th class="pane" colspan="2">
<div style="margin-right:19px">
${%Status}
</div>
</th>
</tr>
<j:forEach var="c" items="${computers}">
<tr>
<j:if test="${computers.size() gt 1 and (c.executors.size()!=0 or c.oneOffExecutors.size()!=0)}">
......
......@@ -219,7 +219,7 @@ ${h.initPageVariables(context)}
<div id="page-body" class="container-fluid">
<div class="row">
<div id="side-panel" class="col-md-3">
<div id="side-panel" class="col-sm-9 col-md-7 col-lg-6 col-xlg-4">
<div id="side-panel-content">
<j:set var="mode" value="side-panel" />
<d:invokeBody />
......@@ -237,7 +237,7 @@ ${h.initPageVariables(context)}
</div>
</div>
<div id="main-panel" class="col-md-9">
<div id="main-panel" class="col-sm-15 col-md-17 col-lg-18 col-xlg-20">
<div id="main-panel-content">
<j:set var="mode" value="main-panel" />
<d:invokeBody/>
......
......@@ -41,30 +41,46 @@ THE SOFTWARE.
<st:attribute name="id">
@id of the table, if specified.
</st:attribute>
<st:attribute name="class">
Pane table class specification.
</st:attribute>
<st:attribute name="footer">
Footer of the box. Can include HTML.
</st:attribute>
</st:documentation>
<table class="pane" id="${attrs.id}">
<tr><td class="pane-header" colspan="${width}">
<div>
<j:out value="${title}"/>
<a class="collapse" href="${rootURL}/toggleCollapse?paneId=${attrs.id}"
title="${h.isCollapsed(attrs.id) ? '%expand' : '%collapse'}">
<img src="${imagesURL}/16x16/${h.isCollapsed(attrs.id) ? 'expand' : 'collapse'}.png"
class="icon16x16"
alt="${h.isCollapsed(attrs.id) ? '%expand' : '%collapse'}" />
</a>
<div class="container-fluid pane-frame" id="${attrs.id}">
<div class="row">
<div class="col-xs-24 pane-header">
<a class="collapse" href="${rootURL}/toggleCollapse?paneId=${attrs.id}"
title="${h.isCollapsed(attrs.id) ? '%expand' : '%collapse'}">
<img src="${imagesURL}/16x16/${h.isCollapsed(attrs.id) ? 'expand' : 'collapse'}.png"
class="icon16x16"
alt="${h.isCollapsed(attrs.id) ? '%expand' : '%collapse'}"/>
</a>
<j:out value="${title}"/>
</div>
</td></tr>
</div>
<j:choose>
<j:when test="${h.isCollapsed(attrs.id)}">
<tr>
<td class="pane" colspan="${width}">
${attrs.collapsedText}
</td>
</tr>
</j:when>
<j:otherwise>
<d:invokeBody />
</j:otherwise>
<div class="row pane-content">
<j:when test="${h.isCollapsed(attrs.id)}">
<div class="row">
<div class="col-xs-24 cell">${attrs.collapsedText}</div>
</div>
</j:when>
<j:otherwise>
<table class="pane ${attrs.class}">
<d:invokeBody />
</table>
</j:otherwise>
</div>
</j:choose>
</table>
<j:if test="${attrs.footer != null}">
<div class="row">
<div class="col-xs-24 pane-footer">
<j:out value="${attrs.footer}"/>
</div>
</div>
</j:if>
</div>
</j:jelly>
\ No newline at end of file
......@@ -81,7 +81,7 @@ body {
margin-bottom: 20px;
}
#side-panel-content .pane {
#side-panel-content .pane-frame {
margin-bottom: 15px;
}
......@@ -409,57 +409,69 @@ div.dashboard {
clear:both;
}
.pane {
margin-top: 4px;
white-space: nowrap;
/* pane */
.pane-header, .pane-footer {
padding: 8px 0px;
background-color: #eee;
border: solid 1px #e0e0e0;
color: #3b3b3b;
}
.pane-header {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.pane-footer {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.pane td {
padding: 4px 4px 3px 4px;
vertical-align: middle;
}
table.pane {
width: 100%;
border-collapse: collapse;
border: 1px #bbb solid;
}
table.pane > tbody > tr > td:last-child {
border-right: 1px #bbb solid;
}
td.pane {
border: 1px #bbb solid;
padding: 3px 4px 3px 4px;
vertical-align: middle;
}
td.pane-header {
border: 1px #bbb solid;
border-right: none;
border-left: none;
background-color: #f0f0f0;
font-weight: bold;
padding-right: 24px;
table.pane.stripped tr:nth-child(even) {
background: #f7f7f7;
}
td.pane-header > div {
position: relative;
div.pane-header {
font-weight: bold;
padding-right: 24px;
width: 100%;
height: 100%;
}
td.pane-header > div > a.collapse {
div.pane-header .collapse {
float: right;
position: absolute;
right: 4px;
top: -1px;
margin-left: 3px;
}
th.pane {
border: 1px #bbb solid;
font-weight: bold;
}
/* executors */
#executors th.pane {
text-align: left;
padding: 12px 5px 5px 5px;
}
#executors th.pane a {
text-decoration: none;
}
/* bigtable */
.bigtable tr {
border: 1px solid #bbb;
padding: 3px 4px 3px 4px;
......@@ -811,9 +823,19 @@ table.parameters > tbody:hover {
padding: 0;
}
#buildHistory td.desc {
padding: 0;
white-space: normal;
#buildHistory .desc {
padding: 0;
margin-top: 5px;
white-space: normal;
max-width: 200px;
}
#buildHistory .build-rss-links {
float: right;
}
#buildHistory .build-name {
max-width: 120px;
}
/* ========================= editable combobox style ========================= */
......
......@@ -1568,14 +1568,21 @@ function updateBuildHistory(ajaxUrl,nBuild) {
if (bh.headers == null) {
// Yahoo.log("Missing headers in buildHistory element");
}
function getDataTable(buildHistoryDiv) {
return $(buildHistoryDiv).getElementsBySelector('table.pane')[0];
}
new Ajax.Request(ajaxUrl, {
requestHeaders: bh.headers,
onSuccess: function(rsp) {
var rows = bh.rows;
var dataTable = getDataTable(bh);
var rows = dataTable.rows;
//delete rows with transitive data
while (rows.length > 2 && Element.hasClassName(rows[1], "transitive"))
Element.remove(rows[1]);
while (rows.length > 0 && Element.hasClassName(rows[0], "transitive")) {
Element.remove(rows[0]);
}
// insert new rows
var div = document.createElement('div');
......@@ -1583,9 +1590,16 @@ function updateBuildHistory(ajaxUrl,nBuild) {
Behaviour.applySubtree(div);
var pivot = rows[0];
var newRows = $(div).firstDescendant().rows;
for (var i = newRows.length - 1; i >= 0; i--) {
pivot.parentNode.insertBefore(newRows[i], pivot.nextSibling);
var newRows = getDataTable(div).rows;
while (newRows.length > 0) {
if (pivot !== undefined) {
// The data table has rows. Insert before a "pivot" row (first row).
pivot.parentNode.insertBefore(newRows[0], pivot);
} else {
// The data table has no rows. In this case, we just add all new rows directly to the
// table, one after the other i.e. we don't insert before a "pivot" row (first row).
dataTable.appendChild(newRows[0]);
}
}
// next update
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册