未验证 提交 df74f7c7 编写于 作者: R Raihaan Shouhell 提交者: GitHub

Merge pull request #4627 from Wadeck/JENKINS-60866_log_recorder

[JENKINS-60866] Un-inline JavaScript/Style in LogRecorder views
......@@ -30,7 +30,7 @@ THE SOFTWARE.
<h1>${%Manage Old Data}</h1>
<p>${%blurb.1}</p>
<p>${%blurb.2}</p>
<table class="pane bigtable" style="width:auto">
<table class="pane bigtable width-auto">
<tr><th>${%Type}</th><th>${%Name}</th><th>${%Version}</th><th></th></tr>
<j:forEach var="item" items="${it.data.entrySet()}">
<j:set var="obj" value="${item.key}"/>
......@@ -85,7 +85,7 @@ THE SOFTWARE.
<br/>
<h2>${%Unreadable Data}</h2>
<p>${%blurb.6}</p>
<table class="pane bigtable" style="width:auto">
<table class="pane bigtable width-auto">
<tr><th>${%Type}</th><th>${%Name}</th><th>${%Error}</th></tr>
<j:forEach var="item" items="${it.data.entrySet()}">
<j:if test="${item.value.extra!=null and item.value==''}">
......
......@@ -26,7 +26,7 @@ THE SOFTWARE.
Show all hudson.* logs
-->
<?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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:t="/lib/hudson">
<l:layout title="Log">
<st:include page="sidepanel.jelly" />
<l:main-panel>
......
......@@ -24,8 +24,8 @@ THE SOFTWARE.
<!-- list of feed links -->
<?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">
<div align="right" style="margin:1em">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<div align="right">
<img src="${imagesURL}/atom.gif" border="0" alt="Feed" height="16" width="16"/>
<st:nbsp/><st:nbsp/><st:nbsp/><st:nbsp/>
<a href="rss">${%All}</a>
......
......@@ -41,7 +41,7 @@ THE SOFTWARE.
<td width="32">
<l:icon class="icon-clipboard icon-lg"/>
</td>
<td style="padding-left:2em"><a href="${href}">${name}</a></td>
<td><a href="${href}">${name}</a></td>
<td width="32">
<d:invokeBody />
</td>
......@@ -51,9 +51,9 @@ THE SOFTWARE.
<table id="logRecorders" class="sortable pane bigtable">
<tr>
<th width="32">S</th>
<th class="minimum-width" data-sort-disable="true" />
<th initialSortDir="down">${%Name}</th>
<th width="32"/>
<th class="minimum-width" data-sort-disable="true" />
</tr>
<local:row href="all" name="${%All Jenkins Logs}" />
<j:forEach var="lr" items="${it.logRecorders.values()}">
......
......@@ -26,7 +26,7 @@ THE SOFTWARE.
Show form to adjust log levels
-->
<?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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout title="Log Levels">
<st:include page="sidepanel.jelly" />
<l:main-panel>
......@@ -34,7 +34,7 @@ THE SOFTWARE.
${%Logger Configuration}
<t:help iconSize="large" tooltip="${%Additional information on log levels}" href="${%url}" />
</h1>
<table class="sortable pane bigtable" style="width:auto" id="logLevels">
<table class="sortable pane bigtable width-auto" id="logLevels">
<tr>
<th>${%Name}</th>
<th>${%Level}</th>
......
......@@ -26,17 +26,14 @@ THE SOFTWARE.
Create a new LogRecorder
-->
<?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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:f="/lib/form">
<l:layout>
<st:include page="sidepanel.jelly" />
<l:main-panel>
<f:form method="post" action="newLogRecorder">
<f:entry title="${%Name}">
<input type="text" name="name" class="setting-input" id="box" />
<script>
document.getElementById('box').focus();
</script>
<input type="text" name="name" class="setting-input" id="box" autofocus="autofocus" />
</f:entry>
<f:block>
......
......@@ -26,7 +26,7 @@ THE SOFTWARE.
Side panel
-->
<?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:s="/lib/form">
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
<l:header />
<l:side-panel>
<l:tasks>
......
......@@ -100,7 +100,7 @@ THE SOFTWARE.
<l:progressiveRendering handler="${it}" callback="display"/>
<table class="sortable pane bigtable" id="people">
<tr>
<th class="minimum-width" />
<th class="minimum-width" data-sort-disable="true" />
<th>${%User ID}</th>
<th>${%Name}</th>
<th initialSortDir="up">${%Last Commit Activity}</th>
......
......@@ -32,10 +32,10 @@ THE SOFTWARE.
<table class="sortable pane bigtable" id="people">
<tr>
<th class="minimum-width" />
<th class="minimum-width" data-sort-disable="true" />
<th>${%User ID}</th>
<th>${%Name}</th>
<th class="minimum-width" />
<th class="minimum-width" data-sort-disable="true" />
</tr>
<j:forEach var="user" items="${it.allUsers}">
<tr>
......
......@@ -501,6 +501,11 @@ th.pane {
/* bigtable */
/* For non-full screen table */
.bigtable.width-auto {
width: auto;
}
.bigtable tr {
border: 1px solid #bbb;
padding: 3px 4px 3px 4px;
......@@ -519,6 +524,11 @@ table.bigtable.pane > tbody > tr > td:last-child {
background-color: #f0f0f0;
padding: 6px 4px;
white-space: nowrap;
text-align: left;
&.minimum-width {
width: 1px;
}
}
.bigtable td {
......@@ -1995,9 +2005,6 @@ body.no-sticker #bottom-sticker {
fill: currentColor;
}
/* -------------------------------------- */
/* -------------- Unclassified ---------- */
.spacer {
......@@ -2005,3 +2012,4 @@ body.no-sticker #bottom-sticker {
}
/* -------------------------------------- */
......@@ -55,6 +55,15 @@ var Sortable = (function() {
// We have a first row: assume it's the header, and make its contents clickable links
firstRow.each(function (cell){
var noSort = cell.getAttribute('data-sort-disable');
if (noSort) {
//TODO the data storage should be changed
this.arrows.push(null);
// do not add clickable behavior on a column that is not expected to be sorted
// like icon columns
return;
}
/*
* Normally the innerHTML is dangerous, but in this case, we receive the column caption from an escaped jelly
* and thus, the content there is already escaped.
......@@ -212,7 +221,10 @@ var Sortable = (function() {
// update arrow rendering
this.arrows.each(function(e,i){
// to check the columns with sort disabled
if (e) {
e.innerHTML = ((i==column) ? dir : arrowTable.none).text;
}
});
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册