Skip to content

Commit

Permalink
Add flag for widget
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Jan 4, 2025
1 parent 6d8b531 commit 6efc5bf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
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.";
}
}
4 changes: 0 additions & 4 deletions core/src/main/resources/hudson/model/Run/consolewidget.jelly

This file was deleted.

5 changes: 4 additions & 1 deletion core/src/main/resources/hudson/model/Run/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ THE SOFTWARE.
<t:editableDescription permission="${it.UPDATE}" hideButton="true"/>
</div>

<st:include page="consolewidget.jelly" />
<l:userExperimentalFlag var="showConsoleWidget" flagClassName="jenkins.model.experimentalflags.ConsoleWidgetUserExperimentalFlag" />
<j:if test="${showConsoleWidget}">
<st:include page="console.jelly" from="${h.getConsoleProvider(it)}" optional="true" />
</j:if>

<div style="float:right; z-index: 1; position:relative; margin-left: 1em">
<div style="margin-top:1em">
Expand Down

0 comments on commit 6efc5bf

Please sign in to comment.