Skip to content

Commit

Permalink
Merge pull request #439 from janfaracik/revamp-console-app-bar
Browse files Browse the repository at this point in the history
Add download option to 'Console output', move 'View as plain text' and 'Copy' buttons to app bar
  • Loading branch information
jglick authored Jul 8, 2024
2 parents b67023b + ba8a9e1 commit fa24448
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ THE SOFTWARE.
<l:layout title="${it.fullDisplayName} Console" norefresh="true">
<st:include page="sidepanel.jelly" />
<l:main-panel>
<t:buildCaption>${%Console Output}</t:buildCaption>
<j:set var="controls">
<a class="jenkins-button" href="consoleText" download="${it.displayName}.txt">
<l:icon src="symbol-download" />
${%Download}
</a>
<l:copyButton ref="out" label="${%Copy}" />
<a class="jenkins-button" href="consoleText">
${%View as plain text}
</a>
</j:set>

<t:buildCaption controls="${controls}">
${%Console Output}
</t:buildCaption>

<j:set var="threshold" value="${h.getSystemProperty('hudson.consoleTailKB')?:'150'}" />
<!-- Show at most last 150KB (can override with system property) unless consoleFull is set -->
<j:set var="offset" value="${empty(consoleFull) ? it.logText.length()-threshold*1024 : 0}" />
Expand Down Expand Up @@ -69,7 +83,7 @@ THE SOFTWARE.
<j:out value="${it.flowGraphDataAsHtml}"/>
</div>
</j:if>
<pre class="console-output">
<pre class="console-output" id="out">
<st:getOutput var="output" />
<j:whitespace>${it.writeLogTo(offset,output)}</j:whitespace>
</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,7 @@
<j:set var="buildUrl" value="${h.decompose(request)}"/>
<l:task icon="symbol-reader-outline plugin-ionicons-api" href="${buildUrl.baseUrl}/" title="${%Status}" contextMenu="false"/>
<l:task icon="symbol-code-slash-outline plugin-ionicons-api" href="${buildUrl.baseUrl}/changes" title="${%Changes}"/>
<j:choose> <!-- TODO <p:console-link/> may not currently be used as it calls getLogFile -->
<j:when test="${it.logText.length() > 200000}">
<l:task href="${h.getConsoleUrl(it)}" icon="symbol-terminal-outline plugin-ionicons-api" title="${%Console Output}"/>
<l:task href="${buildUrl.baseUrl}/consoleText" icon="symbol-document-text-outline plugin-ionicons-api" title="${%View as plain text}"/>
</j:when>
<j:otherwise>
<l:task icon="symbol-terminal-outline plugin-ionicons-api" href="${h.getConsoleUrl(it)}" title="${%Console Output}">
<l:task href="${buildUrl.baseUrl}/consoleText" icon="symbol-document-text-outline plugin-ionicons-api" title="${%View as plain text}"/>
</l:task>
</j:otherwise>
</j:choose>
<l:task href="${h.getConsoleUrl(it)}" icon="symbol-terminal-outline plugin-ionicons-api" title="${%Console Output}"/>
<!-- Build Information -->
<j:choose>
<j:when test="${h.hasPermission(it,it.UPDATE)}">
Expand Down

0 comments on commit fa24448

Please sign in to comment.