Skip to content

Commit

Permalink
Fix rundeck#2608 add gui toggle to not wrap long log lines
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Jul 6, 2017
1 parent f0a86ae commit a2231a7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ var FollowControl = Class.create({
obj.reload();
});
});
$(elem).select('.log-wrap-toggle').each(function (e) {
Event.observe(e, 'change', function (evt) {
Event.stop(evt);
obj.setLogWrap(e.down('input').checked ? true : false);
});
});
$(elem).select('.opt_append_top_true').each(function(e){
e.onclick=null;
Event.observe(e,'click',function(evt){obj.setOutputAppendTop(true);});
Expand Down Expand Up @@ -233,6 +239,16 @@ var FollowControl = Class.create({
this.refresh=this.tailmode;
this.readyMode();
},
setLogWrap: function (wrapped) {
"use strict";
if ($(this.cmdoutputtbl)) {
if (wrapped) {
jQuery($(this.cmdoutputtbl)).removeClass('no-wrap');
} else {
jQuery($(this.cmdoutputtbl)).addClass('no-wrap');
}
}
},
readyTail: function(){
var obj=this;
$(this.targetElement).select('.opt_mode_tail').each(Element.show);
Expand Down
8 changes: 8 additions & 0 deletions rundeckapp/grails-app/assets/stylesheets/rundeck.less
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,11 @@ section{
padding: 1px 3px;
color: black;
}
&.no-wrap {
td.data {
white-space: pre;
}
}
td.time{
padding: 0 3px;
background-color: @gray-lighter;
Expand Down Expand Up @@ -1222,6 +1227,9 @@ section{
}
.log_line{
white-space: pre-wrap;
&.no-wrap {
white-space: pre;
}
font-family: "Lucida Console", courier, monospace;
color: black;
&.level_verbose, &.level_debug {
Expand Down
4 changes: 4 additions & 0 deletions rundeckapp/grails-app/views/execution/_showFragment.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@
<input type="checkbox" checked/>
<g:message code="execution.show.mode.ansicolor.title" default="Ansi Color"/>
</label>
<label class="log-wrap-toggle">
<input type="checkbox" checked/>
<g:message code="execution.show.mode.wrapmode.title" default="Wrap Long Lines"/>
</label>

</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/views/execution/show.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<g:set var="defaultLastLines" value="${grailsApplication.config.rundeck.gui.execution.tail.lines.default}"/>
<g:set var="maxLastLines" value="${grailsApplication.config.rundeck.gui.execution.tail.lines.max}"/>
<asset:javascript src="workflow.js"/>
<g:javascript src="executionControl.js"/>
<asset:javascript src="executionControl.js"/>
<g:javascript src="executionState.js"/>
<asset:javascript src="executionState_HistoryKO.js"/>

Expand Down
2 changes: 1 addition & 1 deletion rundeckapp/grails-app/views/framework/adhoc.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<meta name="layout" content="base"/>
<meta name="tabpage" content="adhoc"/>
<title><g:message code="gui.menu.Adhoc"/> - <g:enc>${params.project ?: request.project}</g:enc></title>
<g:javascript library="executionControl"/>
<asset:javascript src="executionControl.js"/>
<g:javascript library="yellowfade"/>
<g:javascript library="pagehistory"/>
<asset:javascript src="framework/adhoc.js"/>
Expand Down

0 comments on commit a2231a7

Please sign in to comment.