-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
519eb19
commit 11e4b8d
Showing
11 changed files
with
158 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
core/src/main/java/jenkins/model/experimentalflags/ConsoleWidgetUserExperimentalFlag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2025, Jan Faracik | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
package jenkins.model.experimentalflags; | ||
|
||
import edu.umd.cs.findbugs.annotations.Nullable; | ||
import hudson.Extension; | ||
import org.kohsuke.accmod.Restricted; | ||
import org.kohsuke.accmod.restrictions.NoExternalUse; | ||
|
||
@Extension | ||
@Restricted(NoExternalUse.class) | ||
public class ConsoleWidgetUserExperimentalFlag extends BooleanUserExperimentalFlag { | ||
public ConsoleWidgetUserExperimentalFlag() { | ||
super("console-widget.flag"); | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Show Console Output on build pages"; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public String getShortDescription() { | ||
return "Shows the Console Output as a widget on build pages."; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
core/src/main/resources/hudson/model/Run/console-log.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"> | ||
<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}" /> | ||
<j:choose> | ||
<j:when test="${offset > 0}"> | ||
<a class="jenkins-button jenkins-!-accent-color jenkins-!-padding-2 jenkins-!-margin-bottom-2" style="width: 100%; justify-content: start" href="consoleFull"> | ||
<l:icon src="symbol-help-circle" /> | ||
${%skipSome(offset / 1024)} | ||
</a> | ||
</j:when> | ||
<j:otherwise> | ||
<j:set var="offset" value="${0}" /> | ||
</j:otherwise> | ||
</j:choose> | ||
|
||
<j:out value="${h.generateConsoleAnnotationScriptAndStylesheet()}"/> | ||
|
||
<j:choose> | ||
<!-- Do progressive console output --> | ||
<j:when test="${it.isLogUpdated()}"> | ||
<pre id="out" class="console-output" /> | ||
<div id="spinner"> | ||
<l:progressAnimation/> | ||
</div> | ||
<t:progressiveText href="logText/progressiveHtml" idref="out" spinner="spinner" | ||
startOffset="${offset}" onFinishEvent="jenkins:consoleFinished"/> | ||
</j:when> | ||
<!-- output is completed now. --> | ||
<j:otherwise> | ||
<pre class="console-output"> | ||
<st:getOutput var="output" /> | ||
<j:whitespace>${it.writeLogTo(offset,output)}</j:whitespace> | ||
</pre> | ||
</j:otherwise> | ||
</j:choose> | ||
</j:jelly> |
1 change: 1 addition & 0 deletions
1
core/src/main/resources/hudson/model/Run/console-log.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
skipSome=This log is too long to show here, {0,number,integer} KB has been skipped — click to see the complete log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
core/src/main/resources/jenkins/console/DefaultConsoleUrlProvider/console.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?jelly escape-by-default='true'?> | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:l="/lib/layout"> | ||
<j:set var="controls"> | ||
<a href="consoleText" download="${it.displayName}.txt" tooltip="${%Download}" class="jenkins-card__reveal"> | ||
<l:icon src="symbol-download" /> | ||
</a> | ||
</j:set> | ||
|
||
<l:card title="${%Console Output}" expandable="console" controls="${controls}"> | ||
<div class="app-console-output-widget progressive-text-container"> | ||
<st:include page="console-log.jelly" /> | ||
</div> | ||
</l:card> | ||
</j:jelly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters