未验证 提交 337b4442 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #4628 from Wadeck/JENKINS-60866_job_view

[JENKINS-60866] Un-inline JavaScript/Style in Job views
......@@ -33,7 +33,7 @@ THE SOFTWARE.
${h.initPageVariables(context)}
<x:doctype name="html" />
<html lang="${request.getLocale().toLanguageTag()}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" data-imagesurl="${imagesURL}" resURL="${resURL}">
<title>${%Restarting Jenkins}</title>
<!-- we do not want bots on this page -->
<meta name="ROBOTS" content="NOFOLLOW" />
......
......@@ -36,7 +36,7 @@ THE SOFTWARE.
</p>
<st:include page="control.jelly" it="${it.timeline}" />
<div style="height:2em"/><!-- spacer -->
<div class="spacer" />
<t:buildListTable builds="${it.builds}"/>
</l:main-panel>
......
......@@ -23,7 +23,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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<st:include page="/hudson/model/AbstractItem/_api.jelly"/>
......
......@@ -25,49 +25,27 @@ THE SOFTWARE.
<!-- Displays the chart that show how long builds are taking -->
<?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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout">
<l:layout title="${%title(it.displayName)}">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<st:include page="sidepanel.jelly" />
<st:adjunct includes="hudson.model.Job.buildTimeTrend_resources" />
<l:main-panel>
<h1>${%Timeline}</h1>
<st:include page="control.jelly" it="${it.timeline}" />
<div style="height:2em"/><!-- spacer -->
<div class="spacer" />
<h1>${%Build Time Trend}</h1>
<div align="center">
<img src="buildTimeGraph/png" width="500" height="400" lazymap="buildTimeGraph/map" alt="[${%Build time graph}]" style="float:right"/>
<img class="build-time-graph" src="buildTimeGraph/png" width="500" height="400" lazymap="buildTimeGraph/map" alt="[${%Build time graph}]" />
</div>
<j:set var="isMasterSlaveEnabled" value="${!empty(app.slaves)}"/>
<div align="center">
<script>
function displayBuilds(data) {
var p = $$('trend');
for (var x = 0; data.length > x; x++) {
var e = data[x];
var tr = new Element('tr');
tr.insert(new Element('td', {data: e.iconColorOrdinal}).
insert(new Element('a', {href: e.number + '/console'}).
insert(new Element('img', {width: 16, height: 16, src: '${imagesURL}/16x16/' + e.buildStatusUrl, alt: e.iconColorDescription}))));
tr.insert(new Element('td', {data: e.number}).
insert(new Element('a', {href: e.number + '/', 'class': 'model-link inside'}).
update(e.displayName.escapeHTML())));
tr.insert(new Element('td', {data: e.duration}).
update(e.durationString.escapeHTML()));
<j:if test="${isMasterSlaveEnabled}">
tr.insert(new Element('td').
update(e.builtOn ? new Element('a', {href: '${rootURL}/computer/' + e.builtOn, 'class': 'model-link inside'}).update(e.builtOnStr) : e.builtOnStr));
</j:if>
p.insert(tr);
Behaviour.applySubtree(tr);
}
ts_refresh(p);
}
</script>
<j:new var="handler" className="jenkins.widgets.BuildTimeTrend"/>
${handler.setBuilds(it.builds)}
<l:progressiveRendering handler="${handler}" callback="displayBuilds"/>
<table class="sortable" style="margin-top:1em;" id="trend">
<l:progressiveRendering handler="${handler}" callback="buildTimeTrend_displayBuilds"/>
<table class="sortable" id="trend"
data-is-master-slave-enabled="${isMasterSlaveEnabled}">
<tr>
<th><st:nbsp/></th>
<th initialSortDir="up">${%Build}</th>
......@@ -79,5 +57,5 @@ THE SOFTWARE.
</table>
</div>
</l:main-panel>
</l:layout>
</l:layout>
</j:jelly>
/**
* Public method to be called by progressiveRendering's callback
*/
function buildTimeTrend_displayBuilds(data) {
var p = document.getElementById('trend');
var isMasterSlaveEnabled = 'true' === p.getAttribute("data-is-master-slave-enabled");
var imagesURL = document.head.getAttribute('data-imagesurl');
var rootURL = document.head.getAttribute('data-rooturl');
for (var x = 0; data.length > x; x++) {
var e = data[x];
var tr = new Element('tr');
tr.insert(new Element('td', {data: e.iconColorOrdinal}).
insert(new Element('a', {href: e.number + '/console'}).
insert(new Element('img', {width: 16, height: 16, src: imagesURL+ '/16x16/' + e.buildStatusUrl, alt: e.iconColorDescription}))));
tr.insert(new Element('td', {data: e.number}).
insert(new Element('a', {href: e.number + '/', 'class': 'model-link inside'}).
update(e.displayName.escapeHTML())));
tr.insert(new Element('td', {data: e.duration}).
update(e.durationString.escapeHTML()));
if (isMasterSlaveEnabled) {
tr.insert(new Element('td').
update(e.builtOn ? new Element('a', {href: rootURL + '/computer/' + e.builtOn, 'class': 'model-link inside'}).update(e.builtOnStr) : e.builtOnStr));
}
p.insert(tr);
Behaviour.applySubtree(tr);
}
ts_refresh(p);
}
......@@ -26,4 +26,4 @@ THE SOFTWARE.
derived class should override this JSP to put additional entries to the config page.
-->
<?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" />
\ No newline at end of file
<j:jelly xmlns:j="jelly:core" />
......@@ -26,7 +26,7 @@ THE SOFTWARE.
Config page. derived class specific entries should go to configure-entries.jsp
-->
<?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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:f="/lib/form">
<l:layout type="one-column" permission="${it.EXTENDED_READ}" title="${%Config(it.displayName)}">
......
......@@ -23,7 +23,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" xmlns:p="/lib/hudson/project">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:t="/lib/hudson">
<l:layout title="${it.displayName}${not empty it.parent.fullDisplayName?' ['+it.parent.fullDisplayName+']':''}">
<st:include page="sidepanel.jelly" />
<l:main-panel>
......
......@@ -23,7 +23,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">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<!--
For historical reasons, jobs used "newJobDetail.jelly".
......
......@@ -24,7 +24,7 @@ THE SOFTWARE.
<!-- display permalinks of the page -->
<?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" xmlns:p="/lib/hudson/project">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler">
<h2 class="permalinks-header">${%Permalinks}</h2>
<ul class="permalinks-list">
<j:set var="job" value="${it}" />
......
......@@ -24,7 +24,7 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:i="jelly:fmt" xmlns:l="/lib/layout">
<j:jelly xmlns:j="jelly:core" xmlns:l="/lib/layout">
<l:layout title="${%Form post required}">
<l:main-panel>
<p>${%use_post}</p>
......
......@@ -39,7 +39,7 @@ THE SOFTWARE.
<j:if test="${!request.getParameter('suppressTimelineControl')}"> <!-- cf. BuildListTableTest; breaks HtmlUnit -->
<st:include page="control.jelly" it="${it.timeline}"/>
</j:if>
<div style="height:2em"/><!-- spacer -->
<div class="spacer" />
<t:buildListTable builds="${it.builds}"/>
</l:main-panel>
......
......@@ -41,7 +41,7 @@ THE SOFTWARE.
<j:set var="simpleDecorator" value="${h.simplePageDecorator}"/>
<j:set var="simpleDecorators" value="${h.simplePageDecorators}"/>
<html lang="${request.getLocale().toLanguageTag()}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" data-imagesurl="${imagesURL}" resURL="${resURL}">
<title>${%Create an account! [Jenkins]}</title>
<!-- we do not want bots on this page -->
<meta name="ROBOTS" content="NOFOLLOW"/>
......
......@@ -33,7 +33,7 @@ THE SOFTWARE.
${h.initPageVariables(context)}
<x:doctype name="html" />
<html lang="${request.getLocale().toLanguageTag()}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" data-imagesurl="${imagesURL}" resURL="${resURL}">
<title>${%Starting Jenkins}</title>
<!-- we do not want bots on this page -->
<meta name="ROBOTS" content="NOFOLLOW" />
......
......@@ -33,7 +33,7 @@ THE SOFTWARE.
${h.initPageVariables(context)}
<x:doctype name="html" />
<html lang="${request.getLocale().toLanguageTag()}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" data-imagesurl="${imagesURL}" resURL="${resURL}">
<title>${%Restarting Jenkins}</title>
<!-- we do not want bots on this page -->
<meta name="ROBOTS" content="NOFOLLOW" />
......
......@@ -51,7 +51,7 @@ THE SOFTWARE.
<j:set var="simpleDecorators" value="${h.simplePageDecorators}"/>
<!-- real deal starting here -->
<html lang="${request.getLocale().toLanguageTag()}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" data-imagesurl="${imagesURL}" resURL="${resURL}">
<title>${%signIn} [Jenkins]</title>
<!-- we do not want bots on this page -->
<meta name="ROBOTS" content="NOFOLLOW" />
......
......@@ -79,7 +79,7 @@ THE SOFTWARE.
</j:if>
<x:doctype name="html" />
<html class="${h.isUiRefreshEnabled() ? 'ui-refresh' : ''}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" data-imagesurl="${imagesURL}" resURL="${resURL}">
${h.checkPermission(it,permission)}
<j:if test="${isMSIE}">
......
......@@ -95,7 +95,7 @@ THE SOFTWARE.
</j:if>
<x:doctype name="html" />
<html class="${h.isUiRefreshEnabled() ? 'ui-refresh' : ''}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" resURL="${resURL}">
<head data-rooturl="${rootURL}" data-resurl="${resURL}" data-imagesurl="${imagesURL}" resURL="${resURL}">
${h.checkPermission(it,permission)}
${h.checkAnyPermission(it, permissions)}
......
......@@ -2128,4 +2128,13 @@ body.no-sticker #bottom-sticker {
fill: currentColor;
}
/* -------------------------------------- */
\ No newline at end of file
/* -------------------------------------- */
/* -------------- Unclassified ---------- */
.spacer {
height: 2em;
}
/* -------------------------------------- */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册